{"id":81,"date":"2018-07-18T09:43:37","date_gmt":"2018-07-18T09:43:37","guid":{"rendered":"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=81"},"modified":"2018-08-03T07:00:57","modified_gmt":"2018-08-03T07:00:57","slug":"81","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/chapter\/81\/","title":{"rendered":"Fixed Point Arithmetic Unit II"},"content":{"raw":"<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The objectives of this module are to discuss Booth\u2019s multiplication technique, fast multiplication techniques and binary division techniques.<\/p>\r\n&nbsp;\r\n\r\n<strong>Booth\u2019s Multiplier<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The major advantage of the Booth\u2019s technique as proposed by Andrew D. Booth is that it handles both positive and negative numbers. It may also have an added advantage of reducing the number of operations depending on the multiplier. The principle behind this is given below.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Consider a positive multiplier consisting of a block of 1s surrounded by 0s. For example, 00111110. The product is given by :<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">M x 00111110 = M x (2<sup>5<\/sup> + 2<sup>4<\/sup>+ 2<sup>3<\/sup> + 2<sup>2<\/sup> + 2<sup>1<\/sup>) = M x 62, where M is the multiplicand. The number of operations can be reduced to two by rewriting the same as<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">M x 01000010 = M x (2<sup>6<\/sup> - 2<sup>1<\/sup>) = M x 62<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">In fact, it can be shown that any sequence of 1's in a binary number can be broken into the difference of two binary numbers:<\/p>\r\n<img class=\"size-full wp-image-82 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-39.png\" alt=\"\" width=\"518\" height=\"44\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Hence, we can actually replace the multiplication by the string of ones in the original number by simpler operations, adding the multiplier, shifting the partial product thus formed by appropriate places, and then finally subtracting the multiplier. It is making use of the fact that we do not have to do anything but shift while we are dealing with 0s in a binary multiplier, and is similar to using the mathematical property that 99 = 100 \u2212 1 while multiplying by 99.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">This scheme can be extended to any number of blocks of 1s in a multiplier (including the case of single 1 in a block). Thus,<\/p>\r\n<img class=\"size-full wp-image-83 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-40.png\" alt=\"\" width=\"555\" height=\"62\" \/>\r\n<p style=\"text-align: justify\">Booth's algorithm follows this scheme by performing an addition when it encounters the first digit of a block of ones (0 1) and a subtraction when it encounters the end of the block (1 0). This works for a negative multiplier as well. When the ones in a multiplier are grouped into long blocks, Booth's algorithm\u00a0<span style=\"text-align: initial;font-size: 1em\">performs fewer additions and subtractions than the normal multiplication algorithm.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">As a ready reference, use the table below:\u00a0<\/span><\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-84 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-41.png\" alt=\"\" width=\"332\" height=\"172\" \/>\r\n\r\n<strong style=\"text-align: initial;text-indent: 1em;font-size: 1em\">Fast multiplication<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: justify;font-size: 1em\">We saw the binary multiplication techniques in the previous section. This section will introduce you to two ways of speeding up the multiplication process. The first method is a further modification to the Booth\u2019s technique that helps reduce the number of summands to n \/ 2 for n-bit operands. The second techinque reduces the time taken to add the summands.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;font-size: 1em\">Bit \u2013 pair recoding of multiplier<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"font-size: 1em\">This is derived from the Booth\u2019s algorithm. It pairs the multiplier bits and gives one multiplier bit per pair, thus reducing the number of summands by half. This is shown below.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-85 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-42.png\" alt=\"\" width=\"480\" height=\"257\" \/>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-86 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-43.png\" alt=\"\" width=\"613\" height=\"344\" \/>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-87 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-44.png\" alt=\"\" width=\"544\" height=\"470\" \/>\r\n\r\n<img class=\"size-full wp-image-88 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-45.png\" alt=\"\" width=\"360\" height=\"179\" \/>\r\n<p style=\"text-align: center\">Multiplication requiring only <em>n<\/em>\/2<\/p>\r\n<p style=\"text-align: center\">summands <strong>Carry-save addition of summands<\/strong><\/p>\r\n\r\n<\/div>\r\n<div><\/div>\r\n<div style=\"text-align: center\"><span style=\"text-align: justify;font-size: 1em\">Carry save adders (CSA) speed up the addition of the summands generated during the multiplication process. The inputs to a full adder are normally the two bits of the two numbers and the carry input from the previous stage. On the other hand, in the case of the CSA, all the three bits are taken from the three numbers. The carry generated is saved and added at the next level. A CSA takes in two inputs and outputs two outputs. This is shown below.<\/span><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-89 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-46.png\" alt=\"\" width=\"589\" height=\"346\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">As the figure above shows, one CSA block is used for every bit. This circuit adds 3 8-bit numbers into two numbers.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">The important point is that c and s can be computed independently and each ci and si can be computed independent of all other ci\u2019s and si\u2019s. An example is given below.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-90 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-47.png\" alt=\"\" width=\"361\" height=\"155\" \/>\r\n\r\n&nbsp;\r\n\r\nThe multiplication process carried out using CSA is illustrated below.\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-91 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-48.png\" alt=\"\" width=\"535\" height=\"522\" \/>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Thus, in order to speed up the multiplication process, bit-pair recoding of the multiplier is used to reduce the summands. These summands are then reduced to 2 using a few CSA steps. The final product is generated by an addition operation that uses CLA. All these three techniques help in reducing the time taken for multiplication.<\/p>\r\n&nbsp;\r\n\r\n<strong>Binary division<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: justify;font-size: 1em\">An example of binary division is shown below. We first examine the divisor and the dividend, decide that only if we consider the first three bits of the dividend the divisor will go and then proceed. The first two bits, though not shown, will have to be 0\u2019s. We then get a quotient bit of 1, do the subtraction, get the partial remainder and do the trial subtraction (mentally) and accordingly generate the quotient bit. This process is repeated till we exhaust all the dividend bits. This is illustrated below.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-92 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-49.png\" alt=\"\" width=\"330\" height=\"308\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Now, the same logic has to be adopted for machine implementation too. Only thing is that, it has to be done systematically, and to decide whether the divisor is less than or equal to the dividend, we have to do a trial comparison \/ subtraction. There are basically two types of division algorithms:<\/p>\r\n&nbsp;\r\n<ul>\r\n \t<li>Restoring division<\/li>\r\n \t<li>Non-restoring division<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\nBoth these are for positive numbers. Negative numbers are handled the same way with the sign bits processed separately.\r\n\r\n&nbsp;\r\n\r\n<strong>Restoring division<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Take the first bit of the dividend and do a trial subtraction. If the subtraction produces a negative result, we generate a quotient bit of zero, restore, bring the next bit of dividend and continue. Otherwise, we simply continue with a quotient bit of 1. The algorithm, register organization and example are given below.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"size-full wp-image-93 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-50.png\" alt=\"\" width=\"634\" height=\"254\" \/>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>where <\/strong><em>N=Numerator, D=Denominator, n=#bits, P=Partial remainder, q(i)=bit #i of<\/em> <em>quotient<\/em>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"size-full wp-image-94 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-51.png\" alt=\"\" width=\"710\" height=\"350\" \/>\r\n\r\n<img class=\"size-full wp-image-95 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-52.png\" alt=\"\" width=\"375\" height=\"495\" \/>\r\n\r\n&nbsp;\r\n\r\n<strong>Non-restoring division<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">This is a modification of the restoring algorithm. It combines the restore \/ no restore and shift left steps of two successive cycles and reduces the number of operations. The algorithm is given below.<\/p>\r\n\r\n<ul>\r\n \t<li>Do the first shift and subtraction<\/li>\r\n \t<li>Check sign of the partial remainder<\/li>\r\n \t<li>If it is negative, shift and add<\/li>\r\n \t<li>If it is positive, shift and subtract<\/li>\r\n \t<li>Fix the quotient bit appropriately<\/li>\r\n \t<li>If the final remainder is negative, add the divisor<strong style=\"text-align: initial;font-size: 1em\">.<\/strong><\/li>\r\n<\/ul>\r\nAn example is discussed below.\r\n\r\n&nbsp;\r\n\r\n<\/div>\r\n<img class=\"size-full wp-image-96 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-53.png\" alt=\"\" width=\"405\" height=\"359\" \/>\r\n\r\n<strong>Remainder<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">To summarize, we have discussed the Booth\u2019s multiplication technique used for handling positive and negative numbers in the same manner. We also discussed carry save addition and saw how fast multiplication can be carried out. Finally, we discussed the restoring and non restoring division algorithms.<\/p>\r\n&nbsp;\r\n\r\n<strong>Web Links \/ Supporting Materials<\/strong>\r\n<ul>\r\n \t<li>Computer Organization, Carl Hamacher, Zvonko Vranesic and Safwat Zaky, 5th.Edition, McGraw- Hill Higher Education, 2011.<\/li>\r\n \t<li>Computer Organization and Design \u2013 The Hardware \/ Software Interface, David A. Patterson and John L. Hennessy, 4th.Edition, Morgan Kaufmann, Elsevier, 2009.<\/li>\r\n<\/ul>","rendered":"<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The objectives of this module are to discuss Booth\u2019s multiplication technique, fast multiplication techniques and binary division techniques.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Booth\u2019s Multiplier<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The major advantage of the Booth\u2019s technique as proposed by Andrew D. Booth is that it handles both positive and negative numbers. It may also have an added advantage of reducing the number of operations depending on the multiplier. The principle behind this is given below.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Consider a positive multiplier consisting of a block of 1s surrounded by 0s. For example, 00111110. The product is given by :<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">M x 00111110 = M x (2<sup>5<\/sup> + 2<sup>4<\/sup>+ 2<sup>3<\/sup> + 2<sup>2<\/sup> + 2<sup>1<\/sup>) = M x 62, where M is the multiplicand. The number of operations can be reduced to two by rewriting the same as<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">M x 01000010 = M x (2<sup>6<\/sup> &#8211; 2<sup>1<\/sup>) = M x 62<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In fact, it can be shown that any sequence of 1&#8217;s in a binary number can be broken into the difference of two binary numbers:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-82 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-39.png\" alt=\"\" width=\"518\" height=\"44\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-39.png 518w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-39-300x25.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-39-65x6.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-39-225x19.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-39-350x30.png 350w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Hence, we can actually replace the multiplication by the string of ones in the original number by simpler operations, adding the multiplier, shifting the partial product thus formed by appropriate places, and then finally subtracting the multiplier. It is making use of the fact that we do not have to do anything but shift while we are dealing with 0s in a binary multiplier, and is similar to using the mathematical property that 99 = 100 \u2212 1 while multiplying by 99.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">This scheme can be extended to any number of blocks of 1s in a multiplier (including the case of single 1 in a block). Thus,<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-83 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-40.png\" alt=\"\" width=\"555\" height=\"62\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-40.png 555w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-40-300x34.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-40-65x7.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-40-225x25.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-40-350x39.png 350w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/p>\n<p style=\"text-align: justify\">Booth&#8217;s algorithm follows this scheme by performing an addition when it encounters the first digit of a block of ones (0 1) and a subtraction when it encounters the end of the block (1 0). This works for a negative multiplier as well. When the ones in a multiplier are grouped into long blocks, Booth&#8217;s algorithm\u00a0<span style=\"text-align: initial;font-size: 1em\">performs fewer additions and subtractions than the normal multiplication algorithm.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">As a ready reference, use the table below:\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-41.png\" alt=\"\" width=\"332\" height=\"172\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-41.png 332w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-41-300x155.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-41-65x34.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-41-225x117.png 225w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/p>\n<p><strong style=\"text-align: initial;text-indent: 1em;font-size: 1em\">Fast multiplication<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: justify;font-size: 1em\">We saw the binary multiplication techniques in the previous section. This section will introduce you to two ways of speeding up the multiplication process. The first method is a further modification to the Booth\u2019s technique that helps reduce the number of summands to n \/ 2 for n-bit operands. The second techinque reduces the time taken to add the summands.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong style=\"text-align: initial;font-size: 1em\">Bit \u2013 pair recoding of multiplier<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"font-size: 1em\">This is derived from the Booth\u2019s algorithm. It pairs the multiplier bits and gives one multiplier bit per pair, thus reducing the number of summands by half. This is shown below.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-85 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-42.png\" alt=\"\" width=\"480\" height=\"257\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-42.png 480w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-42-300x161.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-42-65x35.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-42-225x120.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-42-350x187.png 350w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-86 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-43.png\" alt=\"\" width=\"613\" height=\"344\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-43.png 613w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-43-300x168.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-43-65x36.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-43-225x126.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-43-350x196.png 350w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-44.png\" alt=\"\" width=\"544\" height=\"470\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-44.png 544w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-44-300x259.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-44-65x56.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-44-225x194.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-44-350x302.png 350w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-88 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-45.png\" alt=\"\" width=\"360\" height=\"179\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-45.png 360w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-45-300x149.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-45-65x32.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-45-225x112.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-45-350x174.png 350w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/p>\n<p style=\"text-align: center\">Multiplication requiring only <em>n<\/em>\/2<\/p>\n<p style=\"text-align: center\">summands <strong>Carry-save addition of summands<\/strong><\/p>\n<\/div>\n<div><\/div>\n<div style=\"text-align: center\"><span style=\"text-align: justify;font-size: 1em\">Carry save adders (CSA) speed up the addition of the summands generated during the multiplication process. The inputs to a full adder are normally the two bits of the two numbers and the carry input from the previous stage. On the other hand, in the case of the CSA, all the three bits are taken from the three numbers. The carry generated is saved and added at the next level. A CSA takes in two inputs and outputs two outputs. This is shown below.<\/span><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-89 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-46.png\" alt=\"\" width=\"589\" height=\"346\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-46.png 589w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-46-300x176.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-46-65x38.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-46-225x132.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-46-350x206.png 350w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">As the figure above shows, one CSA block is used for every bit. This circuit adds 3 8-bit numbers into two numbers.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The important point is that c and s can be computed independently and each ci and si can be computed independent of all other ci\u2019s and si\u2019s. An example is given below.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-47.png\" alt=\"\" width=\"361\" height=\"155\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-47.png 361w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-47-300x129.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-47-65x28.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-47-225x97.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-47-350x150.png 350w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The multiplication process carried out using CSA is illustrated below.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-91 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-48.png\" alt=\"\" width=\"535\" height=\"522\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-48.png 535w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-48-300x293.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-48-65x63.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-48-225x220.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-48-350x341.png 350w\" sizes=\"auto, (max-width: 535px) 100vw, 535px\" \/><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Thus, in order to speed up the multiplication process, bit-pair recoding of the multiplier is used to reduce the summands. These summands are then reduced to 2 using a few CSA steps. The final product is generated by an addition operation that uses CLA. All these three techniques help in reducing the time taken for multiplication.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Binary division<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: justify;font-size: 1em\">An example of binary division is shown below. We first examine the divisor and the dividend, decide that only if we consider the first three bits of the dividend the divisor will go and then proceed. The first two bits, though not shown, will have to be 0\u2019s. We then get a quotient bit of 1, do the subtraction, get the partial remainder and do the trial subtraction (mentally) and accordingly generate the quotient bit. This process is repeated till we exhaust all the dividend bits. This is illustrated below.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-92 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-49.png\" alt=\"\" width=\"330\" height=\"308\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-49.png 330w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-49-300x280.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-49-65x61.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-49-225x210.png 225w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Now, the same logic has to be adopted for machine implementation too. Only thing is that, it has to be done systematically, and to decide whether the divisor is less than or equal to the dividend, we have to do a trial comparison \/ subtraction. There are basically two types of division algorithms:<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Restoring division<\/li>\n<li>Non-restoring division<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Both these are for positive numbers. Negative numbers are handled the same way with the sign bits processed separately.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Restoring division<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Take the first bit of the dividend and do a trial subtraction. If the subtraction produces a negative result, we generate a quotient bit of zero, restore, bring the next bit of dividend and continue. Otherwise, we simply continue with a quotient bit of 1. The algorithm, register organization and example are given below.<\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-93 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-50.png\" alt=\"\" width=\"634\" height=\"254\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-50.png 634w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-50-300x120.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-50-65x26.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-50-225x90.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-50-350x140.png 350w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>where <\/strong><em>N=Numerator, D=Denominator, n=#bits, P=Partial remainder, q(i)=bit #i of<\/em> <em>quotient<\/em><\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-94 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-51.png\" alt=\"\" width=\"710\" height=\"350\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-51.png 710w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-51-300x148.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-51-65x32.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-51-225x111.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-51-350x173.png 350w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-95 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-52.png\" alt=\"\" width=\"375\" height=\"495\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-52.png 375w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-52-227x300.png 227w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-52-65x86.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-52-225x297.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-52-350x462.png 350w\" sizes=\"auto, (max-width: 375px) 100vw, 375px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Non-restoring division<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">This is a modification of the restoring algorithm. It combines the restore \/ no restore and shift left steps of two successive cycles and reduces the number of operations. The algorithm is given below.<\/p>\n<ul>\n<li>Do the first shift and subtraction<\/li>\n<li>Check sign of the partial remainder<\/li>\n<li>If it is negative, shift and add<\/li>\n<li>If it is positive, shift and subtract<\/li>\n<li>Fix the quotient bit appropriately<\/li>\n<li>If the final remainder is negative, add the divisor<strong style=\"text-align: initial;font-size: 1em\">.<\/strong><\/li>\n<\/ul>\n<p>An example is discussed below.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-96 aligncenter\" src=\"http:\/\/csp2.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/46\/2018\/07\/2-53.png\" alt=\"\" width=\"405\" height=\"359\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-53.png 405w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-53-300x266.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-53-65x58.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-53-225x199.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-content\/uploads\/sites\/46\/2018\/07\/2-53-350x310.png 350w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/p>\n<p><strong>Remainder<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">To summarize, we have discussed the Booth\u2019s multiplication technique used for handling positive and negative numbers in the same manner. We also discussed carry save addition and saw how fast multiplication can be carried out. Finally, we discussed the restoring and non restoring division algorithms.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Web Links \/ Supporting Materials<\/strong><\/p>\n<ul>\n<li>Computer Organization, Carl Hamacher, Zvonko Vranesic and Safwat Zaky, 5th.Edition, McGraw- Hill Higher Education, 2011.<\/li>\n<li>Computer Organization and Design \u2013 The Hardware \/ Software Interface, David A. Patterson and John L. Hennessy, 4th.Edition, Morgan Kaufmann, Elsevier, 2009.<\/li>\n<\/ul>\n","protected":false},"author":2,"menu_order":6,"template":"","meta":{"_acf_changed":false,"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-a-p-shanthi"],"pb_section_license":""},"chapter-type":[],"contributor":[58],"license":[],"class_list":["post-81","chapter","type-chapter","status-publish","hentry","contributor-dr-a-p-shanthi"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/pressbooks\/v2\/chapters\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":5,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/pressbooks\/v2\/chapters\/81\/revisions"}],"predecessor-version":[{"id":440,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/pressbooks\/v2\/chapters\/81\/revisions\/440"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/pressbooks\/v2\/chapters\/81\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/pressbooks\/v2\/chapter-type?post=81"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/wp\/v2\/contributor?post=81"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp2\/wp-json\/wp\/v2\/license?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}