Professional Documents
Culture Documents
Multiplication:
Sequential Shift/Add-Method
Method to avoid adder arrays
0
0 1
+0 1 1
0 1 0 0
0
1
0
0
1
0
1
1
1
1
0
0
1 0
0 1
1 0
0
Sum:
00000110
00000110
00011110
01001110
Product
1 1 0
Multiplicand
Bits:
4:4
6 13 = 78
Example 1:
Product
Multiplier
Test = 1
4:4
5:3
ADD
Shift
6:2
6:2
7:1
7:1
8:0
Test = 0
Shift
NOADD
Test = 1
ADD
Shift
Test = 1
ADD
Shift
DONE!
219
220
15 13 = 195
Example 2:
1
Multiplicand
Carry
Product
Multiplier
Test = 1
ADD
Test = 0 NOADD
Shift with carry
Test = 1
ADD
Test = 1
ADD
Sequential Shift/Add-Method
1. Load multiplier into lower half of shift
register (the upper half is to be zeroed)
2. test LSB of the shift register
3. if LSB is set
then add multiplicand to the upper
half of the shift register
else add nothing (make sure carrybit is cleared!)
4. perform right shift including carry on full
shift register
5. repeat from 2. as long as multiplier part of
shift register is not empty
6. after termination, the shift register (both
halves!) contains the product
221
Signed Multiplication
Sign and magnitude representation:
Calculate unsigned product as
|p| = |x| |y|
p0(2n2) = x0(n2) y0(n2)
determine sign separately as
sgn(p) = sgn(x) sgn(y)
DONE!
222
223
224
Example:
Multiplicand:
Disadvantages:
Booth Algorithm
Unsigned
0 1 0 1
1s complement 1 0 1 0
2s complement 1 0 1 1
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
1
1
0
1
1
0
1
0
0
1
0
0
0
0
0
Multiplicand
Multiplier
0000 x1011
0010 x1011
0100 x1011
0000 x1011
1 1 1 1 1 0 0
(carry)
1 1 1 0 0 0 1 0
Product
26
0
+1
25
1
0
24
1
0
23
1
1
22
0
0
25 + 24 + 23 = 32 + 16 + 8
= 56
26 23 = 64 8
= 56
228
Booth Recoding
20
0
0
229
01000000 (64)
00001000 (8)
00111000 (56)
This method works equally well for both unsigned and 2s complement representations
226
Booth Recoding
27
0
0
225
1
0
0
0
1
0
227
230
1
1
0
2
1
1
1
1
0
0
231
0
0
0
2
0
2
1
1
1
1
0
0
1
1
0
1
1
0
0
0
1
For the sequential shift/add hardware, bitpairing reduces the summation effort substantially, with or without Booth recoding
1
0
0
0
1
1
0
232
Good multiplier:
0
0
0
0
1
1
1
Ordinary multiplier:
1
1
0
0
0
2
1
1
3. End of a 1s-sequence:
0
0
0
+2
Worst-case multiplier:
0
1
0
1
0
+1
2. Begin of a 1s-sequence:
1
1
0
1
1
1
1 +1
1
0 1
1
0
0
+1 1
+1
1
1
0
0
1
0
1
1
1. Within a sequence:
0 +1
+1
1
1
233