Wallace_Tree
Wallace_Tree
3 Carry–save addition:
A carry–lookahead adder can add two n–bit numbers in O(lg n) time. Perhaps
surprisingly, adding three n–bit numbers takes only a constant additional
amount of time. The trick is to reduce the problem of adding three numbers to
the problem of adding just two numbers.
u + v = x + y + z.
Since the computations of all 2n + 1 output bits are independent, they can be
performed in parallel. Thus, a carry–save adder operates in (1) time and
has (n) size. To sum three n–bit numbers, therefore, we need only perform a
carry–save addition, taking (1) time, and then perform a carry–lookahead
addition, taking O(lg n) time. Although this method is not asymptotically better
than the method of using two carry–lookahead additions, it is much faster in
practice.
Figure 29.11 (a) Carry–save addition. Given three n–bit numbers x, y, and z,
we produce an n–bit number u and an (n + 1) –bit number v such that x + y +
z = u + v. The ith pair of shaded bits are a function of xi, yi, and zi. (b) An 8–bit
carry–save adder. Each full adder FAi takes inputs xi, yi, and zi and produces
sum bit ui and carry–out bit vi + 1. Bit v0 is hardwired to 0.
Exercises
29.2-1
Let a = 01111111 , b = 00000001 , and n = 8. Show the sum and carry bits
output by full adders when ripple-carry addition is performed on these two
sequences. Show the carry statuses x0, x1, . . . , x8 corresponding to a and b,
label each wire of the parallel prefix circuit of Figure 29.9 with the value it has
given these xi inputs, and show the resulting outputs y0, y1, . . . , y8.
29.3.2 Wallace–tree multipliers
Figure 29.16 shows a Wallace–tree2 that adds 8 partial products m(0), m(1), . . .
, m(7). Partial product m(1) consists of n + i bits. Each line represents an entire
number, not just a single bit; next to each line is the number of bits the line
represents. The carry–lookahead adder at the bottom adds a (2n – 1)–bit
number to a 2n–bit number to give the 2n–bit product.
2
As you can see from the figure, a Wallace tree is not truly a tree, but rather a
directed acyclic graph. The name is historical.