Carry Lookahead Generation
Motivation
The ripple carry adder is slow because carry bit must be computed before can be computed. The insight behind carry lookahead is that all carries can be generated directly from the inputs, without waiting for the ripple chain, by evaluating the logical conditions for a carry to arise.
Generate, propagate, and kill
For a single bit position with inputs and , three mutually exclusive conditions determine whether a carry-out is produced:
- Carry generate : both bits are 1, so a carry-out is always produced regardless of the carry-in. The column “generates” a carry.
- Carry propagate : exactly one of the bits is 1, so a carry-out is produced if and only if the carry-in is 1. The column “propagates” the incoming carry.
- Carry kill : both bits are 0, so no carry-out is produced regardless of the carry-in.
Note that is the standard definition in this course. Some texts define (the “propagate if either is 1”), which gives different equations but equivalent results when used with appropriate generate definitions.
Carry recurrence
The fundamental recurrence for the carry chain is:
In words: column i produces a carry-out if it generates one, OR if it propagates the incoming carry. This is exactly the expression derived from the full adder truth table: cout = a·b + (a⊕b)·cin.
Unrolling the recurrence
By substituting repeatedly, every carry is expressed directly in terms of the primary inputs , , and :
Pattern: is the OR of its own generate, OR the propagate AND each lower generate, OR the propagate of all lower positions AND .
Two-level logic
Each carry equation is a sum-of-products expression in the primary inputs (the and are themselves functions of , ). Implementing these equations directly gives a two-level AND-OR circuit for each carry.
The critical path from inputs to any carry is:
- 1 gate delay to compute and from , .
- 1 gate delay for the AND plane (computing product terms like ).
- 1 gate delay for the OR plane (combining product terms).
Total: 3 gate delays, independent of n. This is a dramatic improvement over the O(n) ripple delay.
Practical limitations
Two problems arise for large n:
- Fan-in: requires an OR gate with
n+1inputs and AND gates with up toninputs. Gates with high fan-in are slow and physically large. - Fan-out: Early and signals must fan out to many subsequent carry equations.
In practice, carry lookahead is applied in blocks of 4 bits, with ripple between blocks. Alternatively, a second level of lookahead (block generate G = g3 + p3·g2 + p3·p2·g1 + p3·p2·p1·g0 and block propagate P = p3·p2·p1·p0) creates a two-level hierarchy.
Sum computation
Once the carries are known, each sum bit is:
The carries and sums can be computed in parallel, yielding the full addition result in O(1) gate delays from the inputs.