Professional Documents
Culture Documents
Parallel Prefix Adders Presentation PDF
Parallel Prefix Adders Presentation PDF
adders
Input is a vector:
A = AnAn-1 … A1
B1 = A1
B2 = A1 * A2
B3 = A1 * A1 * A3
…
Because the summation is associative the calculation can be done in parallel in the
following manner:
Parallel implementation versus Serial implementation
6 5 4 3 2 1 6 5 4 3 2 1
+ + + +
+ +
B = (A + A +3A3
B6 =3B
A61 = A1
2+… A =+ A
111 +
+A 12)
2 =
= (A6 + A+5) +
+ + =6 ((A
+ 4+A3) +(A2 +A1))
+= 21
B6 B5 B4 B3 B2 B1 B6 B5 B4 B3 B2 B1
Binary Addition This is the pen and paper addition of
two 4-bit binary numbers x and y.
c represents the generated carries.
s represents the produced sum bits.
c3 c2 c1 c0
x3 x2 x1 x0 A stage of the addition is the set of
+ x and y bits being used to produce
y3 y2 y1 y0 the appropriate sum and carry bits.
s4 s3 s2 s1 s0 For example the highlighted bits x2,
y2 constitute stage 2 which
generates carry c2 and sum s2 .
Each stage i adds bits ai, bi, ci-1 and produces bits si, ci
The following hold:
ci = g i + pi ⋅ ci −1 = xi ⋅ yi + ( xi ⊕ yi ) ⋅ ci −1
ci = xi ⋅ yi + ( xi + yi ) ⋅ ci −1 = g i + ai ⋅ ci −1
This equation can be simplified to:
ai = k i
Where ki is the “kill” bit defined in the table above.
Carry Look Ahead adders
The CLA adder has the following 3-stage structure:
Final sum.
Carry Look Ahead adders
The pre-calculation stage is implemented using the
equations for pi, gi shown at a previous slide:
x2y2 x1y1 x0y0
g2 p2 g1 p1 g0 p0
g2 a2 g1 a1 g0 a0
Note the symmetry when we use the “propagate” or the “alive” bit… We can use them interchangeably in the equations!
Carry Look Ahead adders
The carry calculation stage is implemented using the
equations produced when unfolding the recursive
equation:
ci = g i + pi ⋅ ci −1 = g i + ai ⋅ ci −1
s3 s2 s1 s0
If the ‘alive’ bit ai is used the final sum stage becomes more complex
as implied by the equations above.
Binary addition as a prefix sum problem.
We define a new operator: “ ° ”
Input is a vector of pairs of ‘propagate’ and ‘generate’ bits:
(g n , pn )(g n−1 , pn−1 )K (g 0 , p0 )
Output is a new vector of pairs:
(Gn , Pn )(Gn−1 , Pn−1 )K (G0 , P0 )
Each pair of the output vector is calculated by the
following definition:
(Gi , Pi ) = ( g i , pi ) o (Gi −1 , Pi −1 )
Where :
(G0 , P0 ) = ( g 0 , p0 )
( g x , px ) o ( g y , p y ) = ( g x + px ⋅ g y , px ⋅ p y )
with +,⋅ being the OR, AND operations
Binary addition as a prefix sum problem.
Properties of operator “ ° ”:
Associativity (hence parallelization)
Easy to prove based on the fact that the logical AND,
OR operations are associative.
With the definition:
(Gi , Pi ) = ( g i , pi ) o (Gi −1 , Pi −1 )
Where (G1 , P1 ) = ( g1 , p1 )
Gi becomes the carry signal at stage i of an adder. Illustration on
next slide.
With : Where :
(Gi , Pi ) = ( g i , pi ) o (Gi −1 , Pi −1 ) (G0 , P0 ) = ( g 0 , p0 )
( g x , px ) o ( g y , p y ) = ( g x + px ⋅ g y , px ⋅ p y )
… The familiar
We have : carry bit generating
(G1 , P1 ) = ( g1 , p1 ) equations for stage i
(G2 , P2 ) = ( g 2 , p2 ) o (G1 , P1 ) = ( g 2 + p2 ⋅ g1 , p2 ⋅ p1 ) in a CLA adder.
(G3 , P3 ) = ( g 3 , p3 ) o (G2 , P2 ) = ( g 3 + p3 ⋅ ( g 2 + p2 ⋅ g1 ), p3 ⋅ p2 ⋅ p1 )
= ( g 3 + p3 ⋅ g 2 + p3 ⋅ p2 ⋅ g1 ), p3 ⋅ p2 ⋅ p1 )
etc K
Addition as a prefix sum problem.
Conclusion:
The equations of the well known CLA adder can be formulated as a parallel
prefix problem by employing a special operator “ ° ”.
A Parallel Prefix Adder (PPA) is equivalent to the CLA adder… The two
differ in the way their carry generation block is implemented.
c8 c7 c6 c5 c4 c3 c2 c1
Key architectures for carry calculation:
1960: J. Sklansky – conditional adder
1973: Kogge-Stone adder
1980: Ladner-Fisher adder
1982: Brent-Kung adder
1987: Han Carlson adder
1999: S. Knowles
c8 c7 c6 c5 c4 c3 c2 c1
c8 c7 c6 c5 c4 c3 c2 c1
c8 c7 c6 c5 c4 c3 c2 c1
c8 c7 c6 c5 c4 c3 c2 c1
c8 c7 c6 c5 c4 c3 c2 c1
Kogge, Stone, “A Parallel Algorithm for the Efficient solution of a General Class of Recurrence equations”, IEEE, 1973