↗ Carry LabAN INTERACTIVE FIELD GUIDEDDCA · RISC-V · CHAPTER 5
DIGITAL BUILDING BLOCKS / 01

Same sum.
Different ways to carry.

Addition is easy. Getting the carry to the next bit is the interesting part.
Flip a bit, follow a wire, and see how three adders solve the same problem.

THE IDEA TO KEEP IN MIND

Each bit can generate a carry,
pass it along, or stop it.

Faster adders figure this out in groups.
01 / SET UP AN ADDITION

Your inputs, shared by all three adders

Carry in C₋₁
TRY A PATTERN

Bit 0 generates a carry. Every higher bit passes it along.

02 / FOLLOW THE CARRYSelect any node to inspect it →
G = 1 · generatesG = 0, P = 1 · passesG = P = 0 · stopsNot reached

A walkthrough of logical dependencies, not a clock or gate-delay simulation. All hardware operates continuously; “steps” make its structure visible.

THE SAME ANSWER, EVERY TIME

Unsigned addition · final settled values

03 / MAKE IT CLICK

A three-minute experiment

  1. Start at bit 0. Each next bit needs the previous carry before it can finish.

  2. A group summarizes its behavior with just two signals: G and P. Carries still travel between groups.

  3. In the prefix view, select a group. Its two parents explain exactly which bit ranges it combines.

  4. Ripple adds eight carry dependencies. This prefix network adds just one combine row.

THE BRIDGE BETWEEN ALL THREE

A group behaves like one big bit.

For any contiguous range of bits, two signals are enough to describe what it does to an incoming carry:

Cout = G + P · Cin

G says the range produces a carry even when its input carry is 0. P says all bits in the range have their propagate signal set.

A prefix cell combines the summaries of two neighboring ranges. Repeating this operation builds every low-order prefix: [0:0], [1:0], [2:0], …

Why can the tree replace the chain?

Combining carry summaries is associative: (H ∘ M) ∘ L = H ∘ (M ∘ L). Both generate GH + PHGM + PHPMGL, and both propagate PHPMPL. You can change the grouping, but must preserve the order of the bits.

A note about the book’s notation

We use Harris & Harris’s conventions: Ci is the carry out of bit i, so C−1 is the external carry in. Gi = AiBi and Pi = Ai + Bi. In equations, + means OR, · means AND, and ⊕ means XOR.

With OR-propagate, G and P can both be 1. Generation takes priority: the carry out is then 1 regardless of the carry in. Other texts use XOR-propagate; either convention works for carries. The sum here always uses A ⊕ B ⊕ C, never OR-propagate ⊕ C.

The CLA uses up to four bits per block, with block carries chained together and local ripple sums. The prefix view shows a dense Kogge–Stone network; other prefix layouts may use different wiring while applying the same combine rule.

STRUCTURE, SIDE BY SIDE

These count structural dependencies, not comparable units of time. Actual delay also includes generate/propagate logic, fan-in, wiring, carry-in application, and sum logic. A huge flat lookahead equation is not a free constant-time gate.