A carry signal setting
can be generated at bit
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
and
bits can be constructed with depth
and
respectively. Each AND subterm of the carry expressions has at most
components adding at most
depth. Each carry formula has at most
subterms adding at most
depth. Therefore, the total depth is
at most
. As described so far,
this gives a circuit of cubic size (proportional to
) since the
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.
This recursive formulation preserves the logarithmic depth
but gives a clear way to share subterms. There are fewer than
different
and
terms (
and
are restricted to
) so the circuit size is now quadratic. This is the
carry-lookahead adder. Note that the
and
terms
described here are not exactly the same as those used in the book.