Computer Arithmetic

a carry-lookahead adder

A ripple-carry adder is like a line of people passing a baton: column 0 must finish before column 1 can start, which must finish before column 2, all the way up. For a 64-bit add the carry has to ripple through 64 stages one after another, and the worst-case delay grows with the width. A carry-lookahead adder asks a sharper question: instead of waiting to be told the carry, can each column figure out for itself whether a carry will arrive, by looking ahead at all the lower bits at once?

The trick is two signals per column. A column generates a carry if both its input bits are 1 (then it makes a carry no matter what comes in): generate g = a AND b. A column propagates an incoming carry if at least one input bit is 1 (then a carry that arrives passes straight through): propagate p = a OR b. From these, the carry into column i is: it was generated somewhere below, or it was generated lower and propagated all the way up through every column in between. Because g and p depend only on the input bits — not on the carry — the hardware can compute all the carries in parallel with a tree of AND and OR gates, in a delay that grows like the logarithm of the width rather than linearly. The columns stop waiting in line and look the carry up directly.

This is the textbook example of spending gates to buy speed: a lookahead adder uses far more logic than a ripple adder and burns more area and power, but it is dramatically faster on wide words, which is why it sits on the critical path of real ALUs. In practice designers build it hierarchically — small 4-bit lookahead blocks combined by a second lookahead layer — and the carry-select and parallel-prefix adders are cousins that make different points on the same speed-versus-area tradeoff.

Carry into column 3 = g2 OR (p2 AND g1) OR (p2 AND p1 AND g0) OR (p2 AND p1 AND p0 AND carry-in). Every term uses only the input-derived g and p bits, so all four carries can be evaluated at once instead of rippling.

Generate and propagate let every carry be computed in parallel from the input bits.

Lookahead does not make a single add 'instant' — it trades a roughly linear delay for a roughly logarithmic one at the cost of much more logic. Past a few bits the full flat lookahead gets too large, so real adders are built in hierarchical blocks.

Also called
CLAcarry look-ahead adder超前進位加法器