<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2810237285452285117</id><updated>2024-08-28T11:14:23.937+07:00</updated><category term="Computer Architecture"/><category term="tips trik"/><category term="tutorial windows"/><category term="tutorial photoshop"/><category term="article"/><category term="operating system"/><category term="tutorial animasi"/><category term="tutorial linux"/><title type='text'>The Techno-Art Park</title><subtitle type='html'>more than just &quot;a new kid on the blog&quot;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://4them.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>81</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-8969401743727131242</id><published>2011-12-22T15:15:00.001+07:00</published><updated>2011-12-22T15:16:45.223+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: HIGH PERFORMANCE ADDITION (13)</title><content type='html'>&lt;div style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img src=&quot;http://t0.gstatic.com/images?q=tbn:ANd9GcSyHJIpbFMFg64NUeibYbd36S5jInvff4-vngEemIe5U1asUtfa&quot; /&gt; &lt;/span&gt;&lt;/div&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;3.5.1 HIGH PERFORMANCE ADDITION&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The ripple-carry adder that we reviewed in Section 3.2.2 &amp;nbsp;may introduce too&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;much delay into a system. The longest path through the adder is from the inputs&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;of the least signiﬁcant full adder to the outputs of the most signiﬁcant full adder.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The process of summing the inputs at each bit position is relatively fast (a small&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;two-level circuit sufﬁces) but the carry propagation takes a long time to work its&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;way through the circuit. In fact, the propagation time is proportional to the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;number of bits in the operands. This is unfortunate, since more signiﬁcant ﬁg&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ures in an addition translates to more time to perform the addition. &lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;In this sec&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion, we look at a method of speeding the carry propagation in what is known as&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;a carry lookahead adder.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In Appendix B, reduced Boolean expressions for the sum (si) and carry outputs&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(ci+1) of a full adder are created. These expressions are repeated below, with sub&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;scripts added to denote the relative position of a full adder in a ripple-carry&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;adder:&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/8969401743727131242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/12/computer-architecture-03-arithmetic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/8969401743727131242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/8969401743727131242'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/12/computer-architecture-03-arithmetic.html' title='Computer Architecture # 03 : Arithmetic: HIGH PERFORMANCE ADDITION (13)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-4601191458846601712</id><published>2011-12-22T04:26:00.004+07:00</published><updated>2011-12-22T04:43:43.659+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic:HIGH PERFORMANCE ARITHMETIC (12)</title><content type='html'>&lt;div style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img src=&quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBhQSEBQUExQUEhQUFBQVFBcVFRUUFRUUFBQVFBQUFBQXHCYeFxkkGRUUHy8gIycpLCwsFR4xNTAqNSYrLCkBCQoKDgwOGA8PGikcHBwsKSksLCwpKSkpLCwpKSkpKSwpKSkpLCksKSwpKSkpLCkpKSkpLSkpLCksKSwpKSksNf/AABEIAMIBAwMBIgACEQEDEQH/xAAcAAAABwEBAAAAAAAAAAAAAAAAAQIDBAUHBgj/xABFEAABAwEEBgYIBAMGBwEAAAABAAIRAwQSITEFBkFRYXEHEyKBkaEUMkJSU7HB8COS0eEVQ2IWF2NygvEzNJOiwtLTJP/EABgBAQEBAQEAAAAAAAAAAAAAAAEAAgME/8QALhEBAAICAQIFAgQHAQAAAAAAAAERAhIhAzEEE0FRYXGRFCKBoTJScrHB0eEj/9oADAMBAAIRAxEAPwDT2UOCeaxPhiWKa8dO9mA1ONanhTShTVSsyGpQanerRhiqVmriHVp64juKpWYNAbh4JJsbT7I8FJuo4VyLQjo2mfYCQ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uVOa0RWWGmQOyG75e48NgTFpsbcQ1gGUEFx54EqzbYKp93uAVhQsBAyk8oRPUMYOZpaKJO1XejtCsGJbJV5ZNEVHZMd3j6q7suqNV2YhcZzt0jGIVlmptgC6ABwCutHkyIPkrSyakEZuV1Y9WWM5+BWVZqxAxl4K4oPMZo6VhDcvNPinwWohiZgV/gglhoQWhcODtOo7HZGCqut0cnmPNaNcBS2SM8QsOjKKvRo/wBgg8Dgob+jiv7nngtpFNpShT71upY3hhzuj2sM6R5gyE43o2rHJniVtwpBAUwnXIbwxMdG9f4fml0ujyqTBpweJhbVcCI0huTpkfMj2ZC3ouqnIN7zilf3ZVcrrfHHxWuhiOFaT7jzGTs6Lamy5yKcZ0Xv2lg7itUhHCfLn3XmfDMG9Fzveb4SnmdF595vh9VpEI1eXPuvMZ2zoyHvx3fVSqfRqza+eQC7pBXlfI8yXFjo1pe+7wCV/dtR95y7JBPlQN5cc3o6pe848Cnf7vbP/UDwK6xBXlQt5cvT1BoDMXuacdqHZj7BHeukQV5ULeXNM1Fs49gHmpTdUqHw294V2gryoW8qZuqtnGVNo7lIpaFptya3wCsURRPShbyYbZGj2QOQR+jtTpRSszjEC5JuQlJMdyVKoMhCCNBaZFKJGggoQ9YqQ1BBcnbIkqQxBBdcO7nn2GUaCC6uYgjQQUgQQQUgCCCC0gQQQUgQQQUgQQQUgQQQUgQQQUgRFBBCGiQQRIE5EUSC5ZNwSPWSnoILMNSMZpLs0EFr0EHIRIIJD//Z&quot; /&gt; &lt;/div&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3.5 HIGH PERFORMANCE ARITHMETIC&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;For many applications, the speed of arithmetic operations are the bottleneck to&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;performance. Most supercomputers, such as the Cray, the Tera, and the Intel&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Hypercube are considered “super” because they excel at performing ﬁxed and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ﬂoating point arithmetic. In this section we discuss a number of ways to improve&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the speed of addition, subtraction, multiplication, and division.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/4601191458846601712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/12/computer-architecture-03-arithmetichigh.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4601191458846601712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4601191458846601712'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/12/computer-architecture-03-arithmetichigh.html' title='Computer Architecture # 03 : Arithmetic:HIGH PERFORMANCE ARITHMETIC (12)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-4950896466285822453</id><published>2011-12-22T04:26:00.002+07:00</published><updated>2011-12-22T04:36:44.579+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic:FLOATING POINT MULTIPLICATION AND DIVISION (12)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img src=&quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBhQSERUUEhQWFBUVFRQYFxgXGBgUFxcYFRUVFxgVGBcYHCYfFxkjGRQUHy8gIycpLCwsFR4xNTAqNSYrLCkBCQoKDgwOGg8PGiwkHyQsLCwpLCwsLCwsLCwsLCwsLCwsLCwsKSwsLCwsLCwsLCksLCwsLCwpLCwsLCwpLCwsKf/AABEIAOMA3gMBIgACEQEDEQH/xAAcAAACAwEBAQEAAAAAAAAAAAADBAECBQAGBwj/xABAEAABAwIEBAMECAQFBAMAAAABAAIRAyEEEjFBBSJRYRNxkTKBocEGI0JSYrHR8BQVcuEzgpKi8QckU+JDstL/xAAZAQADAQEBAAAAAAAAAAAAAAAAAQIDBAX/xAAiEQEBAQACAwEAAgMBAAAAAAAAARECIRIxQQNRYSIycRP/2gAMAwEAAhEDEQA/AAVW6367HWDy28wqVPnexkEEgCd9AmsRTA+5aAQDVvAbz3baZNvwlJ4ka6DW/ObS4gm0dFhKdgLj+40KE8x81aoRe46aGLboFV3r5ajqrlLA67/7rGxDNZWw5mn7lIYxq048sTYSwbrx1VcDU8Kv5mPVUpmHDsu4uMtWR2K6bWePVCoSfeY0O+qNTcCY5zpl5WnM/l5XcwhvlPks5lfMAcntaWgDs0ymMPjmteGVGNbmhsnny6czQNHW1uuTa38TZqiwOYCxPK2Q6DLRe7NbW8kLPrnzAQXSA12U5XOEXFiY30vsE/8AwdwPCPstkDD1CPD+r+uAN3G7p+UiV6hYG2AJAj/CILgWvJe8lx5w46tgS2YhKchhVwLbODmwYcPuu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hy5yhcqKocEKoFy5BAEKhC5cnSqsIjVy5X8JcNUQpXKDQ5CqLlymiKKAVy5KGgqhULlfwR//2Q==&quot; /&gt; &lt;/div&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3.4.2 FLOATING POINT MULTIPLICATION AND DIVISION&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Floating point multiplication and division are performed in a manner similar to&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ﬂoating point addition and subtraction, except that the sign, exponent, and frac&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion of the result can be computed separately. If the operands have the same sign,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;then the sign of the result is positive. Unlike signs produce a negative result. The&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;exponent of the result before normalization is obtained by adding the exponents&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;of the source operands for multiplication, or by subtracting the divisor exponent&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;from the dividend exponent for division. The fractions are multiplied or divided&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;according to the operation, followed by normalization.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;Consider using three-bit fractions in performing the base 2 computation: (+.101&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;&amp;nbsp;× 2&lt;/span&gt;&lt;sup style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;2&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;) &amp;nbsp;× (−.110 &amp;nbsp;× 2&lt;/span&gt;&lt;sup style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;-3&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;). The source operand signs differ, which means that the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;result will have a negative sign. We add exponents for multiplication, and so the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;exponent of the result is 2 + −3 = −1. We multiply the fractions, which produces&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;the product .01111. Normalizing the product and retaining only three bits in the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;fraction produces −.111 × 2&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt; &lt;/span&gt;&lt;sup&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;-2&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; text-align: justify;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Now consider using three-bit fractions in performing the base 2 computation:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(+.110 × 2&lt;/span&gt;&lt;sup&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;5&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;/ (+.100 × 2&lt;/span&gt;&lt;sup&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;4&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;. The source operand signs are the same, which means&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;that the result will have a positive sign. We subtract exponents for division, and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;so the exponent of the result is 5 – 4 = 1. We divide fractions, which can be done&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;in a number of ways. If we treat the fractions as unsigned integers, then we will&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;have 110/100 = 1 with a remainder of 10. What we really want is a contiguous&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;set of bits representing the fraction instead of a separate result and remainder,&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and so we can scale the dividend to the left by two positions, producing the&amp;nbsp;result: 11000/100 = 110. We then scale the result to the right by two positions to&amp;nbsp;restore the original scale factor, producing 1.1. Putting it all together, the result&amp;nbsp;of dividing (+.110 × 2&lt;/span&gt;&lt;sup&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;5&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;by (+.100 × 2&lt;/span&gt;&lt;sup&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;4&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;produces (+1.10 × 2&lt;/span&gt;&lt;sup&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;1&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;. After normalization, the ﬁnal result is (+.110 × 2&lt;/span&gt;&lt;sup&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;2&lt;/span&gt;&lt;/sup&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/4950896466285822453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/12/computer-architecture-03.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4950896466285822453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4950896466285822453'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/12/computer-architecture-03.html' title='Computer Architecture # 03 : Arithmetic:FLOATING POINT MULTIPLICATION AND DIVISION (12)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-3917443320329529733</id><published>2011-10-10T05:35:00.000+07:00</published><updated>2011-10-10T05:35:08.101+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: FLOATING POINT ADDITION AND SUBTRACTION (10)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img src=&quot;http://t1.gstatic.com/images?q=tbn:ANd9GcSggMqyE47Hp300GqUbPl1AUmLIF3vamuBHD358lyNxDQXAVb5Tsw&quot; /&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;3.4.1 FLOATING POINT ADDITION AND SUBTRACTION&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Floating point arithmetic differs from integer arithmetic in that exponents must&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;be handled as well as the magnitudes of the operands. As in ordinary base 10&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;arithmetic using scientiﬁc notation, the exponents of the operands must be made&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;equal for addition and subtraction. The fractions are then added or subtracted as&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;appropriate, and the result is normalized.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This process of adjusting the fractional part, and also rounding the result can&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;lead to a loss of precision in the result. Consider the unsigned ﬂoating point&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;addition (.101 × 2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;3&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;+ .111 ×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;4&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;) in which the fractions have three signiﬁcant dig&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;its. We start by adjusting the smaller exponent to be equal to the larger exponent,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and adjusting the fraction accordingly. &lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Thus we have .101 ×&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;3&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= .010 ×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;4&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, los&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ing .001 ×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;3&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;of precision in the process. The resulting sum is&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(.010 + .111) ×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;4&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= 1.001 ×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;4&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= .1001 ×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;5&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;,&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and rounding to three signiﬁcant digits, .100 &amp;nbsp;×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;5&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, and we have lost another&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;0.001 ×&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; line-height: 17px;&quot;&gt;&lt;sup style=&quot;font-size: 15px;&quot;&gt;4&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;in the rounding process.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;i&gt;&lt;b&gt;Why do ﬂoating point numbers have such complicated formats?&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;We may wonder why ﬂoating point numbers have such a complicated structure,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;with the mantissa being stored in signed magnitude representation, the exponent&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;stored in excess notation, and the sign bit separated from the rest of the magni&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tude by the intervening exponent ﬁeld. There is a simple explanation for this&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;structure. Consider the complexity of performing ﬂoating point arithmetic in a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;computer. Before any arithmetic can be done, the number must be unpacked&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;from the form it takes in storage. (See Chapter 2 for a description of the IEEE&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;754 ﬂoating point format.) The exponent and mantissa must be extracted from&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the packed bit pattern before an arithmetic operation can be performed; after the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;arithmetic operation(s) are performed, the result must be renormalized and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;rounded, and then the bit patterns are re-packed into the requisite format.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The virtue of a ﬂoating point format that contains a sign bit followed by an&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;exponent in excess notation, followed by the magnitude of the mantissa, is that&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;two ﬂoating point numbers can be compared for &amp;gt;, &amp;lt;, and = without unpacking.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The sign bit is most important in such a comparison, and it appropriately is the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;MSB in the ﬂoating point format. Next most important in comparing two num&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;bers is the exponent, since a change of ± 1 in the exponent changes the value by a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;factor of 2 (for a base 2 format), whereas a change in even the MSB of the frac&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tional part will change the value of the ﬂoating point number by less than that.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In order to account for the sign bit, the signed magnitude fractions are repre&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;sented as integers and are converted into two’s complement form. After the addi&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion or subtraction operation takes place in two’s complement, there may be a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;need to normalize the result and adjust the sign bit. The result is then converted&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;back to signed magnitude form.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/3917443320329529733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/10/computer-architecture-03-arithmetic_10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/3917443320329529733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/3917443320329529733'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/10/computer-architecture-03-arithmetic_10.html' title='Computer Architecture # 03 : Arithmetic: FLOATING POINT ADDITION AND SUBTRACTION (10)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-55621253511380987</id><published>2011-10-10T05:16:00.001+07:00</published><updated>2011-10-10T05:20:41.102+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: FLOATING POINT ARITHMETIC (10)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b style=&quot;clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img src=&quot;data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBhASERMUEhIUFBQUGRcVFxcVFBUSGBcVFxcVFhYVEhUYHSYeGBokGRYWHy8gIycqLSwsFx4xNTAqNSYrLCkBCQoKBQUFDQUFDSkYEhgpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKf/AABEIALYBFQMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABAUCAwYBB//EAEYQAAEDAgIDDQYEBAQGAwAAAAEAAgMEERIhBTFR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uxAOY1HNHxNNrgGxuLi9iNRGwoiD18TTa4Bsbi4vY7RsOa1CgixY97ZivfFhbivtva90RAnoYnm742OOq7mtcbbLkLJlJG3DZjRhvhs0DDfXh2XuiIMt5bixWGK1r2ztrtfXa/IvIqdjb4Whtzc2AFztNtZREGxERAREQEREBERAREQEREBERB//9k=&quot; /&gt;&lt;/b&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;3.4 Floating Point Arithmetic&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Arithmetic operations on ﬂoating point numbers can be carried out using the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ﬁxed point arithmetic operations described in the previous sections, with atten&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion given to maintaining aspects of the ﬂoating point representation. In the sec&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tions that follow, we explore ﬂoating point arithmetic in base 2 and base 10,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;keeping the requirements of the ﬂoating point representation in mind.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/55621253511380987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/10/computer-architecture-03-arithmetic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/55621253511380987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/55621253511380987'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/10/computer-architecture-03-arithmetic.html' title='Computer Architecture # 03 : Arithmetic: FLOATING POINT ARITHMETIC (10)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-5774612640056206682</id><published>2011-09-16T05:59:00.000+07:00</published><updated>2011-09-16T05:59:54.658+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 :Arithmetic : SIGNED MULTIPLICATION AND DIVISION (9)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;3.3.3 SIGNED MULTIPLICATION AND DIVISION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If we apply the multiplication and division methods described in the previous&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;sections to signed integers, then we will run into some trouble. Consider multi&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;plying −1 by +1 using four-bit words, as shown in the left side of Figure 3-16.&lt;/span&gt;&lt;/div&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The eight-bit equivalent of +15 is produced instead of −1. What went wrong is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;that the sign bit did not get extended to the left of the result. This is not a prob&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;lem for a positive result because the high order bits default to 0, producing the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;correct sign bit 0.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A solution is shown in the right side of Figure 3-16, in which each partial product is extended to the width of the result, and only the rightmost eight bits of the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;result are retained. If both operands are negative, then the signs are extended for&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;both operands, again retaining only the rightmost eight bits of the result.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Times New Roman&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLfAtfLPrlqgF7pMmu4dCd__tMEYEjSajgEXr4lOQpuq0PCt3PsogLU5OhuRiPPpOH9ldz4pPbNGViPp8-AFpMxmyeL1iZuaSnnZIk4y_mMXszu7VtAPX_khJuiG6lTWpmVu3-6O3SKuVB/s1600/333+a.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLfAtfLPrlqgF7pMmu4dCd__tMEYEjSajgEXr4lOQpuq0PCt3PsogLU5OhuRiPPpOH9ldz4pPbNGViPp8-AFpMxmyeL1iZuaSnnZIk4y_mMXszu7VtAPX_khJuiG6lTWpmVu3-6O3SKuVB/s320/333+a.JPG&quot; style=&quot;cursor: move;&quot; width=&quot;235&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &#39;Times New Roman&#39;; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 3-15 &amp;nbsp; &amp;nbsp;An example of division using the serial divider.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg05WOGQe8twkcE53x0U34cnk5TQ-t-cUA1UayQB7jaEhkFbbdX3FcnlQaMqji0Y0fG7Bfy_pRib5ftXO0ESpUP7ThWS1uj1GWv4Pxx88JnllPB5uVwxUfI3fwcpEBBSQ3ia8tL1tDTBjY/s1600/333+b.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;118&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg05WOGQe8twkcE53x0U34cnk5TQ-t-cUA1UayQB7jaEhkFbbdX3FcnlQaMqji0Y0fG7Bfy_pRib5ftXO0ESpUP7ThWS1uj1GWv4Pxx88JnllPB5uVwxUfI3fwcpEBBSQ3ia8tL1tDTBjY/s320/333+b.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 3-16 &amp;nbsp; &amp;nbsp;Multiplication of signed integers.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Signed division is more difﬁcult. We will not explore the methods here, but as a&amp;nbsp;general technique, we can convert the operands into their positive forms, per&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;form the division, and then convert the result into its true signed form as a ﬁnal&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;step.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/5774612640056206682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/5774612640056206682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/5774612640056206682'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic_16.html' title='Computer Architecture # 03 :Arithmetic : SIGNED MULTIPLICATION AND DIVISION (9)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLfAtfLPrlqgF7pMmu4dCd__tMEYEjSajgEXr4lOQpuq0PCt3PsogLU5OhuRiPPpOH9ldz4pPbNGViPp8-AFpMxmyeL1iZuaSnnZIk4y_mMXszu7VtAPX_khJuiG6lTWpmVu3-6O3SKuVB/s72-c/333+a.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-3312486296509153593</id><published>2011-09-10T02:17:00.000+07:00</published><updated>2011-09-10T02:17:06.943+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 :Arithmetic : UNSIGNED DIVISION (8)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0763772232&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.3.2 UNSIGNED DIVISION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In longhand binary division, we must successively attempt to subtract the divisor&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;from the dividend, using the fewest number of bits in the dividend as we can.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 3-13 illustrates this point by showing that (11)2 does not “ﬁt” in 0 or 01,&amp;nbsp;but does ﬁt in 011 as indicated by the pattern 001 that starts the quotient.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Computer-based division of binary integers can be handled similar to the way&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;that binary integer multiplication is carried out, but with the complication that&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the only way to tell if the dividend does not “ﬁt” is to actually do the subtraction&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and test if the remainder is negative. If the remainder is negative then the sub&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;traction must be “backed out” by adding the divisor back in, as described below.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In the division algorithm, instead of shifting the product to the right as we did&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;for multiplication, we now shift the quotient to the left, and we subtract instead&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;of adding. When two n-bit unsigned numbers are being divided, the result is no&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;larger than n bits.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/3312486296509153593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic_880.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/3312486296509153593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/3312486296509153593'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic_880.html' title='Computer Architecture # 03 :Arithmetic : UNSIGNED DIVISION (8)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-2326743159067051366</id><published>2011-09-10T02:11:00.000+07:00</published><updated>2011-09-10T02:11:08.088+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 :Arithmetic : UNSIGNED MULTIPLICATION (7)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=012383872X&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.3.1 UNSIGNED MULTIPLICATION&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Multiplication of unsigned binary integers is handled similar to the way it is carried out by hand for decimal numbers. Figure 3-10 illustrates the multiplication&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;process for two unsigned binary integers. Each bit of the multiplier determines&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;whether or not the multiplicand, shifted left according to the position of the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;multiplier bit, is added into the product. When two unsigned n-bit numbers are&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;multiplied, the result can be as large as 2n bits. For the example shown in Figure&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3-10, the multiplication of two four-bit operands results in an eight-bit product.&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPVnwKgTssGms5Iif15aBATWtBNcxyF0C2hb7Z5ZbdRfCGW-4xzjdqMguePfmk2oOOmdp5GpzSzGzcepiNzcwKlKd765uHufTxpFbEbzZzDzE0V7GXRtEHnMYSRJgw0nhRLoVPhUIz7UwA/s1600/331+a.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPVnwKgTssGms5Iif15aBATWtBNcxyF0C2hb7Z5ZbdRfCGW-4xzjdqMguePfmk2oOOmdp5GpzSzGzcepiNzcwKlKd765uHufTxpFbEbzZzDzE0V7GXRtEHnMYSRJgw0nhRLoVPhUIz7UwA/s1600/331+a.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;Figure 3-10 &amp;nbsp; &amp;nbsp;Multiplication of two unsigned binary integers.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;When two signed n-bit numbers are multiplied, the result can be as large as only&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2(n-1)+1 = (2n-1) bits, because this is equivalent to multiplying two (n-1)-bit&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;unsigned numbers and then introducing the sign bit.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A hardware implementation of integer multiplication can take a similar form to&amp;nbsp;the manual method. Figure 3-11 shows a layout of a multiplication unit for &amp;nbsp;four-bit numbers, in which there is a four-bit adder, a control unit, three four-bit&amp;nbsp;registers, and a one-bit carry register.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5b5osMOuhzaryIBUgnvmlskeIcNBcs3gEtV2u3SqusMzCbeWl2IwRe8d6FS1WyD561dzUeeM-7I_lxiccFGiGs8Use6knroDWj_xThrn8YSbvISOWR9xm7Oza0da1rWT1wZxxL-4XQZzv/s1600/331+b.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5b5osMOuhzaryIBUgnvmlskeIcNBcs3gEtV2u3SqusMzCbeWl2IwRe8d6FS1WyD561dzUeeM-7I_lxiccFGiGs8Use6knroDWj_xThrn8YSbvISOWR9xm7Oza0da1rWT1wZxxL-4XQZzv/s1600/331+b.JPG&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Figure 3-11 &amp;nbsp; &amp;nbsp;A serial multiplier.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In order to multiply two numbers, the multiplicand is placed in the M register, the multiplier is placed in the Q register, and&amp;nbsp;the A and C registers are cleared to zero. During multiplication, the rightmost bit&amp;nbsp;of the multiplier determines whether the multiplicand is added into the product&amp;nbsp;at each step. After the multiplicand is added into the product, the multiplier and&amp;nbsp;the A register are simultaneously shifted to the right. This has the effect of shifting the multiplicand to the left (as for the manual process) and exposing the next&amp;nbsp;bit of the multiplier in position q0.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 3-12 illustrates the multiplication process. Initially, C and A are cleared,&amp;nbsp;and M and Q hold the multiplicand and multiplier, respectively.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibrMA1pyo3hAiMEgyUoPh65ZFeQ2Hl5JROT4Vh4BcCpJ4w_Fqw2hWhrIIntri8Tm7nIq58oBkMeIiWEWZTo6WVBZEMHQ6RrnFWB8jzsAvNmfiVNu4JjlKBygR-XNPvRHzpFVZNKiG22y-G/s1600/331+c.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibrMA1pyo3hAiMEgyUoPh65ZFeQ2Hl5JROT4Vh4BcCpJ4w_Fqw2hWhrIIntri8Tm7nIq58oBkMeIiWEWZTo6WVBZEMHQ6RrnFWB8jzsAvNmfiVNu4JjlKBygR-XNPvRHzpFVZNKiG22y-G/s1600/331+c.JPG&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Figure 3-12 &amp;nbsp; &amp;nbsp;An example of multiplication using the serial multiplier.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The rightmost&amp;nbsp;bit of Q is 1, and so the multiplier M is added into the product in the A register.&amp;nbsp;The A and Q registers together make up the eight-bit product, but the A register&amp;nbsp;is where the multiplicand is added. After M is added to A, the A and Q registers&amp;nbsp;are shifted to the right. Since the A and Q registers are linked as a pair to form&amp;nbsp;the eight-bit product, the rightmost bit of A is shifted into the leftmost bit of Q.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The rightmost bit of Q is then dropped, C is shifted into the leftmost bit of A,&amp;nbsp;and a 0 is shifted into C.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The process continues for as many steps as there are bits in the multiplier. On the&amp;nbsp;second iteration, the rightmost bit of Q is again 1, and so the multiplicand is&amp;nbsp;added to A and the C/A/Q combination is shifted to the right. On the third iteration, the rightmost bit of Q is 0 so M is not added to A, but the C/A/Q combination is still shifted to the right. Finally, on the fourth iteration, the rightmost&amp;nbsp;bit of Q is again 1, and so M is added to A and the C/A/Q combination is&amp;nbsp;shifted to the right. The product is now contained in the A and Q registers, in&amp;nbsp;which A holds the high-order bits and Q holds the low-order bits.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/2326743159067051366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic_10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/2326743159067051366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/2326743159067051366'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic_10.html' title='Computer Architecture # 03 :Arithmetic : UNSIGNED MULTIPLICATION (7)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPVnwKgTssGms5Iif15aBATWtBNcxyF0C2hb7Z5ZbdRfCGW-4xzjdqMguePfmk2oOOmdp5GpzSzGzcepiNzcwKlKd765uHufTxpFbEbzZzDzE0V7GXRtEHnMYSRJgw0nhRLoVPhUIz7UwA/s72-c/331+a.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-6039764879233334501</id><published>2011-09-07T19:14:00.002+07:00</published><updated>2011-09-10T01:47:10.421+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 :Arithmetic : FIXED POINT MULTIPLICATION AND DIVISION (6)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1441908765&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.3 Fixed Point Multiplication and Division&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Multiplication and division of ﬁxed point numbers can be accomplished with&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;addition, subtraction, and shift operations. The sections that follow describe&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;methods for performing multiplication and division of ﬁxed point numbers in&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;both unsigned and signed forms using these basic operations. We will ﬁrst cover&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;unsigned multiplication and division, and then we will cover signed multiplica&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion and division.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/6039764879233334501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-fixed-point.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6039764879233334501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6039764879233334501'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-fixed-point.html' title='Computer Architecture # 03 :Arithmetic : FIXED POINT MULTIPLICATION AND DIVISION (6)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-7854341645012278740</id><published>2011-09-07T19:05:00.001+07:00</published><updated>2011-09-07T21:50:03.306+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: ONE’S COMPLEMENT ADDITION AND SUBTRACTION (5)</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B004HZYA6E&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.2.3&amp;nbsp;ONE’S COMPLEMENT ADDITION AND SUBTRACTION&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Although it is not heavily used in mainstream computing anymore, the one’s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;complement representation was used in early computers.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;One’s complement&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;addition is handled somewhat differently from two’s complement addition: the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;carry out of the leftmost position is not discarded, but is added back into the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;least signiﬁcant position of the integer portion as shown in &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 3-7.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;known as an&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;end-around carry&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRGFr7ruIcWjVYhcQcyyrTdKiiA62gtVlX83KFOfbW0QImoQh6OIHEl5q-bbCWy5DjlK6mwLpTAintkkwRiLTX0Hs254MB-c4NS2b9_p0Vzhc4H41tveU3vWz4SsZfQ4vJhjgxV65YIhP5/s1600/323+a.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRGFr7ruIcWjVYhcQcyyrTdKiiA62gtVlX83KFOfbW0QImoQh6OIHEl5q-bbCWy5DjlK6mwLpTAintkkwRiLTX0Hs254MB-c4NS2b9_p0Vzhc4H41tveU3vWz4SsZfQ4vJhjgxV65YIhP5/s1600/323+a.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRGFr7ruIcWjVYhcQcyyrTdKiiA62gtVlX83KFOfbW0QImoQh6OIHEl5q-bbCWy5DjlK6mwLpTAintkkwRiLTX0Hs254MB-c4NS2b9_p0Vzhc4H41tveU3vWz4SsZfQ4vJhjgxV65YIhP5/s200/323+a.JPG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;We can better visualize the reason that the end-around carry is needed by exam&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ining the 3-bit one’s complement number circle in Figure 3-8.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr_Kng2Cl2hIwanUHVCTzPMvak7oKwSpZ0XA3yK-JWgZYIFr5x0IqnyA3_b8Eafp63qzNNHtKVlipc1cXQedZj6fpouTUV1BojN0WXlHwNi7PQxcCE8HWuQVe40kLXjktuMmJoEloBohVC/s1600/323+b.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;249&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr_Kng2Cl2hIwanUHVCTzPMvak7oKwSpZ0XA3yK-JWgZYIFr5x0IqnyA3_b8Eafp63qzNNHtKVlipc1cXQedZj6fpouTUV1BojN0WXlHwNi7PQxcCE8HWuQVe40kLXjktuMmJoEloBohVC/s320/323+b.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Notice that the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;number circle has two positions for 0. When we add two numbers, if we traverse&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;through both&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;0 and +0, then we must compensate for the fact that 0 is visited&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;twice. The end-around carry advances the result by one position for this situa&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Notice that the distance between&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;0 and +0 on the number circle is the distance&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;between two integers, and is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;the distance between two successive represent&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;able numbers. As an illustration of this point, consider adding (5.5)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1.0)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;in one’s complement arithmetic, which is shown in Figure 3-9. (Note&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;that we can also treat this as a subtraction problem, in which the subtrahend is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;negated by complementing all of the bits, before adding it to the minuend.)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ1UxhUhyphenhyphenjcKivR8CGSTOasdKfWHOA3nlxCJMyeeIzKDStyQ1qeZUDQSANQ8GS-goh2Y2PUuQpWEHTnK7am9i8gaKr8Lln3jzlX0iSb4266cPKWl7BrP3nNHwJTOnv803txb3mmcfPLiFq/s1600/323+c.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ1UxhUhyphenhyphenjcKivR8CGSTOasdKfWHOA3nlxCJMyeeIzKDStyQ1qeZUDQSANQ8GS-goh2Y2PUuQpWEHTnK7am9i8gaKr8Lln3jzlX0iSb4266cPKWl7BrP3nNHwJTOnv803txb3mmcfPLiFq/s200/323+c.JPG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;order to add (+5.5)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;and (&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1.0)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;and obtain the correct result in one’s comple&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ment, we add the end-around carry into the one’s position as shown. This adds&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;complexity to our number circle, because in the gap between +0 and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;0, there&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;are valid numbers that represent fractions that are less than 0, yet they appear on&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the number circle before&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;0 appears. If the number circle is reordered to avoid&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;this anomaly, then addition must be handled in a more complex manner.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The need to look for two different representations for zero, and the potential&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;need to perform another addition for the end-around carry are two important&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;reasons for preferring the two’s complement arithmetic to one’s complement&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;arithmetic.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/7854341645012278740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7854341645012278740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7854341645012278740'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/09/computer-architecture-03-arithmetic.html' title='Computer Architecture # 03 : Arithmetic: ONE’S COMPLEMENT ADDITION AND SUBTRACTION (5)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRGFr7ruIcWjVYhcQcyyrTdKiiA62gtVlX83KFOfbW0QImoQh6OIHEl5q-bbCWy5DjlK6mwLpTAintkkwRiLTX0Hs254MB-c4NS2b9_p0Vzhc4H41tveU3vWz4SsZfQ4vJhjgxV65YIhP5/s72-c/323+a.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-7383943070188968893</id><published>2011-09-07T08:33:00.003+07:00</published><updated>2011-09-10T02:22:14.277+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: HARDWARE IMPLEMENTATION OF ADDERS AND SUBTRACTORS</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0195328485&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.2.2&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;HARDWARE IMPLEMENTATION OF ADDERS AND SUBTRACTORS&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Up until now we have focused on algorithms for addition and subtraction. Now&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;we will take a look at implementations of simple adders and subtractors.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Ripple-Carry Addition and Ripple-Borrow Subtraction&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In Appendix A, a design of a four-bit ripple-carry adder is explored. The adder is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;modeled after the way that we normally perform decimal addition by hand, by&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;summing digits in one column at a time while moving from right to left. In this&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;section, we review the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;ripple-carry adder&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, and then take a look at &lt;b&gt;a&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ripple-bor&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;row subtractor&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;. We then combine the two into a single addition/subtraction&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;unit.&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAeLZScisT6zOfyHVe2FGoX3N9plDLA4tOWerf83Sy6HCpUxYZ8frTiyIXMJimps4zi4Rx5PNbm77RXKq7WnANrWKR4kR0CP1uqF5b0orYVmWAM6o4Ly8VWlGHP6L_8hx8XnYdydaduQPV/s1600/322+a.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAeLZScisT6zOfyHVe2FGoX3N9plDLA4tOWerf83Sy6HCpUxYZ8frTiyIXMJimps4zi4Rx5PNbm77RXKq7WnANrWKR4kR0CP1uqF5b0orYVmWAM6o4Ly8VWlGHP6L_8hx8XnYdydaduQPV/s1600/322+a.JPG&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 3-2 shows a 4-bit ripple-carry adder that is developed in Appendix A. Two&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;binary nnumbers&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;B&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;are added from right to left, creating a sum and a carry &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;at the outputs of each full adder for each bit position.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Four 4-bit ripple-carry adders are cascaded in Figure 3-3 to add two 16-bit numbers. The rightmost full adder has a carry-in of 0. Although the rightmost full&amp;nbsp;adder can be simpliﬁed as a result of the carry-in of 0, we will use the more general form and force&amp;nbsp;c&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;0&amp;nbsp;&lt;/span&gt;&amp;nbsp;to 0 in order to simplify subtraction later on.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK0RFk7WBef-RRyakGK4U7yVRIhGREH3DVlwZfhd-4Jmtf3svwlIKWniWGvnxlMsM4_OcEW0EWnUYv_P7WIJyQHVOLD08FbNdhFmkvfl4lt2e71A2Sntl2Q71Bm7nE0RbNuUnbdSDRX3CS/s1600/322+b.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;133&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK0RFk7WBef-RRyakGK4U7yVRIhGREH3DVlwZfhd-4Jmtf3svwlIKWniWGvnxlMsM4_OcEW0EWnUYv_P7WIJyQHVOLD08FbNdhFmkvfl4lt2e71A2Sntl2Q71Bm7nE0RbNuUnbdSDRX3CS/s320/322+b.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Subtraction&lt;/b&gt;&amp;nbsp;&amp;nbsp;of binary numbers proceeds in a fashion analogous to addition. We&amp;nbsp;can subtract oone number from another by working in a single column at a time,subtracting digits of the&amp;nbsp;&lt;b&gt;subtrahend&amp;nbsp;&lt;/b&gt;b&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;, from the&amp;nbsp;minuend&amp;nbsp;a&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;, as we move from&amp;nbsp;right to left. As in decimal subtraction, if the subtrahend is larger than the minuend or there is a borrow from a previous digit then a borrow must be propagated&amp;nbsp;to the next most signiﬁcant bit. Figure 3-4 shows the truth table and a&amp;nbsp;“black-box” circuit for subtraction.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRqfjYa26ai_OMvR9rC7-JIQWyLqkTQSiYhcD5K6mlOyWKky0v75c3Va-66HZHy7nWxOQFtiWKmtnw4hr7589mURkzvAdIp4uIQzN1nuD_zmW6LVHGsNCjbbHN71mfjmHpdQoRl68YPuCO/s1600/322+c.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRqfjYa26ai_OMvR9rC7-JIQWyLqkTQSiYhcD5K6mlOyWKky0v75c3Va-66HZHy7nWxOQFtiWKmtnw4hr7589mURkzvAdIp4uIQzN1nuD_zmW6LVHGsNCjbbHN71mfjmHpdQoRl68YPuCO/s320/322+c.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Full subtractors can be cascaded to form&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;ripple-borrow&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;subtractors in the same&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;manner that full adders are cascaded to form ripple-carry adders. Figure 3-5 illus&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;trates a four-bit ripple-borrow subtractor that is made up of four full subtractors.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGjhC9fSUFospPzhZQ5UKLCix0JdXqnRUhuCnnhXQPTfAxhuUIshqjGdwlknSSGqmwkkKkaoGpRodXfDKYPSS3bnfbwxTW3FCFgIiCe84B-1PwpcVIeu5LTMNY2wW2mJLr-vl0awbT_nQd/s1600/322+d.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGjhC9fSUFospPzhZQ5UKLCix0JdXqnRUhuCnnhXQPTfAxhuUIshqjGdwlknSSGqmwkkKkaoGpRodXfDKYPSS3bnfbwxTW3FCFgIiCe84B-1PwpcVIeu5LTMNY2wW2mJLr-vl0awbT_nQd/s320/322+d.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As discussed above, an alternative method of implementing subtraction is to&amp;nbsp;form the two’s complement negative of the subtrahend and&amp;nbsp;add&amp;nbsp;it to the minuend.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikm23k6pjztE9l3zcwCF8WHTmsgaG1Rna_186mJi55O77tGlTUKbyg2y5rt4n5XdiyabmoPv6WaSoMwSrDMCWiWjrb0kTo1Iu2JJ_QTzHixlpsYtfAAlVqs28lf7f_U0YpCpaBhz5J86n0/s1600/322+e.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;199&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikm23k6pjztE9l3zcwCF8WHTmsgaG1Rna_186mJi55O77tGlTUKbyg2y5rt4n5XdiyabmoPv6WaSoMwSrDMCWiWjrb0kTo1Iu2JJ_QTzHixlpsYtfAAlVqs28lf7f_U0YpCpaBhz5J86n0/s320/322+e.JPG&quot; style=&quot;cursor: move;&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The circuit that is shown in Figure 3-6 performs both addition and subtrac&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion on four-bit two’s complement numbers by allowing the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;inputs to be&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;complemented when subtraction is desired. An &amp;nbsp;ADD/SUBTRACT control line&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;determines which function is performed. The bar over the ADD symbol indi&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;cates the ADD operation is active when the signal is low. That is, if the control&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;line is 0, then the&amp;nbsp;a&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&amp;nbsp;and&amp;nbsp;b&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&amp;nbsp;inputs are passed through to the adder, and the sum is&amp;nbsp;generated at the&amp;nbsp;s&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&amp;nbsp;outputs. If the control line is 1, then the&amp;nbsp;a&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&amp;nbsp;inputs are passed&amp;nbsp;through to the adder, but the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;b&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&amp;nbsp;&amp;nbsp;inputs are one’s complemented by the XOR&amp;nbsp;gates before they are passed on to the adder. In order to form the two’s complement negative, we must add 1 to the one’s complement negative, which is&amp;nbsp;accomplished by setting the&amp;nbsp;&lt;i&gt;carry_in&lt;/i&gt;&amp;nbsp;&amp;nbsp;line (c&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;0&lt;/span&gt;) to 1 with the control input. In this&amp;nbsp;way, we can share the adder hardware among both the adder and the subtractor.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/7383943070188968893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/09/3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7383943070188968893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7383943070188968893'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/09/3.html' title='Computer Architecture # 03 : Arithmetic: HARDWARE IMPLEMENTATION OF ADDERS AND SUBTRACTORS'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAeLZScisT6zOfyHVe2FGoX3N9plDLA4tOWerf83Sy6HCpUxYZ8frTiyIXMJimps4zi4Rx5PNbm77RXKq7WnANrWKR4kR0CP1uqF5b0orYVmWAM6o4Ly8VWlGHP6L_8hx8XnYdydaduQPV/s72-c/322+a.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-1512071297125576389</id><published>2011-07-05T01:47:00.002+07:00</published><updated>2011-09-07T21:54:33.324+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: TWO’S COMPLEMENT ADDITION AND SUBTRACTION (3)</title><content type='html'>&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0470554231&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.2.1&amp;nbsp;TWO’S COMPLEMENT ADDITION AND SUBTRACTION&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;In this section, we look at the addition of signed two’s complement numbers. As&amp;nbsp;we explore the&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;addition&amp;nbsp;of signed numbers, we also implicitly cover&amp;nbsp;subtraction&amp;nbsp;as&amp;nbsp;well, as a result of the arithmetic principle:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;a - b = a + (−b).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;We can negate a number by complementing it (and adding 1, for two’s complement), and so we can perform subtraction by complementing and adding. This&amp;nbsp;results in a savings of hardware because it avoids the need for a hardware subtractor. We will cover this topic in more detail later. &amp;nbsp;&lt;/span&gt;We will need to modify the interpretation that we place on the results of addition&amp;nbsp;when we add two’s complement numbers.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;To see why this is the case, consider&amp;nbsp;Figure 3-1. With addition on the real number line, numbers can be as large or as&amp;nbsp;small as desired—the number line goes to&amp;nbsp;±∞&amp;nbsp;, so the real number line can accommodate numbers of any size. On the other hand, as discussed in Chapter&amp;nbsp;2, computers represent data using a ﬁnite number of bits, and as a result can only&amp;nbsp;store numbers within a certain range. For example, an examination of Table 2.1&amp;nbsp;shows that if we restrict the size of a number to, for example, 3 bits, there will only be eight possible two’s complement values that the number can assume.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;In&amp;nbsp;Figure 3-1 these values are arranged in a circle beginning with 000 and proceeding around the circle to 111 and then back to 000.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFAiN0wobuPXWFw-NWuSO737UwyTwgv3efwNJJCRSuFpfaG7LCwtqAkEZJ1BngIKJohWUbFf9n8_I3Q60ghyatrmqL7aCmCUwxqaRnjwLStWrTZwj6ftYcUX2s74uDcbDdHzLCoZ8fvWQS/s1600/321.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFAiN0wobuPXWFw-NWuSO737UwyTwgv3efwNJJCRSuFpfaG7LCwtqAkEZJ1BngIKJohWUbFf9n8_I3Q60ghyatrmqL7aCmCUwxqaRnjwLStWrTZwj6ftYcUX2s74uDcbDdHzLCoZ8fvWQS/s1600/321.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: center;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&amp;nbsp;Figure 3-1 &amp;nbsp; &amp;nbsp;Number circle for 3-bit two’s complement numbers.&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: center;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;
&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;The ﬁgure also shows the decimal equivalents of these same numbers.&amp;nbsp;Some experimentation with the number circle shows that numbers can be added&amp;nbsp;or subtracted by traversing the number circle clockwise for addition and counter&amp;nbsp;clockwise for subtraction. Numbers can also be subtracted by two’s complementing the subtrahend and adding. Notice that overﬂow can only occur for addition&amp;nbsp;when the operands (“addend” and “augend”) are of the same sign. Furthermore,&amp;nbsp;overﬂow occurs if a transition is made from +3 to&amp;nbsp;−4 while proceeding around&amp;nbsp;the number circle when adding, or from&amp;nbsp;−4 to +3 while subtracting. (Two’s complement overﬂow is discussed in more detail later in the chapter.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Here are two examples of 8-bit two’s complement addition, ﬁrst using two positive numbers:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAPxLKuLZ784q-A4NUQ0rWGu1kMh-rpc3ELjAf52sFRydxTQMjl_OgFAdU9zPevyeoFSdQkehursKRIqHBzJgKq6LP_6Bzh869TR1FAhYQ4YLJX8v-uHPsvYvICJSVgQYkDmzR2fKjDNb0/s1600/321+b.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAPxLKuLZ784q-A4NUQ0rWGu1kMh-rpc3ELjAf52sFRydxTQMjl_OgFAdU9zPevyeoFSdQkehursKRIqHBzJgKq6LP_6Bzh869TR1FAhYQ4YLJX8v-uHPsvYvICJSVgQYkDmzR2fKjDNb0/s1600/321+b.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;A positive and a negative number can be added in a similar manner:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij39JF9lxnTOZ2j6xaGw8K-XeV0Pil6hsQnlrQ6C6rIg_8F92KcyrI27fZCopqFPGXis555sT-CArLs-9ZMVIxLPKx0HFNWSk1bFBwlFKSVyUnXgvfNuOQxLsIyA0Tknjbs1GDiMHrT7iM/s1600/321+c.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij39JF9lxnTOZ2j6xaGw8K-XeV0Pil6hsQnlrQ6C6rIg_8F92KcyrI27fZCopqFPGXis555sT-CArLs-9ZMVIxLPKx0HFNWSk1bFBwlFKSVyUnXgvfNuOQxLsIyA0Tknjbs1GDiMHrT7iM/s1600/321+c.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;The carry produced by addition at the highest (leftmost) bit position is discarded in two’s complement addition. A similar situation arises with a carry out of the highest bit position when adding two negative numbers:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiywRk3_pPx1cB_be_AqaPubEW-dLvxFqQz1yhyphenhyphenZaCRMCxqmPgVWtbjfJxovJXswrxeBDDcyXJmtTQChCcvsWQ6Iu5gtfft2Bz2mpJCV3qLj9wh2e26G6tQ6CjWiipCEqln7gWzyrwQ_5Wj/s1600/321+d.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiywRk3_pPx1cB_be_AqaPubEW-dLvxFqQz1yhyphenhyphenZaCRMCxqmPgVWtbjfJxovJXswrxeBDDcyXJmtTQChCcvsWQ6Iu5gtfft2Bz2mpJCV3qLj9wh2e26G6tQ6CjWiipCEqln7gWzyrwQ_5Wj/s1600/321+d.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;The carry out of the leftmost bit is discarded because the number system is&amp;nbsp;modular&amp;nbsp;&lt;/span&gt;—it “wraps around” from the largest positive number to the largest negative number as Figure 3-1 shows.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Although an addition operation may have a (discarded) carry-out from the MSB, this does not mean that the result is erroneous. The two examples above yield&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;correct results in spite of the fact that there is a carry-out of the MSB. The next&amp;nbsp;section discusses overﬂow in two’s complement addition in more detail.&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;i&gt;&lt;b&gt;Overﬂow&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;When two numbers are added that have large magnitudes and the same sign, an&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;overﬂow&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;will occur if the result is too large to ﬁt in the number of bits used in&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the representation. Consider adding (+80)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;10&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;and (+50)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;using an eight bit for&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;mat. The result should be (+130)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;, however, as shown below, the result is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;126)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;10&lt;/span&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdEqpc0_GupGkELOJfCXEmTnjqqXRir01vPttCCdOA9pnTSgejfM_FGIghZogNKpHAJARog7puYHFaKZ4YT0FdL-2aadLoYWktr-ctw51JY0Vjchz-Er5myizC8XDrG8FuaIMpB6vd3y7p/s1600/321+e.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdEqpc0_GupGkELOJfCXEmTnjqqXRir01vPttCCdOA9pnTSgejfM_FGIghZogNKpHAJARog7puYHFaKZ4YT0FdL-2aadLoYWktr-ctw51JY0Vjchz-Er5myizC8XDrG8FuaIMpB6vd3y7p/s1600/321+e.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This should come as no surprise, since we know that the largest positive 8-bit&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;two’s complement number is +(127)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;, and it is therefore impossible to represent&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(+130)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;. Although the result 10000010&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;“looks” like 130&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;10&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;if we think of it in&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;unsigned form, the sign bit indicates a negative number in the signed form,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;which is clearly wrong.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In general, if two numbers of opposite signs are added, then an overﬂow cannot&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;occur. Intuitively, this is because the magnitude of the result can be no larger&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;than the magnitude of the larger operand. This leads us to the deﬁnition of two’s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;complement overﬂow:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If the numbers being added are of the same sign and the result is of the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;opposite sign, then an overﬂow occurs and the result is incorrect. If the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;numbers being added are of opposite signs, then an overﬂow will never&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;occur. As an alternative method of detecting overﬂow for addition, an&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;overﬂow occurs if and only if the carry into the sign bit differs from the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;carry out of the sign bit.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; text-align: justify;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If a positive number is subtracted from a negative number and the result&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;is positive, or if a negative number is subtracted from a positive number&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and the result is negative, then an overﬂow occurs. If the numbers being&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;subtracted are of the same sign, then an overﬂow will never occur.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/1512071297125576389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/07/computer-architecture-03-arithmetic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/1512071297125576389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/1512071297125576389'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/07/computer-architecture-03-arithmetic.html' title='Computer Architecture # 03 : Arithmetic: TWO’S COMPLEMENT ADDITION AND SUBTRACTION (3)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFAiN0wobuPXWFw-NWuSO737UwyTwgv3efwNJJCRSuFpfaG7LCwtqAkEZJ1BngIKJohWUbFf9n8_I3Q60ghyatrmqL7aCmCUwxqaRnjwLStWrTZwj6ftYcUX2s74uDcbDdHzLCoZ8fvWQS/s72-c/321.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-6544651020723347249</id><published>2011-06-30T22:44:00.001+07:00</published><updated>2011-07-05T01:21:14.060+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: FIXED POINT ADDITION AND SUBTRACTION (2)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1568811608&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.2&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 18px; line-height: 20px;&quot;&gt;FIXED POINT ADDITION AND SUBTRACTION&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The addition of binary numbers and the concept of overﬂow were brieﬂy discussed in Chapter 2. Here, we cover addition and subtraction of both signed and&amp;nbsp;unsigned ﬁxed point numbers in detail. Since the two’s complement representation of integers is almost universal in today’s computers, we will focus primarily&amp;nbsp;on two’s complement operations. We will brieﬂy cover operations on 1’s complement and BCD numbers, which have a foundational signiﬁcance for other areas&amp;nbsp;of computing, such as networking (for 1’s complement addition) and hand-held&amp;nbsp;calculators (for BCD arithmetic.)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/6544651020723347249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/06/computer-architecture-03-arithmetic_30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6544651020723347249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6544651020723347249'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/06/computer-architecture-03-arithmetic_30.html' title='Computer Architecture # 03 : Arithmetic: FIXED POINT ADDITION AND SUBTRACTION (2)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-5519110758149164436</id><published>2011-06-30T22:13:00.000+07:00</published><updated>2011-06-30T22:13:28.933+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 03 : Arithmetic: OVERVIEW (1)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0764129139&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;3.1 OVERVIEW&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In the previous chapter we explored a few ways that numbers can be represented&amp;nbsp;in a digital computer, but we only brieﬂy touched upon arithmetic operations&amp;nbsp;that can be performed on those numbers. In this chapter we cover four basic&amp;nbsp;arithmetic operations: addition, subtraction, multiplication, and division. We&amp;nbsp;begin by describing how these four operations can be performed on ﬁxed point&amp;nbsp;numbers, and continue with a description of how these four operations can be&amp;nbsp;performed on ﬂoating point numbers.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Some of the largest problems, such as weather calculations, quantum mechanical&amp;nbsp;simulations, and land-use modeling, tax the abilities of even today’s largest computers. Thus the topic of high-performance arithmetic is also important. We&amp;nbsp;conclude the chapter with an introduction to some of the algorithms and techniques used in speeding arithmetic operations.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/5519110758149164436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/06/computer-architecture-03-arithmetic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/5519110758149164436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/5519110758149164436'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/06/computer-architecture-03-arithmetic.html' title='Computer Architecture # 03 : Arithmetic: OVERVIEW (1)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-8246468487720355279</id><published>2011-06-30T21:49:00.001+07:00</published><updated>2011-06-30T21:57:06.453+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: CHARACTER CODE (17)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B000Y2TUU0&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.5 CHARACTER CODE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Unlike real numbers, which have an inﬁnite range, there is only a ﬁnite number&amp;nbsp;of characters. An entire character set can be represented with a small number of&amp;nbsp;bits per character. Three of the most common character representations, ASCII,&amp;nbsp;EBCDIC, and Unicode, are described here.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2.5.1 THE ASCII CHARACTER SET&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The American Standard Code for Information Interchange (ASCII) is summarized in Figure 2-13, using hexadecimal indices. &lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The representation for each&amp;nbsp;character consists of 7 bits, and all 27 possible bit patterns represent valid characters. The characters in positions 00 – 1F and position 7F are special control characters that are used for transmission, printing control, and other non-textual&amp;nbsp;purposes. &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The remaining characters are all printable, and include letters, numbers, punctuation, and a space. The digits 0-9 appear in sequence, as do the&amp;nbsp;upper and lower case letters1. This organization simpliﬁes character manipulation. In order to change the character representation of a digit into its numerical&amp;nbsp;value, we can subtract (30)16 from it. In order to convert the ASCII character ‘5,’&amp;nbsp;which is in position (35)16, into the number 5, we compute (35 – 30 = 5)16.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;(&lt;i&gt;1. &amp;nbsp;As an aside, the character ‘a’ and the character ‘A’ are different, and have different codes&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;i&gt;in the ASCII table. The small letters like ‘a’ are called lower case, and the capital letters like ‘A’ are&amp;nbsp;&lt;/i&gt;&lt;i&gt;called upper case. The naming comes from the positions of the characters in a printer’s typecase.&amp;nbsp;&lt;/i&gt;&lt;i&gt;The capital letters appear above the small letters, which resulted in the upper case / lower case nam&lt;/i&gt;&lt;i&gt;ing. These days, typesetting is almost always performed electronically, but the traditional naming is&amp;nbsp;&lt;/i&gt;&lt;i&gt;still used.&lt;/i&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3vdPyldjaSg92poHnc9O-yJl3Ws8ijfU_JvRLo59nJ0WyWRk5A3STY7pOyJp08pcaDLO-H56wFehjdKh5ptvLrvnUBMzlrrvOBg5gGdgOIDxDXut2_t_oXUa7VWBKgmWR67RdKk4XrDGm/s1600/235.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3vdPyldjaSg92poHnc9O-yJl3Ws8ijfU_JvRLo59nJ0WyWRk5A3STY7pOyJp08pcaDLO-H56wFehjdKh5ptvLrvnUBMzlrrvOBg5gGdgOIDxDXut2_t_oXUa7VWBKgmWR67RdKk4XrDGm/s1600/235.JPG&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;In&amp;nbsp;order to convert an upper case letter into a lower case letter, we add (20)16. For&amp;nbsp;example, to convert the letter ‘H,’ which is at location (48)16 in the ASCII table,&amp;nbsp;into the letter ‘h,’ which is at position (68)16, we compute (48 + 20 = 68)16.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2.5.2 THE EBCDIC CHARACTER SET&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A problem with the ASCII code is that only 128 characters can be represented,&amp;nbsp;which is a limitation for many keyboards that have a lot of special characters in addition to upper and lower case letters. The Extended Binary Coded Decimal&amp;nbsp;Interchange Code (EBCDIC) is an eight-bit code that is used extensively in IBM&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;mainframe computers. Since seven-bit ASCII characters are frequently represented in an eight-bit modiﬁed form (one character per byte), in which a 0 or a 1&amp;nbsp;is appended to the left of the seven-bit pattern, the use of EBCDIC does not&amp;nbsp;place a greater demand on the storage of characters in a computer. For serial&amp;nbsp;transmission, however, (see Chapter 8), an eight-bit code takes more time to&amp;nbsp;transmit than a seven-bit code, and for this case the wider code does make a difference.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The EBCDIC code is summarized in Figure 2-14. There are gaps in the table,&amp;nbsp;which can be used for application speciﬁc characters. The fact that there are gaps&amp;nbsp;in the upper and lower case sequences is not a major disadvantage because character manipulations can still be done as for ASCII, but using different offsets.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2.5.3 &amp;nbsp;THE UNICODE CHARACTER SET&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The ASCII and EBCDIC codes support the historically dominant (Latin) character sets used in computers. There are many more character sets in the world,&amp;nbsp;and a simple ASCII-to-language-X mapping does not work for the general case,&amp;nbsp;and so a new universal character standard was developed that supports a great&amp;nbsp;breadth of the world’s character sets, called Unicode.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Unicode is an evolving standard. It changes as new character sets are introduced&amp;nbsp;into it, and as existing character sets evolve and their representations are reﬁned.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In version 2.0 of the Unicode standard, there are 38,885 distinct coded characters that cover the principal written languages of the Americas, Europe, the Middle East, Africa, India, Asia, and Paciﬁca.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The Unicode Standard uses a 16-bit code set in which there is a one-to-one correspondence between 16-bit codes and characters. Like ASCII, there are no complex modes or escape codes. While Unicode supports many more characters than&amp;nbsp;ASCII or EBCDIC, it is not the end-all standard. In fact, the 16-bit Unicode&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;standard is a subset of the 32-bit ISO 10646 Universal Character Set (UCS-4).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Glyphs for the ﬁrst 256 Unicode characters are shown in Figure 2-15, according&amp;nbsp;to Unicode version 2.1. Note that the ﬁrst 128 characters are the same as for&amp;nbsp;ASCII.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/8246468487720355279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/06/computer-architecture-02-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/8246468487720355279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/8246468487720355279'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/06/computer-architecture-02-data.html' title='Computer Architecture # 02 : Data Representation: CHARACTER CODE (17)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3vdPyldjaSg92poHnc9O-yJl3Ws8ijfU_JvRLo59nJ0WyWRk5A3STY7pOyJp08pcaDLO-H56wFehjdKh5ptvLrvnUBMzlrrvOBg5gGdgOIDxDXut2_t_oXUa7VWBKgmWR67RdKk4XrDGm/s72-c/235.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-356896972972496416</id><published>2011-06-29T20:18:00.003+07:00</published><updated>2011-06-30T21:54:40.710+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: CASE STUDY: PATRIOT MISSILE DEFENSE FAILURE CAUSED BY LOSS OF  PRECISION (16)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;2.4 Case Study: Patriot Missile Defense Failure Caused by Loss of&amp;nbsp;&lt;/b&gt;&lt;b&gt;Precision&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B004UMS8FS&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;During the 1991-1992 Operation Desert Storm conﬂict between Coalition&amp;nbsp;forces and Iraq, the Coalition used a military base in Dhahran, Saudi Arabia that&amp;nbsp;was protected by six U.S. Patriot Missile batteries. The Patriot system was originally designed to be mobile and to operate for only a few hours in order to avoid&amp;nbsp;detection.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The Patriot system tracks and intercepts certain types of objects, such as cruise&amp;nbsp;missiles or Scud ballistic missiles, one of which hit a U.S. Army barracks at&amp;nbsp;Dhahran on February 5, 1991, killing 28 Americans. The Patriot system failed to&amp;nbsp;track and intercept the incoming Scud due to a loss of precision in converting&amp;nbsp;integers to a ﬂoating point number representation.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A radar system operates by sending out a train of electromagnetic pulses in vari&amp;nbsp;ous directions and then listening for return signals that are reﬂected from objects&amp;nbsp;in the path of the radar beam. If an airborne object of interest such as a Scud is&amp;nbsp;detected by the Patriot radar system, then the position of a range gate is determined, which estimates the position of the object being tracked&amp;nbsp;during the next scan. &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The range gate also allows information outside of its&amp;nbsp;boundaries to be ﬁltered out, which simpliﬁes tracking. The position of the&amp;nbsp;object (a Scud for this case) is conﬁrmed if it is found within the range gate.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The prediction of where the Scud will next appear is a function of the Scud’s velocity. The Scud’s velocity is determined by its change in position with respect to time, and time is updated in the Patriot’s internal clock in 100 ms intervals.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Velocity is represented as a 24-bit ﬂoating point number, and time is represented as a 24-bit integer, but both must be represented as 24-bit ﬂoating point numbers in order to predict where the Scud will next appear.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The conversion from integer time to real time results in a loss of precision that increases as the internal clock time increases. The error introduced by the conversion results in an error in the range gate calculation, which is proportional to the target’s velocity and the length of time that the system is running. The cause of the Dhahran incident, after the Patriot battery had been operating continuously for over 100 hours, is that the range gate shifted by 687 m, resulting in the failed interception of a Scud.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;The conversion problem was known two weeks in advance of the Dhahran incident as a result of data provided by &lt;st1:country-region w:st=&quot;on&quot;&gt;&lt;st1:place w:st=&quot;on&quot;&gt;Israel&lt;/st1:place&gt;&lt;/st1:country-region&gt;, but it took until the day after the attack for new software to arrive due to the difﬁculty of distributing bug ﬁxes in a wartime environment. A solution to the problem, until a software ﬁx could be made available, would have been to simply reboot the system every few hours which would have the effect of resetting the internal clock. Since ﬁeld personnel were not informed of how long was too long to keep a system running, which was in fact known at the time from data provided by &lt;st1:country-region w:st=&quot;on&quot;&gt;&lt;st1:place w:st=&quot;on&quot;&gt;Israel&lt;/st1:place&gt;&lt;/st1:country-region&gt;, this solution was never implemented. The lesson for us is to be very aware of the limitations of relying on calculations that use ﬁnite precision&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/356896972972496416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/06/24-case-study-patriot-missile-defense.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/356896972972496416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/356896972972496416'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/06/24-case-study-patriot-missile-defense.html' title='Computer Architecture # 02 : Data Representation: CASE STUDY: PATRIOT MISSILE DEFENSE FAILURE CAUSED BY LOSS OF  PRECISION (16)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-6461459424734288166</id><published>2011-04-03T06:02:00.000+07:00</published><updated>2011-04-03T06:02:11.106+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: THE IEEE 754 FLOATING POINT STANDARD (15)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=6130639694&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.3.5 THE IEEE 754 FLOATING POINT STANDARD&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;There are many ways to represent ﬂoating point numbers, a few of which we&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;have already explored. Each representation has its own characteristics in terms of&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;range, precision, and the number of representable numbers. In an effort to&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;improve software portability and ensure uniform accuracy of ﬂoating point cal&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;culations, the IEEE 754 ﬂoating point standard for binary numbers was devel&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;oped (IEEE, 1985).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;There are a few entrenched product lines that predate the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;standard that do not use it, such as the IBM/370, the DEC VAX, and the Cray&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;line, but virtually all new architectures generally provide some level of IEEE 754&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;support.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The IEEE 754 standard as described below must be supported by a computer sys&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tem, and not necessarily by the hardware entirely. That is, a mixture of hardware&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and software can be used while still conforming to the standard.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;2.3.5.1 Formats&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;There are two primary formats in the IEEE 754 standard: single precision and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;double precision. Figure 2-10 summarizes the layouts of the two formats. The&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;single precision format occupies 32 bits, whereas the double precision format&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;occupies 64 bits. The double precision format is simply a wider version of the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;single precision format.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtlP9bDTuqbq1SQlYc2jJAwt2XECmsDtWl1Wc_JgBBM5IukbMPpYWtG2rEMcwOo_k8-qkfZWAXgU-0E6ZZ2uU3Iv3myJi5fALRdynAn9EpLA-xRg70uQxVfzBCzq8ZRv6MghulYncAzILf/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtlP9bDTuqbq1SQlYc2jJAwt2XECmsDtWl1Wc_JgBBM5IukbMPpYWtG2rEMcwOo_k8-qkfZWAXgU-0E6ZZ2uU3Iv3myJi5fALRdynAn9EpLA-xRg70uQxVfzBCzq8ZRv6MghulYncAzILf/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 2-10 &amp;nbsp; &amp;nbsp; Single precision and double precision IEEE 754 floating point formats.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The sign bit is in the leftmost position and indicates a positive or negative num&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ber for a 0 or a 1, respectively. The 8-bit excess 127 (not 128) exponent follows,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;in which the bit patterns 00000000 and 11111111 are reserved for special cases,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;as described below. For double precision, the 11-bit exponent is represented in&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;excess 1023, with 00000000000 and 11111111111 reserved. The 23-bit base 2&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;fraction follows. There is a hidden bit to the left of the binary point, which when&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;taken together with the single-precision fraction form a 23 + 1 = 24-bit signiﬁ&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;cand of the form 1.fff...f where the fff...f pattern represents the 23-bit fractional&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;part that is stored. The double-precision format also uses a hidden bit to the left&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;of the binary point, which supports a 52 + 1 = 53 bit signiﬁcand. For both for&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;mats, the number is normalized unless denormalized numbers are supported, as&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;described later.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;There are ﬁve basic types of numbers that can be represented. Nonzero normal&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ized numbers take the form described above. A so-called “clean zero” is repre&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;sented by the reserved bit pattern 00000000 in the exponent and all 0’s in the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;fraction. The sign bit can be 0 or 1, and so there are two representations for zero:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;+0 and −0.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Inﬁnity has a representation in which the exponent contains the reserved bit pat&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tern 11111111, the fraction contains all 0’s, and the sign bit is 0 or 1. Inﬁnity is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;useful in handling overﬂow situations or in giving a valid representation to a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;number (other than zero) divided by zero. If zero is divided by zero or inﬁnity is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;divided by inﬁnity, then the result is undeﬁned. This is represented by the NaN&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(not a number) format in which the exponent contains the reserved bit pattern&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;11111111, the fraction is nonzero and the sign bit is 0 or 1. A NaN can also be&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;produced by attempting to take the square root of −1.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As with all normalized representations, there is a large gap between zero and the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ﬁrst representable number. The denormalized, “dirty zero” representation allows&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;numbers in this gap to be represented. The sign bit can be 0 or 1, the exponent&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;contains the reserved bit pattern 00000000 which represents −126 for single pre&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;cision (−1022 for double precision), and the fraction contains the actual bit pat&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tern for the magnitude of the number. Thus, there is no hidden 1 for this format.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Note that the denormalized representation is not an unnormalized representation.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The key difference is that there is only one representation for each denormalized&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;number, whereas there are inﬁnitely many unnormalized representations.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 2-11 illustrates some examples of IEEE 754 ﬂoating point numbers.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1fvxQYUDSA9Z__7hTifSJgseOd4oNY7En31qRWhFO7nNd7cfO0YiMYJrav4qZCZq5s9JZzGx-07MBcTvYwsp2yAkA6H375nJQdrv5QFo8N08PXexKIzaESddOJAyVsegGcqDtLVD3StPH/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;158&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1fvxQYUDSA9Z__7hTifSJgseOd4oNY7En31qRWhFO7nNd7cfO0YiMYJrav4qZCZq5s9JZzGx-07MBcTvYwsp2yAkA6H375nJQdrv5QFo8N08PXexKIzaESddOJAyVsegGcqDtLVD3StPH/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 2-11 &amp;nbsp; &amp;nbsp; Examples of IEEE 754 floating point numbers in single precision&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;format (a – h) and&amp;nbsp;double precision format (i). Spaces are shown for&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;clarity only: they are not part of the representation.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Examples (a) through (h) are in single precision format and example (i) is in double precision format. Example (a) shows an ordinary single precision number.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Notice that the signiﬁcand is 1.101, but that only the fraction (101) is explicitly&amp;nbsp;represented. Example (b) uses the smallest single precision exponent (–126) and&amp;nbsp;example (c) uses the largest single precision exponent (127).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Examples (d) and (e) illustrate the two representations for zero. Example (f ) illustrates the bit pattern for +∞. There is also a corresponding bit pattern for –∞.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Example (g) shows a denormalized number. Notice that although the number&amp;nbsp;itself is 2−128, the smallest representable exponent is still −126. The exponent for&amp;nbsp;single precision denormalized numbers is always −126, which is represented by&amp;nbsp;the bit pattern 00000000 and a nonzero fraction. The fraction represents the&amp;nbsp;magnitude of the number, rather than a signiﬁcand. Thus we have +2−128 = +.01&amp;nbsp;× 2–126, which is represented by the bit pattern shown in Figure 2-11g.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Example (h) shows a single precision NaN. A NaN can be positive or negative.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Finally, example (i) revisits the representation of 2–128 but now using double precision. The representation is for an ordinary double precision number and so &amp;nbsp;there are no special considerations here. Notice that 2–128 has a signiﬁcand of&amp;nbsp;1.0, which is why the fraction ﬁeld is all 0’s.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In addition to the single precision and double precision formats, there are also&amp;nbsp;single extended and double extended formats. The extended formats are not&amp;nbsp;visible to the user, but they are used to retain a greater amount of internal precision during calculations to reduce the effects of roundoff errors. The extended&amp;nbsp;formats increase the widths of the exponents and fractions by a number of bits&amp;nbsp;that can vary depending on the implementation. For instance, the single&amp;nbsp;extended format adds at least three bits to the exponent and eight bits to the fraction. The double extended format is typically 80 bits wide, with a 15-bit exponent and a 64-bit fraction.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;2.3.5.2 Rounding&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;An implementation of IEEE 754 must provide at least single precision, whereas&amp;nbsp;the remaining formats are optional. Further, the result of any single operation on&amp;nbsp;ﬂoating point numbers must be accurate to within half a bit in the least signiﬁcant bit of the fraction. This means that some additional bits of precision may&amp;nbsp;need to be retained during computation (referred to as &amp;nbsp;guard bits), and there&amp;nbsp;must be an appropriate method of rounding the intermediate result to the number of bits in the fraction.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;There are four rounding modes in the IEEE 754 standard. One mode rounds to&amp;nbsp;0, another rounds toward +∞, and another rounds toward −∞. The default mode&amp;nbsp;rounds to the nearest representable number. Halfway cases round to the number&amp;nbsp;whose low order digit is even. For example, 1.01101 rounds to 1.0110 whereas&amp;nbsp;1.01111 rounds to 1.1000.&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/6461459424734288166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_2311.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6461459424734288166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6461459424734288166'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_2311.html' title='Computer Architecture # 02 : Data Representation: THE IEEE 754 FLOATING POINT STANDARD (15)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtlP9bDTuqbq1SQlYc2jJAwt2XECmsDtWl1Wc_JgBBM5IukbMPpYWtG2rEMcwOo_k8-qkfZWAXgU-0E6ZZ2uU3Iv3myJi5fALRdynAn9EpLA-xRg70uQxVfzBCzq8ZRv6MghulYncAzILf/s72-c/002+%25285%2529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-5966499098915406606</id><published>2011-04-03T05:47:00.003+07:00</published><updated>2011-04-03T06:11:57.563+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation : ERROR IN FLOATING POINT REPRESENTATIONS (14)</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B0026M02VM&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.3.4 ERROR IN FLOATING POINT REPRESENTATIONS&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The fact that ﬁnite precision introduces error means that we should consider&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;how great the error is (by “error”, we mean the distance between two adjacent&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;representable numbers), and whether it is acceptable for our application. As an&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;example of a potential pitfall, consider representing one million in ﬂoating point,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and then subtracting one million 1’s from it. We may still be left with a million if&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the error is greater than 1.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1 =&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In order to characterize error, range, and precision, we use the following nota&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion:&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;b = Base&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;s = Number of signiﬁcant digits (not bits) in the fraction&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;M = Largest exponent&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;m = Smallest exponent&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The number of signiﬁcant digits in the fraction is represented by s, which is dif&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ferent than the number of bits in the fraction if the base is anything other than 2&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(for example, base 16 uses four bits for each digit). In general, if the base is 2k&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;where k is an integer, then k bits are needed to represent each digit. The use of a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hidden 1 increases &amp;nbsp;s by one bit even though it does not increase the number of&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;representable numbers. In the previous example, there are three signiﬁcant digits&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;in the base 16 fraction and there are 12 bits that make up the three digits.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;There&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;are three bits in the excess 4 exponent, which gives an exponent range of [−22 to&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;22 − 1]. For this case, b = 16, s = 3, M = 3, and m = −4.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In the analysis of a ﬂoating point representation, there are ﬁve characteristics that&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;we consider: the number of representable numbers, the numbers that have the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;largest and smallest magnitudes (other than zero), and the sizes of the largest and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;smallest gaps between successive numbers.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The number of representable numbers can be determined as shown in Figure&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2-8. The sign bit can take on two values, as indicated by the position marked&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;with an encircled “A.” The total number of exponents is indicated in position B.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju1sOlLsqVMxtAiP0NeWwrwgczk_acvFZ7GX3U4WsTauDbHxIPnrKRyGDij725L8yQdcDN7cgU3_PDm3apo3M8Gphz7NpU5RyaMKdUrYhRRMwG1ZyCjXbwdvfFdcB_aVl_yNWhM5SSnpyN/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju1sOlLsqVMxtAiP0NeWwrwgczk_acvFZ7GX3U4WsTauDbHxIPnrKRyGDij725L8yQdcDN7cgU3_PDm3apo3M8Gphz7NpU5RyaMKdUrYhRRMwG1ZyCjXbwdvfFdcB_aVl_yNWhM5SSnpyN/s1600/002+%25285%2529.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 2-8 &amp;nbsp; &amp;nbsp; Calculation of the number of representable numbers in&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;a floating point representation.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Note that not all exponent bit patterns are valid in all representations. The IEEE&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;754 ﬂoating point standard, which we will study shortly, has a smallest exponent&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;of −126 even though the eight-bit exponent can support a number as small as&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;−128. The forbidden exponents are reserved for special numbers, such as zero&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;and inﬁnity.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The ﬁrst digit of the fraction is considered next, which can take on any value&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;except 0 in a normalized representation (except when a hidden 1 is used) as indi&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;cated by (b − 1) at position C. The remaining digits of the fraction can take on&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;any of the b values for the base, as indicated by bs-1 at position D. If a hidden 1 is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;used, then position C is removed and position 4 is replaced with bs&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Finally, there&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;must be a representation for 0, which is accounted for in position E.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Consider now the numbers with the smallest and largest magnitudes. The num&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ber with the smallest magnitude has the smallest exponent and the smallest non&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;zero normalized fraction. There must be a nonzero value in the ﬁrst digit, and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;since a 1 is the smallest value we can place there, the smallest fraction is b−1.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;number with the smallest magnitude is then bm·b−1 = bm−1. Similarly, the num&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ber with the largest magnitude has the largest exponent and the largest fraction&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(when the fraction is all 1’s), which is equal to bM ·(1 − b−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;).&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The smallest and largest gaps are computed in a similar manner. The smallest gap&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;occurs when the exponent is at its smallest value and the least signiﬁcant bit of&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the fraction changes. This gap is bm·b−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= bm−s&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The largest gap occurs when the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;exponent is at its largest value and the least signiﬁcant bit of the fraction changes.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This gap is bM·b−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= bM−s&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As an example, consider a ﬂoating point representation in which there is a sign&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;bit, a two-bit excess 2 exponent, and a three-bit normalized base 2 fraction in&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;which the leading 1 is visible; that is, the leading 1 is not hidden. The representa&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion of 0 is the bit pattern 000000. A number line showing all possible numbers&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;that can be represented in this format is shown in Figure 2-9.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVKRYhGvwjAGJAsfsYknzstpGqgFkS8ANVivqDYvSzbtZ9RnwKB2tUzVb6ExKZkZ4Il0YK3IBaizHoshxsz5SdAgfu9SdxfLF_vKv0zycHXSv7Q_LmHwx0cURZWtcQmxwz2TmdWcqEE-ye/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;106&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVKRYhGvwjAGJAsfsYknzstpGqgFkS8ANVivqDYvSzbtZ9RnwKB2tUzVb6ExKZkZ4Il0YK3IBaizHoshxsz5SdAgfu9SdxfLF_vKv0zycHXSv7Q_LmHwx0cURZWtcQmxwz2TmdWcqEE-ye/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Notice that there is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;a relatively large gap between 0 and the ﬁrst representable number, because the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;normalized representation does not support bit patterns that correspond to num&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;bers between 0 and the ﬁrst representable number.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The smallest representable number occurs when the exponent and the fraction&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;are at their smallest values. The smallest exponent is −2, and the smallest normal&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ized fraction is (.100)2. The smallest representable number is then &amp;nbsp;bm×b−1 =&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;bm−1 = 2−2−1 = 1/8.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Similarly, the largest representable number occurs when the exponent and the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;fraction are both at their largest values. The largest fraction occurs when the frac&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tion is all 1’s, which is a number that is 2−3 less than 1 since there are three digits&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;in the fraction. The largest representable number is then bM ×(1 - b−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;) = 21 × (1 -&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2−3) = 7/4.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The smallest gap occurs when the exponent is at its smallest value and the least&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;signiﬁcant bit of the fraction changes, which is bm×b−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= bm−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= 2−2−3 = 1/32.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Similarly, the largest gap occurs when the exponent is at its largest value and the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;least signiﬁcant bit of the fraction changes, which is bM×b−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= bM−s&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;= 21−3 = 1/4.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The number of bit patterns that represent valid numbers is less than the number&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;of possible bit patterns, due to normalization. As discussed earlier, the number of&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;representable numbers consists of ﬁve parts, which take into account the sign bit,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the exponents, the ﬁrst signiﬁcant digit, the remaining digits, and the bit pattern&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;for 0. &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This is computed as shown below:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2 × ((M − m) + 1) × (b − 1) × bs−1 + 1&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;= 2 × ((1 − (−2)) + 1) × (2 − 1) × 23−1 + 1&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;= 33.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Notice that the gaps are small for small numbers and that the gaps are large for&amp;nbsp;large numbers. In fact, the relative error is approximately the same for all numbers. If we take the ratio of a large gap to a large number, and compare that to the&amp;nbsp;ratio of a small gap to a small number, then the ratios are the same:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgahB_gdtONEsQdDbgptdgchyphenhyphenuBNamvQimN2qeE-RCfV1ZlGTZa6UiZ-12uWNYiHKnYVYkBGSuUXqz22J41hhEuUxxb0zq3wIBV13Q-D1ccBbrOWzoHcGS2yfGs-ezguzwigp-XrWR8MCjV/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;121&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgahB_gdtONEsQdDbgptdgchyphenhyphenuBNamvQimN2qeE-RCfV1ZlGTZa6UiZ-12uWNYiHKnYVYkBGSuUXqz22J41hhEuUxxb0zq3wIBV13Q-D1ccBbrOWzoHcGS2yfGs-ezguzwigp-XrWR8MCjV/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The representation for a “small number” is used here, rather than the smallest&amp;nbsp;number, because the large gap between zero and the ﬁrst representable number is&amp;nbsp;a special case.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/5966499098915406606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_3160.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/5966499098915406606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/5966499098915406606'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_3160.html' title='Computer Architecture # 02 : Data Representation : ERROR IN FLOATING POINT REPRESENTATIONS (14)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEju1sOlLsqVMxtAiP0NeWwrwgczk_acvFZ7GX3U4WsTauDbHxIPnrKRyGDij725L8yQdcDN7cgU3_PDm3apo3M8Gphz7NpU5RyaMKdUrYhRRMwG1ZyCjXbwdvfFdcB_aVl_yNWhM5SSnpyN/s72-c/002+%25285%2529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-8105619616794493742</id><published>2011-04-03T05:16:00.001+07:00</published><updated>2011-04-03T06:03:10.536+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: EPRESENTING FLOATING POINT NUMBERS IN THE COMPUTER—PRELIMINARIES (13)</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B000R8FS16&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.3.3 REPRESENTING FLOATING POINT NUMBERS IN THE COMPUTER—PRELIMINARIES&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Let us design a simple ﬂoating point format to illustrate the important factors in&amp;nbsp;representing oating point numbers on the computer. Our format may at ﬁrst&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;seem to be unnecessarily complex. We will represent the signiﬁcand in signed&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;magnitude format, with a single bit for the sign bit, and three exadecimal digits&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;for the magnitude. The exponent will be a 3-bit excess-4 number, with a radix of&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;16. &lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;The normalized form of the number has the hexadecimal point to the left of&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the three hexadecimal digits.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The bits will be packed together as follows: The sign bit is on the left, followed&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;by the 3-bit exponent, followed by the three hexadecimal digits of the signiﬁ&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;cand. Neither the radix nor the hexadecimal point will be stored in the packed&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;form.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The reason for these rather odd-seeming choices is that numbers in this format&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;can be compared for =, ≠, ≤, and ≥ in their “packed” format, which is shown in&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;the illustration below:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTm1f84re_pEjcyuO0YH62cg4pB4NgM8Tmw27zas-PHGE3bPLzziXMImkpT5LavTtXH6t-0M0zKyoPS6Pk_J3UtDK1EaZ069bUQr9Bs3wDuWGlO7SCcFLn_hL422YqvYEl-i0B28Q0BjD4/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;72&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTm1f84re_pEjcyuO0YH62cg4pB4NgM8Tmw27zas-PHGE3bPLzziXMImkpT5LavTtXH6t-0M0zKyoPS6Pk_J3UtDK1EaZ069bUQr9Bs3wDuWGlO7SCcFLn_hL422YqvYEl-i0B28Q0BjD4/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Consider representing (358)10 in this format.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The ﬁrst step is to convert the ﬁxed point number from its original base into a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ﬁxed point number in the target base. Using the method described in Section&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2.1.3, we convert the base 10 number into a base 16 number as shown below:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRBm0nMgVUgMMHOjS31cpjCYdAzodJZPSBZBS6lApUma3za17muNqjbumFvDdVrs5kxjoYuPGwIlKYHHPSG1Jp8oXwjDAvPrqrepLhPI5bzUcw9ofgcvNjD59nIO65wKe8LJMMQOwg__Io/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRBm0nMgVUgMMHOjS31cpjCYdAzodJZPSBZBS6lApUma3za17muNqjbumFvDdVrs5kxjoYuPGwIlKYHHPSG1Jp8oXwjDAvPrqrepLhPI5bzUcw9ofgcvNjD59nIO65wKe8LJMMQOwg__Io/s1600/002+%25285%2529.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Thus (358)10 = (166)16. The next step is to convert the ﬁxed point number into&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;a ﬂoating point number:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(166)16 = (166.)16 × 160&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Note that the form 160 reﬂects a base of 16 with an exponent of 0, and that the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;number 16 as it appears on the page uses a base 10 form. That is, (160)10 =&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(100)16. This is simply a notational convenience used in describing a ﬂoating&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;point number.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The next step is to normalize the number:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(166.)16 × 160 = (.166)16 × 163&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Finally, we ﬁll in the bit ﬁelds of the number. The number is positive, and so we&amp;nbsp;place a 0 in the sign bit position. The exponent is 3, but we represent it in excess&amp;nbsp;4, so the bit pattern for the exponent is computed as shown below:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJnDwJOCNPNt8CQ7VffPdR3OyNVtBkZoNnXWCuiAWkA94Hjq6HYAaU_7uVW77R3ZdDT1wmJSWPGGu1z0ryakIYBSE60hrMyHclidZgfpxaP1jkN7xJNtV53zKHciXvrUC5R2xUg6MfCKMS/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJnDwJOCNPNt8CQ7VffPdR3OyNVtBkZoNnXWCuiAWkA94Hjq6HYAaU_7uVW77R3ZdDT1wmJSWPGGu1z0ryakIYBSE60hrMyHclidZgfpxaP1jkN7xJNtV53zKHciXvrUC5R2xUg6MfCKMS/s1600/002+%25285%2529.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Alternatively, we could have simply computed 3 + 4 = 7 in base 10, and then&amp;nbsp;made the equivalent conversion (7)10 = (111)2.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Finally, each of the base 16 digits is represented in binary as 1 = 0001, 6 = 0110,&amp;nbsp;and 6 = 0110. The ﬁnal bit pattern is shown below:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5m6nnv5DXWrcc3JhwLmxAeeUL8LiQBnCBdrnK1t6nmtnnYBHsNYiH5KZg6wkuYGU9YXpSh1zplPjo3QCaKt2qR9UcuhY90L5SjobyA8la-iyJZb4eAOso_PG_taMUmwC7ifhu-SYSa7Fi/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;68&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5m6nnv5DXWrcc3JhwLmxAeeUL8LiQBnCBdrnK1t6nmtnnYBHsNYiH5KZg6wkuYGU9YXpSh1zplPjo3QCaKt2qR9UcuhY90L5SjobyA8la-iyJZb4eAOso_PG_taMUmwC7ifhu-SYSa7Fi/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Notice again that the radix point is not explicitly represented in the bit pattern,&amp;nbsp;but its presence is implied. The spaces between digits are for clarity only, and do&amp;nbsp;not suggest that the bits are stored with spaces between them. The bit pattern as&amp;nbsp;stored in a computer’s memory would look like this:&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;0111000101100110&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The use of an excess 4 exponent instead of a two’s complement or a signed magnitude exponent simpliﬁes addition and subtraction of ﬂoating point numbers&amp;nbsp;(which we will cover in detail in Chapter 3). In order to add or subtract two normalized ﬂoating point numbers, the smaller exponent (smaller in degree, not&amp;nbsp;magnitude) must ﬁrst be increased to the larger exponent (this retains the range),&amp;nbsp;which also has the effect of unnormalizing the smaller number. In order to determine which exponent is larger, we only need to treat the bit patterns as unsigned&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;numbers and then make our comparison. That is, using an excess 4 representation, the smallest exponent is −4, which is represented as 000. The largest exponent is +3, which is represented as 111. The remaining bit patterns for −3, −2,&amp;nbsp;−1, 0, +1, and +2 fall in their respective order as 001, 010, 011, 100, 101, and&amp;nbsp;110.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Now if we are given the bit pattern shown above for (358)10 along with a&amp;nbsp;description of the ﬂoating point representation, then we can easily determine the&amp;nbsp;number. The sign bit is a 0, which means that the number is positive. The exponent in unsigned form is the number (+7)10, but since we are using excess 4, we&amp;nbsp;must subtract 4 from it, which results in an actual exponent of (+7 − 4 = +3)10.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The fraction is grouped in four-bit hexadecimal digits, which gives a fraction of&amp;nbsp;(.166)16. Putting it all together results in (+.166 × 163)16 = (358)10.&amp;nbsp;Now suppose that only 10 bits are allowed for the fraction in the above example,&amp;nbsp;instead of the 12 bits that group evenly into fours for hexadecimal digits. How&amp;nbsp;does the representation change? One approach might be to round the fraction&amp;nbsp;and adjust the exponent as necessary. Another approach, which we use here, is to&amp;nbsp;simply truncate the least signiﬁcant bits by chopping and avoid making adjustments to the exponent, so that the number we actually represent is:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYC_BjgdAM2p7q8fKVsChJnTVyWdy7F-cxPgo6Fnrz3P2Hefvo_Hdb62MeUlmJw_FB0X6MF3Fm-CXSTW_ORqq-3fj4zHXuF-QHIEtTGmuvec3ZjCIjHnumHZxluMnM3D3uap7EC3o50NZi/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;61&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYC_BjgdAM2p7q8fKVsChJnTVyWdy7F-cxPgo6Fnrz3P2Hefvo_Hdb62MeUlmJw_FB0X6MF3Fm-CXSTW_ORqq-3fj4zHXuF-QHIEtTGmuvec3ZjCIjHnumHZxluMnM3D3uap7EC3o50NZi/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;If we treat the missing bits as 0’s, then this bit pattern represents (.164 × 163)16.This method of truncation produces a biased error, since values of 00, 01, 10,&amp;nbsp;and 11 in the missing bits are all treated as 0, and so the error is in the range&amp;nbsp;from 0 to (.003)16. The bias comes about because the error is not symmetric&amp;nbsp;about 0. We will not explore the bias problem further here, but a more thorough&amp;nbsp;discussion can be found in (Hamacher et al., 1990).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;We again stress that whatever the ﬂoating point format is, that it be known to all&amp;nbsp;parties that intend to store or retrieve numbers in that format. The Institute of&amp;nbsp;Electrical and Electronics Engineers (IEEE), has taken the lead in standardizing&amp;nbsp;ﬂoating point formats. The IEEE 754 ﬂoating point format, which is in nearly&amp;nbsp;universal usage, is discussed in Section 2.3.5.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/8105619616794493742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_7475.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/8105619616794493742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/8105619616794493742'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_7475.html' title='Computer Architecture # 02 : Data Representation: EPRESENTING FLOATING POINT NUMBERS IN THE COMPUTER—PRELIMINARIES (13)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTm1f84re_pEjcyuO0YH62cg4pB4NgM8Tmw27zas-PHGE3bPLzziXMImkpT5LavTtXH6t-0M0zKyoPS6Pk_J3UtDK1EaZ069bUQr9Bs3wDuWGlO7SCcFLn_hL422YqvYEl-i0B28Q0BjD4/s72-c/002+%25285%2529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-7874966016457880044</id><published>2011-04-03T05:01:00.002+07:00</published><updated>2011-04-03T06:06:57.611+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: NORMALIZATION, AND THE HIDDEN BIT (12)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B00190FUHI&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2.3.2 &amp;nbsp;NORMALIZATION, AND THE HIDDEN BIT&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A potential problem with representing ﬂoating point numbers is that the same&amp;nbsp;number can be represented in different ways, which makes comparisons and&amp;nbsp;arithmetic operations difﬁcult. For example, consider the numerically equivalent&amp;nbsp;forms shown below:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3584.1 × 100 = 3.5841 × 103 = .35841 × 104.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In order to avoid multiple representations for the same number, ﬂoating point&amp;nbsp;numbers are maintained in normalized form. That is, the radix point is shifted&amp;nbsp;to the left or to the right and the exponent is adjusted accordingly until the radix&amp;nbsp;point is to the left of the leftmost nonzero digit. So the rightmost number above&amp;nbsp;is the &lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;normalized one. Unfortunately, the number zero cannot be represented in&amp;nbsp;this scheme, so to represent zero an exception is made. The exception to this rule&amp;nbsp;is that zero is represented as all 0’s in the mantissa.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If the mantissa is represented as a binary, that is, base 2, number, and if the normalization condition is that there is a leading “1” in the normalized mantissa,&amp;nbsp;then there is no need to store that “1” and in fact, most ﬂoating point formats do&amp;nbsp;not store it. Rather, it is “chopped off ” before packing up the number for storage,&amp;nbsp;and it is restored when unpacking the number into exponent and mantissa. This&amp;nbsp;results in having an additional bit of precision on the right of the number, due to&amp;nbsp;removing the bit on the left. This missing bit is referred to as the hidden bit, also&amp;nbsp;known as a hidden 1. For example, if the mantissa in a given format is .11010&amp;nbsp;after normalization, then the bit pattern that is stored is 1010—the left-most bit&amp;nbsp;is truncated, or hidden. We will see that the IEEE 754 ﬂoating point format uses&amp;nbsp;a hidden bit.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/7874966016457880044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_4179.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7874966016457880044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7874966016457880044'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_4179.html' title='Computer Architecture # 02 : Data Representation: NORMALIZATION, AND THE HIDDEN BIT (12)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-6219892687106321319</id><published>2011-04-03T05:00:00.001+07:00</published><updated>2011-04-03T06:04:33.398+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: RANGE AND PRECISION IN FLOATING POINT NUMBERS (11)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=081764704X&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2.3.1 &amp;nbsp;RANGE AND PRECISION IN FLOATING POINT NUMBERS&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;A ﬂoating point representation allows a large range of expressible numbers to be&amp;nbsp;represented in a small number of digits by separating the digits used for precision&amp;nbsp;from the digits used for range. The base 10 ﬂoating point number representing&amp;nbsp;Avogadro’s number is shown below:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;+6.023 × 1023&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Here, the range is represented by a power of 10, 1023 in this case, and the precision is represented by the digits in the ﬁxed point number, 6.023 in this case. In&amp;nbsp;discussing ﬂoating point numbers, the ﬁxed point part is often referred to as the&amp;nbsp;mantissa, &lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;or signiﬁcand of the number. Thus a ﬂoating point number can be&amp;nbsp;characterized by a triple of numbers: sign, exponent, and signiﬁcand.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The range is determined primarily by the number of digits in the exponent (two&amp;nbsp;digits are used here) and the base to which it is raised (base 10 is used here) and&amp;nbsp;the precision is determined primarily by the number of digits in the signiﬁcand&amp;nbsp;(four digits are used here). Thus the entire number can be represented by a sign&amp;nbsp;and 6 digits, two for the exponent and four for the signiﬁcand. Figure 2-7 shows&amp;nbsp;how the triple of sign, exponent, signiﬁcand, might be formatted in a computer.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ9P9s-gPlDvpRrGwn7X2f07eXypMqFpkDm7DkxvvqiGU-bvNh33IrMCWQlGrtaXmSWM4J8yZN84THeFwkcmhas3fkBg0vH6u7e-n95qgOv0E5P4vLiKQSzzFAfkJ6PQewmf4OKazYEZMb/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ9P9s-gPlDvpRrGwn7X2f07eXypMqFpkDm7DkxvvqiGU-bvNh33IrMCWQlGrtaXmSWM4J8yZN84THeFwkcmhas3fkBg0vH6u7e-n95qgOv0E5P4vLiKQSzzFAfkJ6PQewmf4OKazYEZMb/s1600/002+%25285%2529.JPG&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 2-7 &amp;nbsp; &amp;nbsp; Representation of a base 10 floating point number.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Notice how the digits are packed together with the sign ﬁrst, followed by the&amp;nbsp;exponent, followed by the signiﬁcand. This ordering will turn out to be helpful&amp;nbsp;in comparing two ﬂoating point numbers. The reader should be aware that the&amp;nbsp;decimal point does not need to be stored with the number as long as the decimal&amp;nbsp;point is always in the same position in the signiﬁcand. (This will be discussed in&amp;nbsp;Section 2.3.2.)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If we need a greater range, and if we are willing to sacriﬁce precision, then we can&amp;nbsp;use just three digits in the fraction and have three digits left for the exponent&amp;nbsp;without increasing the number of digits used in the representation. An alternative method of increasing the range is to increase the base, which has the effect of&amp;nbsp;increasing the precision of the smallest numbers but decreasing the precision of&amp;nbsp;the largest numbers. The range/precision trade-off is a major advantage of using&amp;nbsp;a ﬂoating point representation, but the reduced precision can cause problems,&amp;nbsp;sometimes leading to disaster, an example of which is described in Section 2.4.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/6219892687106321319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_8665.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6219892687106321319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6219892687106321319'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_8665.html' title='Computer Architecture # 02 : Data Representation: RANGE AND PRECISION IN FLOATING POINT NUMBERS (11)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ9P9s-gPlDvpRrGwn7X2f07eXypMqFpkDm7DkxvvqiGU-bvNh33IrMCWQlGrtaXmSWM4J8yZN84THeFwkcmhas3fkBg0vH6u7e-n95qgOv0E5P4vLiKQSzzFAfkJ6PQewmf4OKazYEZMb/s72-c/002+%25285%2529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-4125003553169340680</id><published>2011-04-03T04:51:00.001+07:00</published><updated>2011-04-03T06:07:10.615+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: Floating Point Numbers (10)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B002QXASV0&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.3 Floating Point Numbers&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The ﬁxed point number representation, which we explored in Section 2.2, has a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ﬁxed position for the radix point, and a ﬁxed number of digits to the left and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;right of the radix point. A ﬁxed point representation may need a great many dig&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;its in order to represent a practical range of numbers. For example, a computer&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;that can represent a number as large as a trillion1 maintains at least 40 bits to the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;left of the radix point since 240 ≈ 1012. If the same computer needs to represent&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;one trillionth, then 40 bits must also be maintained to the right of the radix&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;point, which results in a total of 80 bits per number.&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In practice, much larger numbers and much smaller numbers appear during the&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;course of computation, which places even greater demands on a computer. A&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;great deal of hardware is required in order to store and manipulate numbers with&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;80 or more bits of precision, and computation proceeds more slowly for a large&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;number of digits than for a small number of digits. Fine precision, however, is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;generally not needed when large numbers are used, and conversely, large num&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;bers do not generally need to be represented when calculations are made with&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;small numbers. A more efﬁcient computer can be realized when only as much&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;precision is retained as is needed.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/4125003553169340680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_5887.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4125003553169340680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4125003553169340680'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_5887.html' title='Computer Architecture # 02 : Data Representation: Floating Point Numbers (10)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-6811323379300177164</id><published>2011-04-03T04:48:00.001+07:00</published><updated>2011-04-03T06:04:52.244+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation: BINARY CODED DECIMAL (9)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=6130091621&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.2.7 BINARY CODED DECIMAL&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Numbers can be represented in the base 10 number system while still using a&amp;nbsp;binary encoding. Each base 10 digit occupies four bit positions, which is known&amp;nbsp;as binary coded decimal (BCD). Each BCD digit can take on any of 10 values.&amp;nbsp;There are 24 = 16 possible bit patterns for each base 10 digit, and as a result, six&amp;nbsp;bit patterns are unused for each digit. In Figure 2-6, there are four decimal significant digits, so 104 = 10,000 bit patterns are valid, even though 216 = 65,536 bit&amp;nbsp;patterns are possible with 16 bits.&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvpTue4p53lL_VjfTKz1DE3EreOhlmxYTHwGuGLcvGrBOtZbhxCOYhozZG89Nyzn3w0gOFsV0Q0-sy8EENuY7IkvyMvOVQI5MrxmdYNl8kjTtIrh2VDGqSbbFvtxdkElXDcFVXJ6Ej7Y1U/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;111&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvpTue4p53lL_VjfTKz1DE3EreOhlmxYTHwGuGLcvGrBOtZbhxCOYhozZG89Nyzn3w0gOFsV0Q0-sy8EENuY7IkvyMvOVQI5MrxmdYNl8kjTtIrh2VDGqSbbFvtxdkElXDcFVXJ6Ej7Y1U/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Figure 2-6 &amp;nbsp; &amp;nbsp;BCD representations of 301 (a) and –301 in nine’s complement (b) and ten’s comple-&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ment (c).&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Although some bit patterns are unused, the BCD format is commonly used in&amp;nbsp;calculators and in business applications. There are fewer problems in representing terminating base 10 fractions in this format, unlike the base 2 representation.&amp;nbsp;There is no need to convert data that is given at the input in base 10 form (as in&amp;nbsp;a calculator) into an internal base 2 representation, or to convert from an internal&amp;nbsp;representation of base 2 to an output form of base 10.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Performing arithmetic on signed BCD numbers may not be obvious. Although&amp;nbsp;we are accustomed to using a signed magnitude representation in base 10, a different method of representing signed base 10 numbers is used in a computer. In&amp;nbsp;the nine’s complement number system, positive numbers are represented as in&amp;nbsp;ordinary BCD, but the leftmost digit is less than 5 for positive numbers and is 5&amp;nbsp;or greater for negative numbers. The nine’s complement negative is formed by&amp;nbsp;subtracting each digit from 9. For example, the base 10 number +301 is represented as 0301 (or simply 301) in both nine’s and ten’s complement as shown in&amp;nbsp;Figure 2-6a. The nine’s complement negative is 9698 (Figure 2-6b), which is&amp;nbsp;obtained by subtracting each digit in 0301 from 9.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The ten’s complement negative is formed by adding 1 to the nine’s complement&amp;nbsp;negative, so the ten’s complement representation of &amp;nbsp;−301 is then 9698 + 1 =&amp;nbsp;9699 as shown in Figure 2-6c. For this example, the positive numbers range from&amp;nbsp;0 – 4999 and the negative numbers range from 5000 to 9999.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/6811323379300177164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_6570.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6811323379300177164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/6811323379300177164'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_6570.html' title='Computer Architecture # 02 : Data Representation: BINARY CODED DECIMAL (9)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvpTue4p53lL_VjfTKz1DE3EreOhlmxYTHwGuGLcvGrBOtZbhxCOYhozZG89Nyzn3w0gOFsV0Q0-sy8EENuY7IkvyMvOVQI5MrxmdYNl8kjTtIrh2VDGqSbbFvtxdkElXDcFVXJ6Ej7Y1U/s72-c/002+%25285%2529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-4640010421046373441</id><published>2011-04-03T04:28:00.001+07:00</published><updated>2011-04-03T06:05:10.733+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation : SIGNED FIXED POINT NUMBERS (8)</title><content type='html'>&lt;b&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1584880872&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.2.6 SIGNED FIXED POINT NUMBERS&lt;/b&gt;&lt;br /&gt;
Up to this point we have considered only the representation of unsigned ﬁxed&amp;nbsp;point numbers. The situation is quite different in representing signed ﬁxed point&amp;nbsp;numbers. There are four different ways of representing signed numbers that are&amp;nbsp;commonly used: sign-magnitude, one’s complement, two’s complement, and&amp;nbsp;excess notation. We will cover each in turn, using integers for our examples.&lt;br /&gt;
&lt;br /&gt;
Throughout the discussion, the reader may wish to refer to Table 2.1 which&amp;nbsp;shows for a 3-bit number how the various representations appear.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB8Ife85OPkzxY8LNUv7Gf82ZydA7rHh1qFTFyVNusgGOIcAbXYd_kjJz6b4K9ipnGQ9t-vtjhNVyA3w0LEe-hnBqlpX5FI_jhPLB59DzjEPvUwZTl9bZ3E8Ho_vLJ9y9paJHabChTNEE1/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;259&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB8Ife85OPkzxY8LNUv7Gf82ZydA7rHh1qFTFyVNusgGOIcAbXYd_kjJz6b4K9ipnGQ9t-vtjhNVyA3w0LEe-hnBqlpX5FI_jhPLB59DzjEPvUwZTl9bZ3E8Ho_vLJ9y9paJHabChTNEE1/s320/002+%25285%2529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Table 2.1: 3-bit Integer Representations&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Signed Magnitude&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
The signed magnitude (also referred to as sign and magnitude) representation&amp;nbsp;is most familiar to us as the base 10 number system. A plus or minus sign to the&amp;nbsp;left of a number indicates whether the number is positive or negative as in +1210&amp;nbsp;or −1210. In the binary signed magnitude representation, the leftmost bit is used&amp;nbsp;for the sign, which takes on a value of 0 or 1 for ‘+’ or ‘−’, respectively. The&amp;nbsp;remaining bits contain the absolute magnitude. Consider representing (+12)10&amp;nbsp;and (−12)10 in an eight-bit format:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;(+12)10 = (00001100)2&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;(−12)10 = (10001100)2&lt;/div&gt;The negative number is formed by simply changing the sign bit in the positive&amp;nbsp;number from 0 to 1. Notice that there are both positive and negative representations for zero: 00000000 and 10000000.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are eight bits in this example format, and all bit patterns represent valid&amp;nbsp;numbers, so there are 28 = 256 possible patterns. Only 28 − 1 = 255 different&amp;nbsp;numbers can be represented, however, since +0 and −0 represent the same number.&amp;nbsp;We will make use of the signed magnitude representation when we look at ﬂoating point numbers in Section 2.3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;One’s Complement&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
The one’s complement operation is trivial to perform: convert all of the 1’s in&amp;nbsp;the number to 0’s, and all of the 0’s to 1’s. See the fourth column in Table 2.1 for&amp;nbsp;examples. We can observe from the table that in the one’s complement representation the leftmost bit is 0 for positive numbers and 1 for negative numbers, as it&amp;nbsp;is for the signed magnitude representation. This negation, changing 1’s to 0’s and&amp;nbsp;changing 0’s to 1’s, is known as complementing the bits. Consider again representing (+12)10 and (−12)10 in an eight-bit format, now using the one’s complement representation:&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;(+12)10 = (00001100)2&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;(−12)10 = (11110011)2&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Note again that there are representations for both +0 and &amp;nbsp;−0, which are&amp;nbsp;00000000 and 11111111, respectively. As a result, there are only 28 − 1 = 255&amp;nbsp;different numbers that can be represented even though there are 28 different bit&amp;nbsp;patterns.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;The one’s complement representation is not commonly used. This is at least&amp;nbsp;partly due to the difﬁculty in making comparisons when there are two representations for 0. There is also additional complexity involved in adding numbers,&amp;nbsp;which is discussed further in Chapter 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Two’s Complement&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The two’s complement is formed in a way similar to forming the one’s complement: complement all of the bits in the number, but then add 1, and if that addition results in a carry-out from the most signiﬁcant bit of the number, discard&amp;nbsp;the carry-out. Examination of the ﬁfth column of Table 2.1 shows that in the&amp;nbsp;two’s complement representation, the leftmost bit is again 0 for positive numbers and is 1 for negative numbers. However, this number format does not have&amp;nbsp;the unfortunate characteristic of signed-magnitude and one’s complement representations: it has only one representation for zero. To see that this is true, consider forming the negative of (+0)10, which has the bit pattern:&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;(+0)10 = (00000000)2&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Forming the one’s complement of (00000000)2 produces (11111111)2 and adding 1 to it yields (00000000)2, thus (−0)10 = (00000000)2. The carry out of the&amp;nbsp;leftmost position is discarded in two’s complement addition (except when detecting an overﬂow condition). Since there is only one representation for 0, and since&amp;nbsp;all bit patterns are valid, there are 28 = 256 different numbers that can be represented.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Consider again representing (+12)10 and (−12)10 in an eight-bit format, this&amp;nbsp;time using the two’s complement representation. Starting with (+12)10 =&amp;nbsp;(00001100)2, complement, or negate the number, producing (11110011)2.&amp;nbsp;Now add 1, producing (11110100)2, and thus (−12)10 = (11110100)2:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;(+12)10 = (00001100)2&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;(−12)10 = (11110100)2&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;There is an equal number of positive and negative numbers provided zero is considered to be a positive number, which is reasonable because its sign bit is 0. The&amp;nbsp;positive numbers start at 0, but the negative numbers start at −1, and so the magnitude of the most negative number is one greater than the magnitude of the&amp;nbsp;most positive number. The positive number with the largest magnitude is +127,&amp;nbsp;and the negative number with the largest magnitude is −128. There is thus no&amp;nbsp;positive number that can be represented that corresponds to the negative of&amp;nbsp;−128. If we try to form the two’s complement negative of −128, then we will&amp;nbsp;arrive at a negative number, as shown below:&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQGbud1nkpZIwCRkSscSJyx5cfGhnatEyYIYZyJZPX8jof24kkv0H2lHQrlATqUjLf_YEwRQXbmFw6Hth2YkM4iefP4vZY5f-XPQJqavlvGvcdNvq9I5mYdxyFNAOIIDgCCzSQin8THB1/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQGbud1nkpZIwCRkSscSJyx5cfGhnatEyYIYZyJZPX8jof24kkv0H2lHQrlATqUjLf_YEwRQXbmFw6Hth2YkM4iefP4vZY5f-XPQJqavlvGvcdNvq9I5mYdxyFNAOIIDgCCzSQin8THB1/s1600/002+%25285%2529.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The two’s complement representation is the representation most commonly used&amp;nbsp;in conventional computers, and we will use it throughout the book.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;i&gt;Excess Representation&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In the excess or biased representation, the number is treated as unsigned, but is&amp;nbsp;“shifted” in value by subtracting the bias from it. The concept is to assign the&amp;nbsp;smallest numerical bit pattern, all zeros, to the negative of the bias, and assign the&amp;nbsp;remaining numbers in sequence as the bit patterns increase in magnitude. A convenient way to think of an excess representation is that a number is represented.&amp;nbsp;as the sum of its two’s complement form and another number, which is known as&amp;nbsp;the “excess,” or “bias.” Once again, refer to Table 2.1, the rightmost column, for&amp;nbsp;examples.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Consider again representing (+12)10 and (−12)10 in an eight-bit format but now&amp;nbsp;using an excess 128 representation. An excess 128 number is formed by adding&amp;nbsp;128 to the original number, and then creating the unsigned binary version. For&amp;nbsp;(+12)10, we compute (128 + 12 = 140)10 and produce the bit pattern&amp;nbsp;(10001100)2. For (−12)10, we compute (128 + −12 = 116)10 and produce the&amp;nbsp;bit pattern (01110100)2:&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;(+12)10 = (10001100)2&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;(−12)10 = (01110100)2&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;i&gt;Note that there is no numerical signiﬁcance to the excess valu&lt;/i&gt;&lt;/b&gt;e: it simply has the&amp;nbsp;effect of shifting the representation of the two’s complement numbers.&amp;nbsp;There is only one excess representation for 0, since the excess representation is&amp;nbsp;simply a shifted version of the two’s complement representation. For the previous&amp;nbsp;case, the excess value is chosen to have the same bit pattern as the largest negative&amp;nbsp;number, which has the effect of making the numbers appear in numerically&amp;nbsp;sorted order if the numbers are viewed in an unsigned binary representation.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Thus, the most negative number is (−128)10 = (00000000)2 and the most positive number is (+127)10 = (11111111)2. This representation simpliﬁes making&amp;nbsp;comparisons between numbers, since the bit patterns for negative numbers have&amp;nbsp;numerically smaller values than the bit patterns for positive numbers. This is&amp;nbsp;important for representing the exponents of ﬂoating point numbers, in which&amp;nbsp;exponents of two numbers are compared in order to make them equal for addition and subtraction. We will explore ﬂoating point representations in Section&amp;nbsp;2.3.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/4640010421046373441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_03.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4640010421046373441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/4640010421046373441'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data_03.html' title='Computer Architecture # 02 : Data Representation : SIGNED FIXED POINT NUMBERS (8)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB8Ife85OPkzxY8LNUv7Gf82ZydA7rHh1qFTFyVNusgGOIcAbXYd_kjJz6b4K9ipnGQ9t-vtjhNVyA3w0LEe-hnBqlpX5FI_jhPLB59DzjEPvUwZTl9bZ3E8Ho_vLJ9y9paJHabChTNEE1/s72-c/002+%25285%2529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2810237285452285117.post-7295900108195786113</id><published>2011-04-03T04:12:00.001+07:00</published><updated>2011-04-03T06:05:12.340+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Architecture"/><title type='text'>Computer Architecture # 02 : Data Representation : AN EARLY LOOK AT COMPUTER ARITHMETIC(7)</title><content type='html'>&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;iframe align=&quot;left&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://rcm.amazon.com/e/cm?t=widgetsamazon-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B002361NM8&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&quot; style=&quot;align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;&quot;&gt;&lt;/iframe&gt;2.2.5 AN EARLY LOOK AT COMPUTER ARITHMETIC&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;We will explore computer arithmetic in detail in Chapter 3, but for the moment,&amp;nbsp;we need to learn how to perform simple binary addition because it is used in representing signed binary numbers. Binary addition is performed similar to the&amp;nbsp;way we perform decimal addition by hand, as illustrated in Figure 2-5. Two&amp;nbsp;binary numbers A and B are added from right to left, creating a sum and a carry&amp;nbsp;in each bit position. Since the rightmost bits of A and B can each assume one of&amp;nbsp;two values, four cases must be considered: 0 + 0, 0 + 1, 1 + 0, and 1 + 1, with a&amp;nbsp;carry of 0, as shown in the ﬁgure. &lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;The carry into the rightmost bit position&amp;nbsp;defaults to 0. For the remaining bit positions, the carry into the position can be 0&amp;nbsp;or 1, so that a total of eight input combinations must be considered as shown in&amp;nbsp;the ﬁgure.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGGNSdPb0LNm2BHVS3PQn0jMkD9v2eNJ5klYlbqv3VzSW5bx7UtazrJqhMMVYMbK36FM1w7UIi-3XknZKlmHDYsPo4Qh5obs2UkBtEfOAvCYq7AcaAG-3dmqLIs00yAs6cRkQFAx0voAj-/s1600/002+%25285%2529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;165&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGGNSdPb0LNm2BHVS3PQn0jMkD9v2eNJ5klYlbqv3VzSW5bx7UtazrJqhMMVYMbK36FM1w7UIi-3XknZKlmHDYsPo4Qh5obs2UkBtEfOAvCYq7AcaAG-3dmqLIs00yAs6cRkQFAx0voAj-/s320/002+%25285%2529.JPG&quot; style=&quot;cursor: move;&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Figure 2-5 &amp;nbsp; &amp;nbsp;Example of binary addition.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Notice that the largest number we can represent using the eight-bit format&amp;nbsp;shown in Figure 2-5 is (11111111)2 = (255)10 and that the smallest number that&amp;nbsp;can be represented is (00000000)2 = (0)10. The bit patterns 11111111 and&amp;nbsp;00000000 and all of the intermediate bit patterns represent numbers on the&amp;nbsp;closed interval from 0 to 255, which are all positive numbers. Up to this point&amp;nbsp;we have considered only unsigned numbers, but we need to represent signed&amp;nbsp;numbers as well, in which (approximately) one half of the bit patterns is assigned&amp;nbsp;to positive numbers and the other half is assigned to negative numbers. Four&amp;nbsp;common representations for base 2 signed numbers are discussed in the next section.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://4them.blogspot.com/feeds/7295900108195786113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7295900108195786113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2810237285452285117/posts/default/7295900108195786113'/><link rel='alternate' type='text/html' href='http://4them.blogspot.com/2011/04/computer-architecture-02-data.html' title='Computer Architecture # 02 : Data Representation : AN EARLY LOOK AT COMPUTER ARITHMETIC(7)'/><author><name>What do you think about this blog ?</name><uri>http://www.blogger.com/profile/02700063052469081757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj73OYUx_0k0kO4oKkhsaG-Hjlp-997t2xppBWkspaTV7acqlSLUMFXgM9LbQhaeiGS-HaqzHevi6ffY3qrROTXvgcbxSs4SdZuU4_SvXxLmYoJR7RS34Qm-XrdU0dJXQ/s220/profil+FB.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGGNSdPb0LNm2BHVS3PQn0jMkD9v2eNJ5klYlbqv3VzSW5bx7UtazrJqhMMVYMbK36FM1w7UIi-3XknZKlmHDYsPo4Qh5obs2UkBtEfOAvCYq7AcaAG-3dmqLIs00yAs6cRkQFAx0voAj-/s72-c/002+%25285%2529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>