Booths Multiplication Algorithm

45,931 views

Published on

Booth's multiplication algorithm

Published in: Business, Technology
3 Comments
5 Likes
Statistics
Notes
  • goodd
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Thats why I always recommend slideshare
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • It is really helpful
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
45,931
On SlideShare
0
From Embeds
0
Number of Embeds
147
Actions
Shares
0
Downloads
1,196
Comments
3
Likes
5
Embeds 0
No embeds

No notes for slide

Booths Multiplication Algorithm

  1. 1. BOOTH'S MULTIPLICATION ALGORITHM
  2. 2. INTRODUCTION <ul><li>History </li></ul><ul><li>Procedure </li></ul><ul><li>Example </li></ul>
  3. 3. HISTORY <ul><li>在 1951 年時, Andrew D. Booth 在倫敦的 Bloomsbury 區的 Birkbeck 學院研究結晶學的時候發明的。 </li></ul><ul><li>Booth 創造了這個運算法增加計算機運算加法位移的速度。 </li></ul><ul><li>這個算法對電腦運算結構有很大的幫助。 </li></ul>
  4. 4. PROCEDURE <ul><li>If x is the count of bits of the multiplicand, and y is the count of bits of the multiplier : </li></ul><ul><li>Draw a grid of three rows, each with columns for x + y + 1 bits. Label the lines respectively A (add), S (subtract), and P (product). </li></ul>
  5. 5. <ul><li>In two’s complement notation, fill the first x bits of each line with : </li></ul><ul><ul><li>A: the multiplicand </li></ul></ul><ul><ul><li>S: the negative of the multiplicand </li></ul></ul><ul><ul><li>(in 2's complement format) </li></ul></ul><ul><ul><li>P: zeroes </li></ul></ul><ul><li>Fill the next y bits of each line with : </li></ul><ul><ul><li>A: zeroes </li></ul></ul><ul><ul><li>S: zeroes </li></ul></ul><ul><ul><li>P: the multiplier </li></ul></ul><ul><li>Fill the last bit of each line with a zero. </li></ul>
  6. 6. Find 3 × -4, with x = 4 and y = 4: A = 0011 0000 0 S = 1101 0000 0 P = 0000 1100 0 x y 1 A multiplicand zeroes 0 S negative of the multiplicand zeroes 0 P zeroes multiplier 0
  7. 7. <ul><li>Do both of these steps y times : </li></ul><ul><ul><li>1. If the last two bits in the product are... </li></ul></ul><ul><ul><ul><li>00 or 11: do nothing. </li></ul></ul></ul><ul><ul><ul><li>01: P = P + A. Ignore any overflow. </li></ul></ul></ul><ul><ul><ul><li>10: P = P + S. Ignore any overflow. </li></ul></ul></ul><ul><ul><li>2. Arithmetically shift the product right one position. </li></ul></ul><ul><li>Drop the first (we count from right to left when dealing with bits) bit from the product for the final result. </li></ul>
  8. 8. The last two bits do 00 do nothing 01 P = P + A. Ignore any overflow 10 P = P + S. Ignore any overflow. 11 do nothing
  9. 9. EXAMPLE 1 <ul><li>Find 3 × -4, with x = 4 and y = 4: </li></ul><ul><li>A = 0011 0000 0 </li></ul><ul><li>S = 1101 0000 0 </li></ul><ul><li>P = 0000 1100 0 </li></ul><ul><li>Perform the loop four times : </li></ul><ul><ul><li>P = 0000 110 0 0 . The last two bits are 00. </li></ul></ul><ul><ul><li>P = 0000 0110 0. A right shift. </li></ul></ul><ul><ul><li>P = 0000 011 0 0 . The last two bits are 00. </li></ul></ul><ul><ul><li> P = 0000 0011 0. A right shift. </li></ul></ul>
  10. 10. <ul><ul><li>P = 0000 001 1 0 . The last two bits are 10 . </li></ul></ul><ul><ul><ul><li>P = 1101 0011 0 . P = P + S . </li></ul></ul></ul><ul><ul><ul><li>P = 1 110 1001 1. A right shift. </li></ul></ul></ul><ul><ul><li>P = 1110 100 1 1 . The last two bits are 11. </li></ul></ul><ul><ul><ul><li>P = 1111 0100 1. A right shift. </li></ul></ul></ul><ul><li>The product is 1111 0100, which is -12. </li></ul>
  11. 11. EXAMPLE 2 <ul><li>A = 1 1000 0000 0 </li></ul><ul><li>S = 0 1000 0000 0 </li></ul><ul><li>P = 0 0000 0010 0 </li></ul><ul><li>Perform the loop four times : </li></ul><ul><ul><li>P = 0 0000 0010 0. The last two bits are 00. </li></ul></ul><ul><ul><ul><li>P = 0 0000 0001 0. Right shift. </li></ul></ul></ul>we demonstrate the improved technique by multiplying -8 by 2 using 4 bits for the multiplicand and the multiplier:
  12. 12. <ul><ul><li>P = 0 0000 000 1 0 . The last two bits are 10 . </li></ul></ul><ul><ul><ul><li>P = 0 1000 000 1 0 . P = P + S . </li></ul></ul></ul><ul><ul><ul><li>P = 0 0100 0000 1. Right shift. </li></ul></ul></ul><ul><ul><li>P = 0 0100 000 0 1 . The last two bits are 01 . </li></ul></ul><ul><ul><ul><li>P = 1 1100 000 0 1 . P = P + A . </li></ul></ul></ul><ul><ul><ul><li>P = 1 1110 0000 0. Right shift. </li></ul></ul></ul><ul><ul><li>P = 1 1110 0000 0 . The last two bits are 00. </li></ul></ul><ul><ul><ul><li>P = 1 1111 0000 0. Right shift. </li></ul></ul></ul><ul><li>The product is 11110000 (after discarding the first and the last bit) which is -16. </li></ul>
  13. 13. EXAMPLE 3 <ul><li>Find -11 × -4, with x = 4 and y = 4: </li></ul><ul><li>A = 1 0101 0000 0 </li></ul><ul><li>S = 0 1011 0000 0 </li></ul><ul><li>P = 0 0000 1100 0 </li></ul><ul><li>Perform the loop four times : </li></ul><ul><ul><li>P = 0 0000 1100 0 The last two bits are 00. </li></ul></ul><ul><ul><ul><li>P = 0 0000 0110 0 Right shift. </li></ul></ul></ul><ul><ul><li>P = 0 0000 0110 0. The last two bits are 00. </li></ul></ul><ul><ul><ul><li>P = 0 0000 0011 0 Right shift. </li></ul></ul></ul>
  14. 14. <ul><ul><li>P = 0 0000 001 1 0 The last two bits are 10 . </li></ul></ul><ul><ul><ul><li>P = P + S </li></ul></ul></ul><ul><ul><ul><ul><li>0 0000 0011 0 (P) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>+ 0 1011 0000 0 (S) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>= 0 1011 0011 0 (P+S) </li></ul></ul></ul></ul><ul><ul><ul><li>P = 0 0101 1001 1. Right shift. </li></ul></ul></ul><ul><ul><li>P = 0 0101 1001 1 The last two bits are 11. </li></ul></ul><ul><ul><li> P = 0 0010 1100 1 Right shift. </li></ul></ul><ul><li>The product is 0010 1100 (after discarding the first and the last bit) which is 44. </li></ul>
  15. 15. ORIGINAL INFORMATION <ul><li>http://en.wikipedia.org/wiki/Booth%27s_multiplication_algorithm </li></ul>

×