Content deleted Content added
No edit summary |
|||
Line 6:
* Add a 0 to the right of the multiplier.
*
*# If the two rightmost bits are...
*#* 00 or 11: do nothing.
*#* 01: add the multiplicand to the left half of the multiplier. Ignore any overflow.
*#* 10: add the negative of the multiplicand to the left half of the multiplier. Ignore any overflow.
*# Perform
* Remove the rightmost bit from the multiplicand.
==Example==
We wish to multiply 3 * -4:
* The multiplicand, 3, is 0011; its negative is 1101.
* The multiplier, -4, is 1100; with all zeroes added, it is 000011000.
## 0000 110'''0 0''' (check performed)
## 0000 110'''0 0''' (did nothing)
Line 37 ⟶ 33:
## 1110 100'''1 1''' (did nothing)
## 1111 010'''0 1''' (ashift-right performed [4/4])
* The result is 11110100<s>0</s>, which is -12.
==Why does Booth's Algorithm work ?==
|