blob: 455d885d3727941d2a3b0c56c3f26c7206842f0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
Booth:
result = multiplier << 1
loop (operand length) times:
if last two bits are 01:
result(upper half) += multiplicand
if last two bits are 10:
result(upper half) += twos_comp(multiplicand)
remove extra bits from result
arithmatic shift result right
result >> 1
Modified booth:
multiplicand(MSB) = multiplicand(second MSB)
result = multiplier << 1
loop (operand length / 2) times:
if last two bits are 001 or 010:
result(upper half) += multiplicand
if last two bits are 011:
result(upper half) += multiplicand * 2
if last two bits are 100:
result(upper half) += twos_comp(multiplicand) * 2
if last two bits are 101 or 110:
result(upper half) += twos_comp(multiplicand)
remove extra bits from result
arithmatic shift result right twice
result >> 1
result(second MSB) = result(MSB)
result(MSB) = 0
|