- Source: Dadda multiplier
The Dadda multiplier is a hardware binary multiplier design invented by computer scientist Luigi Dadda in 1965. It uses a selection of full and half adders to sum the partial products in stages (the Dadda tree or Dadda reduction) until two numbers are left. The design is similar to the Wallace multiplier, but the different reduction tree reduces the required number of gates (for all but the smallest operand sizes) and makes it slightly faster (for all operand sizes).
Dadda and Wallace multipliers have the same three steps for two bit strings
w
1
{\displaystyle w_{1}}
and
w
2
{\displaystyle w_{2}}
of lengths
ℓ
1
{\displaystyle \ell _{1}}
and
ℓ
2
{\displaystyle \ell _{2}}
respectively:
Multiply (logical AND) each bit of
w
1
{\displaystyle w_{1}}
, by each bit of
w
2
{\displaystyle w_{2}}
, yielding
ℓ
1
⋅
ℓ
2
{\displaystyle \ell _{1}\cdot \ell _{2}}
results, grouped by weight in columns
Reduce the number of partial products by stages of full and half adders until we are left with at most two bits of each weight.
Add the final result with a conventional adder.
As with the Wallace multiplier, the multiplication products of the first step carry different weights reflecting the magnitude of the original bit values in the multiplication. For example, the product of bits
a
n
b
m
{\displaystyle a_{n}b_{m}}
has weight
n
+
m
{\displaystyle n+m}
.
Unlike Wallace multipliers that reduce as much as possible on each layer, Dadda multipliers attempt to minimize the number of gates used, as well as input/output delay. Because of this, Dadda multipliers have a less expensive reduction phase, but the final numbers may be a few bits longer, thus requiring slightly bigger adders.
Description
To achieve a more optimal final product, the structure of the reduction process is governed by slightly more complex rules than in Wallace multipliers.
The progression of the reduction is controlled by a maximum-height sequence
d
j
{\displaystyle d_{j}}
, defined by:
d
1
=
2
{\displaystyle d_{1}=2}
, and
d
j
+
1
=
floor
(
1.5
d
j
)
.
{\displaystyle d_{j+1}=\operatorname {floor} (1.5d_{j}).}
This yields a sequence like so:
d
1
=
2
,
d
2
=
3
,
d
3
=
4
,
d
4
=
6
,
d
5
=
9
,
d
6
=
13
,
…
{\displaystyle d_{1}=2,d_{2}=3,d_{3}=4,d_{4}=6,d_{5}=9,d_{6}=13,\ldots }
The initial value of
j
{\displaystyle j}
is chosen as the largest value such that
d
j
<
min
(
n
1
,
n
2
)
{\displaystyle d_{j}<\min {(n_{1},n_{2})}}
, where
n
1
{\displaystyle n_{1}}
and
n
2
{\displaystyle n_{2}}
are the number of bits in the input multiplicand and multiplier. The lesser of the two bit lengths will be the maximum height of each column of weights after the first stage of multiplication. For each stage
j
{\displaystyle j}
of the reduction, the goal of the algorithm is the reduce the height of each column so that it is less than or equal to the value of
d
j
{\displaystyle d_{j}}
.
For each stage from
,
…
,
1
{\displaystyle ,\ldots ,1}
, reduce each column starting at the lowest-weight column,
c
0
{\displaystyle c_{0}}
according to these rules:
If
height
(
c
i
)
⩽
d
j
{\displaystyle \operatorname {height} (c_{i})\leqslant d_{j}}
the column does not require reduction, move to column
c
i
+
1
{\displaystyle c_{i+1}}
If
height
(
c
i
)
=
d
j
+
1
{\displaystyle \operatorname {height} (c_{i})=d_{j}+1}
add the top two elements in a half-adder, placing the result at the bottom of the column and the carry at the bottom of column
c
i
+
1
{\displaystyle c_{i+1}}
, then move to column
c
i
+
1
{\displaystyle c_{i+1}}
Else, add the top three elements in a full-adder, placing the result at the bottom of the column and the carry at the bottom of column
c
i
+
1
{\displaystyle c_{i+1}}
, restart
c
i
{\displaystyle c_{i}}
at step 1
Algorithm example
The example in the adjacent image illustrates the reduction of an 8 × 8 multiplier, explained here.
The initial state
j
=
4
{\displaystyle j=4}
is chosen as
d
4
=
6
{\displaystyle d_{4}=6}
, the largest value less than 8.
Stage
j
=
4
{\displaystyle j=4}
,
d
4
=
6
{\displaystyle d_{4}=6}
height
(
c
0
⋯
c
5
)
{\displaystyle \operatorname {height} (c_{0}\cdots c_{5})}
are all less than or equal to six bits in height, so no changes are made
height
(
c
6
)
=
d
4
+
1
=
7
{\displaystyle \operatorname {height} (c_{6})=d_{4}+1=7}
, so a half-adder is applied, reducing it to six bits and adding its carry bit to
c
7
{\displaystyle c_{7}}
height
(
c
7
)
=
9
{\displaystyle \operatorname {height} (c_{7})=9}
including the carry bit from
c
6
{\displaystyle c_{6}}
, so we apply a full-adder and a half-adder to reduce it to six bits
height
(
c
8
)
=
9
{\displaystyle \operatorname {height} (c_{8})=9}
including two carry bits from
c
7
{\displaystyle c_{7}}
, so we again apply a full-adder and a half-adder to reduce it to six bits
height
(
c
9
)
=
8
{\displaystyle \operatorname {height} (c_{9})=8}
including two carry bits from
c
8
{\displaystyle c_{8}}
, so we apply a single full-adder and reduce it to six bits
height
(
c
10
⋯
c
14
)
{\displaystyle \operatorname {height} (c_{10}\cdots c_{14})}
are all less than or equal to six bits in height including carry bits, so no changes are made
Stage
j
=
3
{\displaystyle j=3}
,
d
3
=
4
{\displaystyle d_{3}=4}
height
(
c
0
⋯
c
3
)
{\displaystyle \operatorname {height} (c_{0}\cdots c_{3})}
are all less than or equal to four bits in height, so no changes are made
height
(
c
4
)
=
d
3
+
1
=
5
{\displaystyle \operatorname {height} (c_{4})=d_{3}+1=5}
, so a half-adder is applied, reducing it to four bits and adding its carry bit to
c
5
{\displaystyle c_{5}}
height
(
c
5
)
=
7
{\displaystyle \operatorname {height} (c_{5})=7}
including the carry bit from
c
4
{\displaystyle c_{4}}
, so we apply a full-adder and a half-adder to reduce it to four bits
height
(
c
6
⋯
c
10
)
=
8
{\displaystyle \operatorname {height} (c_{6}\cdots c_{10})=8}
including previous carry bits, so we apply two full-adders to reduce them to four bits
height
(
c
11
)
=
6
{\displaystyle \operatorname {height} (c_{11})=6}
including previous carry bits, so we apply a full-adder to reduce it to four bits
height
(
c
12
⋯
c
14
)
{\displaystyle \operatorname {height} (c_{12}\cdots c_{14})}
are all less than or equal to four bits in height including carry bits, so no changes are made
Stage
j
=
2
{\displaystyle j=2}
,
d
2
=
3
{\displaystyle d_{2}=3}
height
(
c
0
⋯
c
2
)
{\displaystyle \operatorname {height} (c_{0}\cdots c_{2})}
are all less than or equal to three bits in height, so no changes are made
height
(
c
3
)
=
d
2
+
1
=
4
{\displaystyle \operatorname {height} (c_{3})=d_{2}+1=4}
, so a half-adder is applied, reducing it to three bits and adding its carry bit to
c
4
{\displaystyle c_{4}}
height
(
c
4
⋯
c
12
)
=
5
{\displaystyle \operatorname {height} (c_{4}\cdots c_{12})=5}
including previous carry bits, so we apply one full-adder to reduce them to three bits
height
(
c
13
⋯
c
14
)
{\displaystyle \operatorname {height} (c_{13}\cdots c_{14})}
are all less than or equal to three bits in height including carry bits, so no changes are made
Stage
j
=
1
{\displaystyle j=1}
,
d
1
=
2
{\displaystyle d_{1}=2}
height
(
c
0
⋯
c
1
)
{\displaystyle \operatorname {height} (c_{0}\cdots c_{1})}
are all less than or equal to two bits in height, so no changes are made
height
(
c
2
)
=
d
1
+
1
=
3
{\displaystyle \operatorname {height} (c_{2})=d_{1}+1=3}
, so a half-adder is applied, reducing it to two bits and adding its carry bit to
c
3
{\displaystyle c_{3}}
height
(
c
3
⋯
c
13
)
=
4
{\displaystyle \operatorname {height} (c_{3}\cdots c_{13})=4}
including previous carry bits, so we apply one full-adder to reduce them to two bits
height
(
c
14
)
=
2
{\displaystyle \operatorname {height} (c_{14})=2}
including the carry bit from
c
13
{\displaystyle c_{13}}
, so no changes are made
Addition
The output of the last stage leaves 15 columns of height two or less which can be passed into a standard adder.
See also
Booth's multiplication algorithm
Fused multiply–add
Wallace tree
BKM algorithm for complex logarithms and exponentials
Kochanski multiplication for modular multiplication
References
Further reading
Savard, John J. G. (2018) [2006]. "Advanced Arithmetic Techniques". quadibloc. Archived from the original on 2018-07-03. Retrieved 2018-07-16.