next up previous
Next: An Alternative Carry Lookahead Up: Fast Addition of Integers Previous: Fast Addition of Integers

Traditional Carry Lookahead Analysis

A carry signal setting $carry_i$ can be generated at bit $i$ or any previous bit as long as all the bits in between propagate the signal. Using this formula, we can build a circuit of logarithmic depth. The $g$ and $p$ bits can be constructed with depth $1$ and $3$ respectively. Each AND subterm of the carry expressions has at most $n$ components adding at most $\left\lceil \lg n \right\rceil$ depth. Each carry formula has at most $n$ subterms adding at most $\left\lceil \lg n \right\rceil$ depth. Therefore, the total depth is at most $3 + 2 \left\lceil \lg n \right\rceil$. As described so far, this gives a circuit of cubic size (proportional to $n^3$) since the $n$ carry formulas can have quadratic size.

We can shrink the circuit to quadratic size by introducing sharing of common subexpressions. Instead of checking whether a particular bit propagates or generates a carry bit, we check whether a sequence of consecutive bits propagates or generates a carry bit. In fact, all of these terms are already exist in some form in the circuit described so far. We can give a new recursive formulation of the propagate bits in this light.

\begin{eqnarray*}
P_{i,i} & = & p_i \\
P_{i,j} & = & P_{i,(i+j)/2} \land P_{(i+...
... (P_{i,(i+j)/2} \land G_{(i+j)/2+1,j}) \\
c_i & = & G_{0,i} \\
\end{eqnarray*}



This recursive formulation preserves the logarithmic depth but gives a clear way to share subterms. There are fewer than $n^2$ different $P$ and $G$ terms ($i$ and $j$ are restricted to $0 \ldots
n-1$) so the circuit size is now quadratic. This is the carry-lookahead adder. Note that the $P$ and $G$ terms described here are not exactly the same as those used in the book.


next up previous
Next: An Alternative Carry Lookahead Up: Fast Addition of Integers Previous: Fast Addition of Integers
Jeffrey Considine 2001-05-01