3.3.3 · D4Combinational Circuits

Exercises — Carry-lookahead adder

2,999 words14 min readBack to topic

Everything you need in one place:

A picture of what "generate" and "propagate" mean physically — refer back to it whenever the words feel abstract:

Figure — Carry-lookahead adder

Level 1 — Recognition

Can you read the definitions off a bit pattern and spot the vocabulary?

Exercise 1.1

For the single bit position with , , compute and . Does this bit generate, propagate, or kill an incoming carry?

Recall Solution

. (equal bits → XOR is 0). Because , this bit generates a carry no matter what comes in. Because , it does not propagate — an incoming carry is absorbed. (This is the "kill/generate" corner: both inputs 1 always outputs a carry and never forwards the old one.)

Exercise 1.2

Classify each of the four possible pairs as generate (), propagate (), or neither.

Recall Solution
Behaviour
0 0 0 0 kill (never carries)
0 1 0 1 propagate
1 0 0 1 propagate
1 1 1 0 generate
Notice and are never both 1 — the pattern that makes a carry (both 1) is exactly the pattern that stops passing one along. Look at figure s01: the three coloured rows are these three regimes.

Exercise 1.3

Write the recursive carry equation and identify, in words, what each of its two terms does.

Recall Solution

First term : this bit makes a carry on its own. Second term : this bit forwards whatever carry arrived (), but only when it is in propagate mode (). The OR () says "carry out if either happens."


Level 2 — Application

Plug into the formulas and turn a crank.

Exercise 2.1

Add , , using CLA. Give all and the final result.

Recall Solution

Bits (index 0 = rightmost): , .

0 0 1 0 1
1 1 0 0 1
2 1 1 1 0
3 0 0 0 0

Carries by lookahead ():

Sums :

  • , , , .

Result: carry-out , . Check: . ✓

Exercise 2.2

Using the fully-unrolled formula (not the step-by-step recursion), compute for , , .

Recall Solution

From the parent note: . Bits: ; .

  • ,
  • ,
  • ,

. Answer: . (The term dies because blocks it — a propagate chain is only as strong as its weakest link.)

Exercise 2.3

For , , , find and explain in one line why no lower propagate mattered.

Recall Solution

, all other ; . . The carry is generated at bit 3 itself, so nothing below it is consulted — alone forces . Sum , carry-out , i.e. . ✓


Level 3 — Analysis

Reason about structure, delay, and why the algebra behaves as it does.

Exercise 3.1

Prove algebraically that for every bit (generate and propagate can never both be 1), using and .

Recall Solution

(XOR expanded, where = NOT ). . Each product contains a variable ANDed with its complement: in the first, in the second. So . ∎ Meaning: the two signals partition the "carry active" cases cleanly — no double-counting, which is why the OR in is safe.

Exercise 3.2

A 16-bit ripple-carry adder charges 2 gate delays per carry stage (AND then OR). A flat 16-bit CLA needs 1 delay for , then 2 for the AND–OR carry logic, then 1 for the sum XOR. Compute both worst-case delays and the speed-up factor.

Recall Solution

Ripple: worst-case carry travels through all 16 stages gate delays. (Then 1 more for the last sum XOR, but the standard comparison quotes the carry path: .) CLA: gate delays (constant, independent of width). Speed-up . Interpretation: CLA converted an carry path into depth — at the cost of much wider gates (fan-in), which is the price analysed in Propagation Delay & Fan-in.

Exercise 3.3

For a flat -bit CLA, the expression for contains a term with a product of how many propagate signals, and hence what fan-in does the largest AND gate need? Evaluate for .

Recall Solution

The longest term is , a product of propagate signals ANDed with → an AND gate with inputs. The final OR that forms has terms. For : largest AND fan-in inputs; the OR forming has terms. Why this matters: a 9-input gate is already awkward in real silicon, and it grows linearly with . This exploding fan-in is exactly why designers stop at 4-bit blocks and go hierarchical.


Level 4 — Synthesis

Combine block-level generate/propagate to build hierarchy — same math, one level up.

Exercise 4.1

For a 4-bit block with and (i.e. , others 0), compute the group propagate and group generate .

Recall Solution

Read bit positions: ; . , . The block generates a carry (bit 2 did) but does not propagate one across, because breaks the chain.

Exercise 4.2

Two 4-bit CLA blocks are chained. Block 0 has , block 1 has . The overall carry-in is . Find the carry into block 1 () and the carry out of block 1 () using the block recurrence .

Recall Solution

. Block 0 generated a carry. . Block 1 didn't generate, but its propagated block 0's carry across the whole 4-bit group in one step. Answer: , . This is the CLA idea recursively applied — blocks behave exactly like single bits.

Exercise 4.3

Show that the block recurrence has the identical algebraic form as the single-bit recurrence , and state why that self-similarity is powerful.

Recall Solution

Map , , , . Both read "output carry = generate OR (propagate AND input carry)" — same OR-of-(term, AND-term) structure. Why powerful: the same lookahead unrolling you did for bits can now be applied to blocks, and to groups-of-blocks, etc. Depth grows like rather than linearly, which is the seed of tree-structured designs like Prefix Adders (Kogge-Stone).


Level 5 — Mastery

Full multi-bit design and a subtle edge case.

Exercise 5.1

Complete CLA add: , , . Produce the full table and the final 5-bit result. Verify by decimal arithmetic.

Recall Solution

; .

0 1 1 1 0
1 0 1 0 1
2 1 0 0 1
3 1 1 1 0

Carries ():

Sums :

  • , , , .

Result: carry-out , . Check: . ✓ Notice the single carry generated at bit 0 rides the propagate chain (bits 1,2) all the way up — a beautiful full example of the "generate once, propagate through" motion.

Exercise 5.2

Degenerate/limit case. What are all carries for , , ? Explain what "the carry rides through" means when there is nothing to add.

Recall Solution

Every and every .

  • , and likewise . The input carry is killed immediately at bit 0 because (both inputs 0 → kill mode). Sums: all … except . Result: , carry-out , i.e. . ✓ The lone carry-in surfaces as the LSB sum bit and never becomes a carry-out, because nothing propagates.

Exercise 5.3

Longest propagation chain. Design inputs for a 4-bit adder so that a carry generated by alone travels through every bit and out of , with no bit generating on its own. State and verify.

Recall Solution

We need every bit in propagate mode () and no bit in generate ( not both 1). Choose , , . Then for all , and for all .

  • , , , . The input carry propagates cleanly through all four bits. Sums: for all . Result: , carry-out . ✓ This is the worst case for ripple-carry (delay proportional to the whole chain) but constant-depth for CLA — the entire reason the CLA exists.

Connections

  • Parent: CLA topic note — every formula here is derived there.
  • Full Adder — the per-bit logic these exercises evaluate.
  • Ripple-Carry Adder — the baseline used in the delay problems.
  • Boolean Algebra — Exercise 3.1's proof is pure Boolean identities.
  • Propagation Delay & Fan-in — Exercises 3.2–3.3 quantify these costs.
  • Prefix Adders (Kogge-Stone) — the -depth generalization Exercise 4.3 points to.
  • Carry-Save Adder — an alternative speed trick worth contrasting.

Exercise Ladder

builds on

builds on

builds on

builds on

L1 Recognition read g and p

L2 Application crank the carries

L3 Analysis delay and fan-in

L4 Synthesis block G and P

L5 Mastery full add and edge cases