Advertisement
Madotsuki

Booth's Algorithm

Feb 4th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. 11001
  2. * 10110
  3.  
  4. Look at each pair of bits in the multiplier for addition or subtraction of M, the multiplicand.
  5.  
  6. M:
  7. 10110
  8. _0
  9. First check: 00
  10. Do Nothing.
  11.  
  12. 2M:
  13. 10110
  14. __
  15. Second check: 10
  16. Subtraction.
  17.  
  18. 00000
  19. - 110010 (-2M)
  20.  
  21. Because this is the second check, we have one additional 0 added to the multiplicand.
  22.  
  23. 4M:
  24. 10110
  25. __
  26. Third check: 11
  27. Do nothing.
  28.  
  29. 8M:
  30. 10110
  31. __
  32. Fourth check: 01
  33. Add.
  34.  
  35. 00000
  36. - 110010 (-2M)
  37. + 11001000 (8M)
  38.  
  39. Because this is the fourth check, we have three additional 0's added to the multiplicand.
  40.  
  41. 16M:
  42. 10110
  43. __
  44. Fifth check: 10
  45. Subtract.
  46. 00000
  47. - 110010 (-2M)
  48. + 11001000 (8M)
  49. - 110010000 (-16M)
  50.  
  51. Because this is the fifth check, we have four additional 0's added to the multiplicand.
  52.  
  53. Now add them all together.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement