2. Method 1
Accomplished by shifting and
addition
If LSB of multiplier(Q) is 0
shift B to 1 bit left
Shift Q to 1 bit right
If LSB of Q is 1
Add B to A
shift B to 1 bit left
Shift Q to 1 bit right
Stop when Q become 0 and A
stores the final prodct
Multiplication
1101 (multiplicand)
1011 (multiplier)x
1101
1101
10001111
Dr. Prasenjit Dey11-01-2021 2
0000
1101
Let, 13x11 = (1101 x 1011)
multiplier = Q = 1011
multiplicand = B = 1101
partial product = A = 0000 (Initial value)
3.
Dr. Prasenjit Dey
Method 1: Example
Steps Action A Q B
Step 0 Initialization 0000 0000 1011 0000 1101
Step 1 Add B to A, SHL
B, SHR Q
0000 0000 + 0000 1101 =
0000 1101
0101 0001 1010
11-01-2021 3
Step 2 Add B to A, SHL
B, SHR Q
0000 1101+0001 1010
= 0010 0111
0010 0011 0100
Step 3 SHL B, SHR Q 0010 0111 0001 0110 1000
Step 4
Add B to A, SHL
B, SHR Q
0010 0111 + 0110 1000
= 1000 1111
0000 1101 0000
Drawback:
• n bit operand needs 2n bit ALU
• Multiplicand modifies in each iteration
4.
Method 2
Dr. Prasenjit Dey11-01-2021 4
Algorithm
Step 1: Initialize
Q = multiplier, B = multiplicand, A = partial product = 0, count = size(Q), E = initial carry
= 0,
Step 2:
If LSB of multiplier(Q) is 0
Shift EAQ to 1 bit right
If LSB of Q is 1
Add B to A
Shift EAQ to 1 bit right
Count = count -1
Step 3:
Repeat Step 2 until count becomes 0
5.
Dr. Prasenjit Dey
Method 2: Example
Steps Action E A Q B
Step 0 Initialization 0 0000 1011 1101
Step 1
Add B to A 0 (0000+1101) = 1101 1011 1101
Shift right EAQ 0 0110 1101 1101
11-01-2021 5
Step 2
Add B to A 1 (0110+1101) = 0011 1101 1101
Shift right EAQ 0 1001 1110 1101
Step 3 Shift right EAQ 0 0100 1111 1101
Step 4
Add B to A 1 (0100+1101) = 0001 1111 1101
Shift right EAQ 0 1000 1111 1101
6.
Multiplication:
Implementation
Control
testWrite
32 bits
64 bits
Shift right
Product
Multiplicand
32-bit ALU
Done
1. Test
Product0
1a. Add multiplicand to the left half of
the product and place the result in
the left half of the Product register
2. Shift the Product register right 1 bit
32nd repetition?
Start
Product0 = 0Product0 = 1
No: < 32 repetitions
Yes: 32 repetitions
Dr. Prasenjit Dey11-01-2021 6
7.
Booth’s Algorithm
Constraints:
Need twice as many bits in the product as in the original two operands.
If z = x*y then, size(z) = 2*max(size(x),size(y))
The leftmost bit of the operands is a SIGN bit, and cannot be used as part of the value
Initialization:
Convert both multiplier and multiplicand to two's complement representation using k
bits
k must be at least one more bit than is required for the binary representation of the numerically
larger operand
size(k) = 1+ max(size(x),size(y))
Begin with a product that consists of the multiplier with an additional k leading zero
bits
Dr. Prasenjit Dey11-01-2021 7
8.
Conditions
Use the LSB (least significant bit) and the previous LSB of multiplier to
determine the arithmetic action.
In the FIRST pass, use 0 as the previous LSB.
Possible arithmetic actions for (LSB & previous LSB) pair:
00 no arithmetic operation
01 add multiplicand to left half of product
10 subtract multiplicand from left half of product
11 no arithmetic operation
Lets multiply: -5x14
Multiplier (Q) = -5 => (11011)2 in 2’s complement
Multiplicand (M) = 14 = > (01110)2
-M = - 14 = (10010)2 in 2’s complement
Dr. Prasenjit Dey11-01-2021 8