Skip to content

16. Adders: the full adder, the carry chain and lookahead

Lecture 15 opens the part of the course about datapaths: the blocks that do the same operation on every bit of a word. The first and most important is the adder. The lecture starts from a single bit, the full adder, whose two outputs turn out to be two famous logic functions. Chaining full adders gives the ripple-carry adder, and its delay is set by the carry rippling from the bottom bit to the top. The lecture then builds the full adder from transistors and uses two of its properties to make the carry chain fast. One is self-duality, which makes every pull-up network a mirror of its pull-down; the other is the late arrival of the carry. After a short look at how a datapath is laid out, it turns to parallel adders, which spend hardware to compute the carries without waiting for the ripple. Each one starts from the same rewriting of the carry into generate and propagate: carry bypass, carry select and, the way adders are really built, carry lookahead, ending at a radix-4 lookahead tree. The next lecture continues with radix-2 trees (Chapter 17).

After this chapter you can:

  1. write a full adder’s two outputs as the majority and the odd parity of its inputs, and check them against the truth table;
  2. find the critical path of a ripple-carry adder and count its stages;
  3. turn an adder into a subtractor;
  4. say what a self-dual function is and why it makes a gate’s pull-up and pull-down identical;
  5. draw the mirror adder’s carry and sum stages, place cinc_{in} correctly, and compute their logical efforts;
  6. remove the carry chain’s inverters by alternating polarity, and compute what it saves and when;
  7. lay out a datapath as a bit stack with a uniform bit pitch;
  8. define generate and propagate, and say why the sum needs p=a⊕bp = a\oplus b;
  9. trace the critical paths of carry-bypass, carry-select and lookahead adders and compare them;
  10. unroll the carry recursion into group generate and propagate, combine two groups, and build a radix-4 lookahead tree.

Boxes and equations marked board were written in the lecture. Parts marked added are explanations, arguments or examples this guide adds; every number in them is recomputed in the page’s test.

Before you start. Three things from earlier chapters run through this one. Complementary static CMOS (Chapter 7, §4): a gate’s NFET pull-down network conducts when the output should be 0, and its PFET pull-up is the dual network, series and parallel exchanged. The course’s delay model (Chapter 8, §1): a stage’s delay is its gain g⋅hg\cdot h in units of τinv\tau_{inv}, where gg is its logical effort and hh its load over its input capacitance; drain capacitance is ignored. Binary numbers (Chapter 15, §11): bit 0 is the least significant, and two’s complement negates by inverting every bit and adding 1. One note on the recording: Lecture 15 was taped in two takes. At 21:44 the board is suddenly clean, because the second half was re-recorded; nothing is lost between them.

Symbols
SymbolMeaningUnitFirst appears
aa, bb; aia_i, bib_ithe two operand bits; bit ii of each operand (bit 0 the least significant, drawn at the right)—§1, §2
cinc_{in}, coutc_{out}a full adder’s carry in and carry out—§1
ss, sis_ia full adder’s sum bit; bit ii of the sum—§1, §2
xˉ\bar x, cout‾\overline{c_{out}}the complement of xx (the board’s overbar)—§1
⊕\oplusexclusive OR (XOR)—§1
cic_ithe carry into bit ii: c0=cinc_0 = c_{in}, and bit ii‘s carry out is ci+1c_{i+1}—§2, §12
NNthe number of bits in the adder—§2
tct_c, tsumt_{sum}the delay of one carry stage and of one sum stage addedτinv\tau_{inv}§2
SUBthe subtract control bit added—§3
gg (no bit index)logical effort, Chapter 7’s: an input’s capacitance over that of an inverter of the same drive. Written with a word subscript where it could be confused with a generate: gcing_{c_{in}}, gag_a—§5
hhelectrical effort: a stage’s load over its input capacitance—§5
τinv\tau_{inv}the fan-out-of-one (FO1) inverter delay, the unit of the gainsps§5
unitsgate width in multiples of the reference inverter’s NFET (inverter: NFET 1, PFET 2, input 3)—§5
xxthe size of an inverter in the carry chain, in multiples of the reference inverter added—§7
sins_{in}the input capacitance the next bit’s sum stage puts on the carry wire addedunits§7
gig_i, pip_igenerate aibia_ib_i and propagate ai⊕bia_i\oplus b_i of bit ii (always with a bit index, or as "g=abg = ab" in §9)—§9
MMthe number of bits in a group (bypass) or bin (select) added—§10
PPa group’s propagate: the AND of its bits’ pip_i—§10
tmuxt_{mux}, tPGt_{PG}the delay of a 2:1 multiplexer and of a PG cell addedτinv\tau_{inv}§10
GG, PP; G3:0G_{3:0}, P3:0P_{3:0}group generate and group propagate (the board’s braces); the subscript names the bits, high index first added—§12
LAa lookahead unit (radix 4: it takes four bits or four groups)—§13
tLAt_{LA}the delay through one lookahead unit addedτinv\tau_{inv}§13
LLthe number of levels in a lookahead tree added—§13

1. The full adder: majority and odd parity

You need

Binary addition by hand added. Add column by column, starting at the least significant bit (the right). In each column add the two bits and the carry that came in from the right. A column that adds to 0 or 1 writes it and carries 0; one that adds to 2 (binary 10) writes 0 and carries 1; one that adds to 3 (binary 11) writes 1 and carries 1.

XOR added. x⊕y=1x\oplus y = 1 when exactly one of xx, yy is 1. It is associative, so a⊕b⊕ca\oplus b\oplus c needs no brackets: it is 1 when an odd number of aa, bb, cc are 1.

The question. Every adder, however fast, is built from one-bit pieces. What does the piece for one column of a hand addition compute, and what logic functions are its outputs?

The block is the full adder (FA) board (00:51). It takes three bits, the two operand bits aa and bb and the carry cinc_{in} coming from the column to its right, and gives two: the sum bit ss and the carry coutc_{out} into the column to its left. The board draws it the way hand addition runs: aa and bb from above, cinc_{in} from the right, coutc_{out} out to the left and ss out below. Keep that orientation: in every chain in this chapter, bit 0 is at the right and the carry flows right to left.

The full adder, redrawn from the board (Lecture15 @ 03:52). Left: the block, with the carry entering from the right and leaving to the left, as in hand addition. Right: its truth table. Read each row as a count: coutc_{out} and ss are the number of ones among aa, bb, cinc_{in}, written in binary.

The board (Lecture15 @ 03:52)
Lightboard in violet: 'Lecture 15', 'Datapath / dataflow' and 'Adders', underlined, 'full adder'; the FA block with a, b from above, c_in from the right, c_out to the left and s below; c_out = ab + bc_in + ac_in, '(majority function)'; the truth table a b c_in | c_out s with its eight rows, showing through the lightboard behind the lecturer; s = a ⊕ b ⊕ c_in, 'odd parity function'.
Lecture15 @ 03:52The full adder, its truth table, the majority function and the odd parity function.

Fair copy of the board above (Lecture15 @ 03:52), mark for mark in its own layout. All black: one pen wrote the whole board. The bottom of the table’s vertical rule, behind the lecturer’s hand here, is copied from 03:23. The table’s rows are levelled; on the board they drift down to the right.

From the truth table to two functions (board, 01:16–03:56)

  1. The table. Eight rows, one for each combination of aa, bb, cinc_{in} (01:16–02:11). Read one in words: row 011 is 0+1+1=20 + 1 + 1 = 2, binary 10, so cout=1c_{out} = 1 and s=0s = 0.
  2. The carry is the majority. coutc_{out} is 1 in rows 011, 101, 110 and 111: exactly the rows where at least two of the three inputs are 1. As a sum of products, one product for each pair of inputs that are both 1 (02:12–03:06) board: cout=ab+bcin+acinc_{out} = ab + bc_{in} + ac_{in}. The board names it the majority function: the output agrees with the majority of the inputs.
  3. The sum is the odd parity. ss is 1 in rows 001, 010, 100 and 111: one or three ones, an odd number. That is s=a⊕b⊕cins = a\oplus b\oplus c_{in} (03:06–03:56) board, the odd parity function.
  4. Why the block adds added. In every row, 2cout+s=a+b+cin2c_{out} + s = a + b + c_{in}: the two outputs are the count of ones written in binary, coutc_{out} the twos digit and ss the ones digit. That is what a column of hand addition needs.

The last column below is the count, which the two outputs encode:

a b cina\ b\ c_{in}coutc_{out}ssa+b+cina + b + c_{in}
000000
001011
010011
011102
100011
101102
110102
111113

Memorize or derive. Memorize both: they are the most-used formulas of the chapter, and their names (majority, odd parity) carry them. 2cout+s=a+b+cin2c_{out} + s = a + b + c_{in} is the one-line derivation if you forget: count the ones and write the count in binary.

A worked example (the board’s rows). Row 011: ab=0ab = 0, bcin=1bc_{in} = 1, acin=0ac_{in} = 0, so cout=1c_{out} = 1; 0⊕1⊕1=00\oplus1\oplus1 = 0, so s=0s = 0; and 2×1+0=2=0+1+12 \times 1 + 0 = 2 = 0 + 1 + 1. Row 111: all three products are 1, so cout=1c_{out} = 1; 1⊕1⊕1=11\oplus1\oplus1 = 1; and 2+1=32 + 1 = 3.

Traps.

  • Reading ss as an OR. a+b+cina + b + c_{in} in Boolean algebra is the OR, which is 1 on row 011; the sum bit there is 0. The sum is the parity, not the OR.
  • Dropping a product term. cout=ab+bcinc_{out} = ab + bc_{in} misses row 101 (a=cin=1a = c_{in} = 1, b=0b = 0), where the carry is 1. Each of the three pairs needs its term.
Check yourself Which rows of the full adder's truth table have cout = 1 and s = 0?

Rows 011, 101 and 110: exactly two of the three inputs are 1, so the count is 2, binary 10.

Check yourself Show from the table that cout does not change when you exchange a and cin. What property of the formula guarantees it, and does s have it too?

Exchanging aa and cinc_{in} maps row 001 to 100 and 011 to 110 (rows 000, 010, 101 and 111 map to themselves); in each pair coutc_{out} is the same (0 and 0; 1 and 1). The formula ab+bcin+acinab + bc_{in} + ac_{in} is symmetric in its three inputs: exchanging any two permutes its terms. So is a⊕b⊕cina\oplus b\oplus c_{in}, so ss has it too. A full adder does not care which input is the carry, which §5 and §6 exploit.

2. The ripple-carry adder and its critical path

You need

The full adder (§1). Three bits in, two out: cout=ab+bcin+acinc_{out} = ab + bc_{in} + ac_{in} (1 when at least two inputs are 1) and s=a⊕b⊕cins = a\oplus b\oplus c_{in} (1 when an odd number are). The carry enters from the right and leaves to the left.

The full adder and its truth table (§1; Lecture15 @ 03:52, redrawn). Original figure ↑

Synchronous timing (Chapter 13). Logic between flip-flops must settle within one clock period, for every input: the period is set by the slowest path through the logic.

The question. Chain NN full adders and you have an NN-bit adder. How long does it take, and which path through it sets that time?

Ripple carry (board, 04:36–08:30)

  1. Hand addition. Add 1111 and 0001 (04:41). The right column is 1+1=21 + 1 = 2: write 0, carry 1. The next is 1+0+1=21 + 0 + 1 = 2: write 0, carry 1. And so on: “one and one is zero, carry the one”, four times. The result is 0000 with a carry out of 1, which is 15+1=1615 + 1 = 16.
  2. The circuit. One full adder per column, right to left (05:09–06:28) board. Bit 0’s carry-in is cin=0c_{in} = 0; bit ii takes aia_i and bib_i from above and gives sis_i below; each carry-out goes into the next bit’s carry-in, and the last carry-out is the adder’s coutc_{out}. The carry ripples from bit to bit, so this is the ripple-carry adder board.
  3. The delay depends on the operands. In 1111 + 0000 no column makes a carry: every bit’s sum is ready as soon as its own aia_i, bib_i arrive (07:10). In 1111 + 0001 the carry made at bit 0 must pass through every bit before the top sum is right.
  4. The clock must wait for the worst. “In a synchronous design, I have to wait for the longest answer” (07:38). So we time the adder by its worst-case path, the critical path board: a carry made at bit 0 that ripples through every carry circuit to the top.
  5. What to optimize. On that path the carry circuit appears once per bit, and a sum circuit only once, at the end. For an 8-bit adder the critical path includes “eight copies of the carry chain” (15:53), the lecturer says, and the sum appears on it once. So the carry logic is what matters; a slow sum circuit costs only once.

The board’s two additions added (values from Lecture15 @ 09:32). Left: 1111 + 0001 makes a carry in every column; the result is 0000 with a carry out of 1. Right: 1111 + 0000 makes no carry at all. The same adder finishes sooner for the right-hand pair, but the clock cannot know which pair is coming.

A 4-bit ripple-carry adder, redrawn from the board (Lecture15 @ 09:32). Each carry-out feeds the next bit’s carry-in, from bit 0 at the right to bit 3 at the left. The thick line is the critical path: a carry made at bit 0, rippling through every carry to the top sum s3s_3.

The board (Lecture15 @ 09:32)
Lightboard in violet and a pale pen: the left column as at 03:52 without the table; a column sum a_3 … a_0 over b_3 … b_0 giving s_3 … s_0 and c_out; the sums 1111 + 0000 and 1111 + 0001, the second ringed with its carries, each result ringed; the ripple chain of four FA blocks with a_i and b̄_i (overbars added for subtraction), c_in = 0 / = 1, s_0 … s_3, c_out and the critical-path arrow; 'ripple carry adder', 'critical path'; 'a + b', 'a − b', 'a + (−b)' with a brace and an arrow.
Lecture15 @ 09:32Ripple carry: the column sum, the two example additions, the four-bit chain with its critical path, and (in the overbars) the start of subtraction.

Fair copy of the board above (Lecture15 @ 09:32), mark for mark in its own layout. Orange is the pale pen, which drew the ripple-carry adder and its examples: the column sum, the two small sums and the chain with its labels. Black is the violet pen: the full-adder notes from 03:52 and, over the orange, the marks added afterwards: the ring round the worst case, the critical path into s3s_3, and the subtraction (bˉi\bar b_i and cin=1c_{in} = 1 for a+(−b)a + (-b)). The left edge of bit 0’s box, the carry into bit 1 and its label, behind the lecturer’s hand here, are copied from 08:47. The table and the parity function of 03:52 are erased by now.

Counting the critical path

Let tct_c be the delay of one carry circuit (from its carry-in to its carry-out) and tsumt_{sum} that of one sum circuit added. Follow the carry made at bit 0.

  • The carry into bit N−1N-1, cN−1c_{N-1}, comes out of N−1N - 1 carry circuits (bits 0 to N−2N-2).
  • If the sum circuit needs only aa, bb and the carry into its bit, as s=a⊕b⊕cins = a\oplus b\oplus c_{in} does, the top sum sN−1s_{N-1} follows one sum delay later: (N−1) tc+tsum(N-1)\,t_c + t_{sum}.
  • The carry-out coutc_{out} needs one more carry circuit: N tcN\,t_c.
  • The lecture’s circuit (§5) computes its sum from its own bit’s carry-out, so the top bit’s carry circuit also lies on the path to sN−1s_{N-1}: N tc+tsumN\,t_c + t_{sum}. That is the lecturer’s count for 8 bits, eight carry stages and one sum, and the eight-stage drawing below.

The critical path of an 8-bit ripple-carry adder, redrawn from the board (Lecture15 @ 18:06): eight carry stages and one sum stage. Every bit adds a carry stage to the path; the sum stage is paid once.

From §9 on, every adder forms its sums as si=pi⊕cis_i = p_i\oplus c_i from the carry into its bit, so the comparisons there use the first count.

Memorize or derive. Derive: trace the carry from bit 0 and count the circuits it passes. The one thing to remember is that the delay is linear in NN: double the width, double the time.

A worked example. First the board’s two additions: 1111 + 0001 gives carries c1,c2,c3,c4=1,1,1,1c_1, c_2, c_3, c_4 = 1, 1, 1, 1, sum 0000 and cout=1c_{out} = 1 (16); 1111 + 0000 gives no carries and sum 1111 (15). Now some delays added: take, for example, tc=tsum=4 τinvt_c = t_{sum} = 4\,\tau_{inv} (§7 finds 4 for the lecture’s carry stage with its inverter removed and a light sum stage; with an inverter it is about 5). An 8-bit adder’s top sum arrives after 7×4+4=32 τinv7 \times 4 + 4 = 32\,\tau_{inv} and its coutc_{out} after 8×4=32 τinv8 \times 4 = 32\,\tau_{inv}; with the lecture’s circuit, whose sum waits for its own carry stage, the top sum takes 8×4+4=36 τinv8 \times 4 + 4 = 36\,\tau_{inv}. A 32-bit adder’s top sum takes 128 τinv128\,\tau_{inv}: four times the width, four times the delay.

Traps.

  • Timing the adder by a typical input. Most additions finish early, but the clock has to cover 1111 + 0001.
  • Optimizing the sum first. The sum circuit is on the path once; the carry circuit NN times.
Check yourself Which 4-bit operand pairs (with cin = 0) make a carry ripple from bit 0 all the way to cout?

Bit 0 must generate a carry, a0=b0=1a_0 = b_0 = 1, and each of bits 1 to 3 must pass it on, which needs exactly one of aia_i, bib_i to be 1. For example 1111 + 0001, or 0101 + 1011.

Check yourself With the example delays, an 8-bit ripple adder's carry stage gets faster, from 5 to 4 τinv. How much sooner does cout arrive? If instead the sum stage got 1 τinv faster, how much sooner would cout arrive?

Step 1: coutc_{out} passes eight carry stages, so it goes from 8×5=408 \times 5 = 40 to 8×4=32 τinv8 \times 4 = 32\,\tau_{inv}: 8 τinv8\,\tau_{inv} sooner. Step 2: no sum stage lies on the path to coutc_{out}, so a faster sum stage changes it by nothing. (The top sum would gain 1 τinv1\,\tau_{inv}; the carry stage’s speed-up gains it seven, one per carry stage before it.)

3. Subtraction with the same adder

You need

Two’s complement (Chapter 15, §11). An nn-bit word with its top bit as the sign. To negate a number, invert every bit and add 1: −b=bˉ+1-b = \bar b + 1. A carry out of the top bit is dropped.

XOR as a controlled inverter added. b⊕0=bb\oplus 0 = b and b⊕1=bˉb\oplus 1 = \bar b: an XOR passes bb when its other input is 0 and inverts it when it is 1.

The ripple-carry adder (§2): full adders chained right to left, bit 0’s carry-in cinc_{in} free.

The 4-bit ripple-carry adder (§2; Lecture15 @ 09:32, redrawn). Original figure ↑

The question. Can the same adder subtract, without a second circuit?

a − b on an adder (board, 08:30–09:30)

  1. Rewrite the subtraction. a−b=a+(−b)a - b = a + (-b) board.
  2. Negate bb in two’s complement. Invert every bit of bb (the board’s overbars on b0…b3b_0 \dots b_3) and add 1 board.
  3. Use the free carry-in for the “+1”. Bit 0’s carry-in is otherwise 0; set it to 1 (the board’s “cin=0c_{in} = 0 / =1= 1”). Nothing else in the adder changes.
  4. One control bit (09:30, spoken). A bit SUB added does both: XOR it into every bib_i, and wire it to cinc_{in}. SUB = 0 adds; SUB = 1 subtracts.

An adder–subtractor added, as described in the lecture (09:30). One control bit SUB feeds an XOR on every bib_i and bit 0’s carry-in. SUB = 0: the XORs pass bb and cin=0c_{in} = 0, so the circuit adds. SUB = 1: the XORs invert bb and cin=1c_{in} = 1, so it computes a+bˉ+1=a−ba + \bar b + 1 = a - b.

Memorize or derive. Derive: negation in two’s complement is invert-and-add-one, and the adder’s carry-in supplies the one.

A worked example added (4 bits). 5−35 - 3: 5=01015 = 0101 and 3ˉ=1100\bar 3 = 1100, so 0101+1100+1=0010=20101 + 1100 + 1 = 0010 = 2, with a carry out of 1, dropped. 3−53 - 5: 0011+1010+1=11100011 + 1010 + 1 = 1110, which in two’s complement is −2-2, with a carry out of 0.

Trap. Inverting bb but leaving cin=0c_{in} = 0 computes a+bˉ=a−b−1a + \bar b = a - b - 1: 5−35 - 3 comes out as 0001.

Check yourself What does the 4-bit subtractor output for 0 − 1, and how do you read the result?

Step 1: 1ˉ=1110\bar 1 = 1110, so the adder computes 0000+1110+1=11110000 + 1110 + 1 = 1111. Step 2: read it in two’s complement: the top bit is 1, so it is negative; inverting and adding 1 gives 0000+1=00010000 + 1 = 0001, so 1111=−11111 = -1. Correct.

Check yourself With SUB = 1, what does the 4-bit circuit give for 4 − 4, and why is its carry-out 1?

Step 1: 4ˉ=1011\bar 4 = 1011, so the adder computes 0100+1011+1=100000100 + 1011 + 1 = 10000: sum 0000, carry-out 1. Step 2: inverting and adding 1 adds 16−b16 - b, so the adder computes a+16−ba + 16 - b, which reaches 16, and carries out, exactly when a≥ba \ge b as unsigned numbers. Here 4≥44 \ge 4, so the carry-out is 1. (In 5 − 3 it was 1 too; in 3 − 5 it was 0.)

4. Self-duality: why the pull-up equals the pull-down

You need

Complementary static CMOS (Chapter 7, §4). The NFET pull-down network conducts on the rows where the output is 0, so the gate computes the complement of the pull-down’s condition. The PFET pull-up is the dual network: the same inputs, with every series connection made parallel and every parallel one series. A PFET conducts on a 0. Exactly one network conducts for every input, so the gate is static.

The two outputs (§1): cout=ab+bcin+acinc_{out} = ab + bc_{in} + ac_{in}, the majority, and s=a⊕b⊕cins = a\oplus b\oplus c_{in}, the odd parity.

The question. To build the full adder in static CMOS we need a pull-down and a pull-up for each output. What special property do these two functions have, and what does it buy in the circuit?

Self-duality (board, 10:04–12:16)

  1. The definition (10:51) board. Complement all three inputs, and the output complements: sˉ(a,b,cin)=s(aˉ,bˉ,cˉin)\bar s(a, b, c_{in}) = s(\bar a, \bar b, \bar c_{in}) and cout‾(a,b,cin)=cout(aˉ,bˉ,cˉin)\overline{c_{out}}(a, b, c_{in}) = c_{out}(\bar a, \bar b, \bar c_{in}). A function with this property is self-dual board. Check one row: s(0,1,1)=0s(0, 1, 1) = 0, and s(1,0,0)=1=0ˉs(1, 0, 0) = 1 = \bar 0.
  2. Why it holds added. Complementing all three inputs turns a count of kk ones into 3−k3 - k. “At least two of three” becomes “at most one”, the complement of the majority; an odd count becomes an even one, the complement of the parity.
  3. What it buys (11:35–12:06). A pull-up of PFETs conducts when its inputs are low; so a pull-up network built with the same series–parallel structure as the pull-down, on the same inputs, conducts exactly when the pull-down would conduct on the complemented inputs. For the gate to work, the pull-up must conduct when the output is 1, which is when the pull-down is off. For a self-dual function those two conditions coincide, so the pull-up can have the same structure as the pull-down. “If the logic function in question is self dual, then the pull-up and pull-down networks will be exactly the same. And that’s going to make the layout very convenient.”
  4. The majority’s networks added. Its pull-down conducts for ab+cin(a+b)ab + c_{in}(a + b): cinc_{in} in series with (aa parallel bb), and beside that branch aa in series with bb. Chapter 7’s rule would build the pull-up as the dual: swap series and parallel everywhere, giving (cinc_{in} parallel aa–bb) in series with (aa parallel bb). That works, but self-duality offers a second pull-up: the pull-down’s own structure in PFETs, which by step 3 conducts exactly when the output should be 1. The two pull-ups conduct for the same inputs; only the second is a mirror image of the pull-down, and that is the one the lecture uses. The pull-down and its mirror are drawn below.

The majority’s pull-down and the mirror pull-up added. Left: the pull-down, conducting for ab+cin(a+b)ab + c_{in}(a + b). Right: the same structure in PFETs, conducting for aˉbˉ+cˉin(aˉ+bˉ)\bar a\bar b + \bar c_{in}(\bar a + \bar b), the majority of the complemented inputs, which by self-duality is 1 exactly when cout=0c_{out} = 0. The two networks are the same up to the order of devices in a branch, which is why the lecture’s circuit (§5) has a pull-up that mirrors its pull-down.

The board (Lecture15 @ 11:45)
Lightboard in violet with a pale-pen column sum: the left column with the full adder's equations, now with s = a ⊕ b ⊕ c_in rewritten under '(majority function)'; 'a + b', 'a − b', 'a + (−b)'; the column sum 1111 + 0001 from 09:32; at the right s̄(a, b, c_in) = s(ā, b̄, c̄_in), c̄_out(a, b, c_in) = c_out(ā, b̄, c̄_in) and 'self-dual'. The ripple chain and the small sums of 09:32 are erased.
Lecture15 @ 11:45Self-duality: complementing every input complements both outputs.

Fair copy of the board above (Lecture15 @ 11:45), mark for mark in its own layout. Orange is the pale pen’s column sum, the one part of 09:32’s ripple-carry layer still on the board; everything else is the violet pen, in black. The two small sums, the ripple chain with its critical path, “ripple carry adder” and “critical path” are erased by now. The two equations are levelled; on the board they drift down to the right.

The sum written with the carry

The board also rewrites the sum in a form the circuit will use (12:41, written at 18:06) board:

s=abcin+cout‾ (a+b+cin).s = abc_{in} + \overline{c_{out}}\,(a + b + c_{in}).

Why it is right, case by case:

  • No input or one input is 1. Then cout=0c_{out} = 0, so cout‾=1\overline{c_{out}} = 1, and the second term is a+b+cina + b + c_{in}: 1 when exactly one input is 1, 0 when none is. The product abcinabc_{in} is 0. So ss is 1 for one input, 0 for none. Correct.
  • Exactly two are 1. cout=1c_{out} = 1 kills the second term, and abcin=0abc_{in} = 0. So s=0s = 0. Correct.
  • All three are 1. abcin=1abc_{in} = 1. So s=1s = 1. Correct.

The point: a three-input XOR in static CMOS is large, but this form needs only AND and OR of the inputs and of cout‾\overline{c_{out}}, which the carry gate already makes. The table checks both properties on every row:

a b cina\ b\ c_{in}sss(aˉ,bˉ,cˉin)s(\bar a, \bar b, \bar c_{in})coutc_{out}cout(aˉ,bˉ,cˉin)c_{out}(\bar a, \bar b, \bar c_{in})abcin+cout‾(a+b+cin)abc_{in} + \overline{c_{out}}(a + b + c_{in})
00001010
00110011
01010011
01101100
10010011
10101100
11001100
11110101

Memorize or derive. Memorize the definition of self-dual, and that both full-adder outputs have it. Derive the sum identity from the three cases above when you need it: it is the form that FN12-10b’s domino full adder and MT24-5a’s dynamic one use.

A worked example (the identity on two rows). Row 110: cout=1c_{out} = 1, so cout‾(a+b+cin)=0\overline{c_{out}}(a + b + c_{in}) = 0, and abcin=0abc_{in} = 0: s=0s = 0, as 1+1+0=21 + 1 + 0 = 2 (binary 10) says. Row 100: cout‾=1\overline{c_{out}} = 1 and a+b+cin=1a + b + c_{in} = 1, so s=1s = 1.

Traps.

  • “The two outputs are duals of each other.” The lecturer says it loosely (10:38), but the property is that each output is its own dual.
  • Every gate’s pull-up mirrors its pull-down. No: a NAND’s pull-down is series and its pull-up parallel. Only a self-dual function can have identical networks.
  • The mirror is the dual. It is not: the dual of the majority’s pull-down is (cinc_{in} parallel aa–bb) in series with (aa parallel bb), a different arrangement of the same five devices. The two conduct for the same inputs, which is why either serves; the mirror is chosen because it matches the pull-down in the layout.
Check yourself Is a two-input XOR self-dual?

No. Complementing both inputs leaves an XOR unchanged, aˉ⊕bˉ=a⊕b\bar a\oplus\bar b = a\oplus b, but self-duality needs it to complement. An XOR of an odd number of inputs is self-dual; an even number is not.

Check yourself Is the complement of the majority, c̄out, also self-dual? What does the answer say about the gate that produces c̄out?

Step 1: complement both sides of cout‾(a,b,cin)=cout(aˉ,bˉ,cˉin)\overline{c_{out}}(a,b,c_{in}) = c_{out}(\bar a,\bar b,\bar c_{in}): cout(a,b,cin)=cout‾(aˉ,bˉ,cˉin)c_{out}(a,b,c_{in}) = \overline{c_{out}}(\bar a,\bar b,\bar c_{in}), which is the definition of self-duality for cout‾\overline{c_{out}}. Step 2: the gate that computes cout‾\overline{c_{out}} (a static CMOS gate always computes a complement) can therefore have identical pull-up and pull-down. That is the carry stage of §5.

5. The mirror adder at transistor level

You need

Sizing stacks and logical effort (Chapter 7, §8). The reference inverter has an NFET of 1 unit and a PFET of 2 units (the PFET is half as strong per width), so its input is 3 units. To give a gate the same drive, every conducting path must be as strong as one inverter device, so a device in a series stack of nn is nn times as wide. An input’s logical effort is its gate width over the inverter’s 3 units: a two-input NAND (NFETs 2, PFETs 2) has g=4/3g = 4/3.

Self-duality (§4). Both full-adder outputs are self-dual, so each gate can have a pull-up with the same structure as its pull-down. The majority’s pull-down is cinc_{in} over (aa parallel bb), beside aa–bb in series.

The majority’s pull-down and the identical pull-up built from it (§4). Original figure ↑

The sum identity (§4): s=abcin+cout‾(a+b+cin)s = abc_{in} + \overline{c_{out}}(a + b + c_{in}).

The question. What does the lecture’s full adder look like in transistors, and what does it cost to drive its inputs?

The lecture draws a static CMOS full adder device by device (12:16–15:17) but gives it no name. This guide calls it the mirror adder added, because every pull-up in it is the mirror image of its pull-down, and that is the name it goes by in textbooks.

The two stages (board, 13:20–15:11)

  1. The carry stage. The pull-down: an NFET cinc_{in} over NFETs aa and bb in parallel, and beside that branch NFETs bb and aa in series (13:20–14:10) board. It conducts when cin(a+b)+abc_{in}(a + b) + ab, the majority, so the gate’s output is cout‾\overline{c_{out}}. The pull-up is the same structure in PFETs, which self-duality allows. An inverter after it gives coutc_{out}.
  2. The sum stage. The pull-down: an NFET cout‾\overline{c_{out}} over NFETs aa, bb, cinc_{in} in parallel, and beside it NFETs aa, bb, cinc_{in} in series (14:10–15:11) board. It conducts when cout‾(a+b+cin)+abcin\overline{c_{out}}(a + b + c_{in}) + abc_{in}, which by §4’s identity is ss, so the output is sˉ\bar s. Again the pull-up is the same structure in PFETs, and an inverter gives ss.
  3. Count the devices added. Carry stage: 5 NFETs and 5 PFETs, 10. Sum stage: 7 and 7, 14. Two inverters, 4. In all, 28 transistors.

The mirror adder’s carry stage, redrawn from the board (Lecture15 @ 21:39). The pull-down conducts for ab+cin(a+b)ab + c_{in}(a + b), so the output is cout‾\overline{c_{out}}; the pull-up has the same structure in PFETs. The two cinc_{in} devices sit next to the output node (§6 explains why), and an inverter restores coutc_{out}.

The mirror adder’s sum stage, redrawn from the board (Lecture15 @ 21:39). Its pull-down conducts for cout‾(a+b+cin)+abcin\overline{c_{out}}(a + b + c_{in}) + abc_{in}, which is ss (§4), so the output is sˉ\bar s; an inverter gives ss. The cout‾\overline{c_{out}} input comes from the carry stage.

The board (Lecture15 @ 18:06)
Lightboard in violet with cyan marks: the carry stage and the sum stage at transistor level, the wiring loop that takes c̄_out into the sum stage, the inverters to c_out and s; at the top the alternative carry stack with its c_in devices ringed in cyan and a diagonal stroke; cyan rings on the carry stage's c_in devices and its inverter; at the bottom the eight-stage carry chain with a cyan line and a sum arrow; at the left the notes of 11:45 with 'a + b', 'a − b', 'a + (−b)' and s = a ⊕ b ⊕ c_in = abc_in + c̄_out(a + b + c_in), double-underlined. The lecturer stands behind the board; the strokes show through.
Lecture15 @ 18:06The transistor-level full adder: carry stage, sum stage, the alternative stack (top), the eight-bit chain (bottom) and the sum identity (left).

Fair copy of the board above (Lecture15 @ 18:06), mark for mark in its own layout. Black is the violet pen: the notes from 03:52–11:45 with the sum identity s=abcin+cout‾ (a+b+cin)s = abc_{in} + \overline{c_{out}}\,(a + b + c_{in}) added, the carry stage (output cout‾\overline{c_{out}}, then an inverter to coutc_{out}), the sum stage (output sˉ\bar s, then an inverter to ss), the alternative carry stack at the top, struck through, and the eight-stage carry chain. Teal is the cyan pen, added over the finished circuit: the rings on the cinc_{in} input and on the two cinc_{in} devices next to the output, the rings on the top stack’s cinc_{in} devices next to the rails, the ring on the carry inverter, and the line along the chain’s carries. The aa–bb column of the carry stage lies over the lecturer’s face, which washes out its labels; they match 21:39, where the column is unchanged. The lone bb left of cinc_{in} is what is left of 09:32’s column sum. The devices are drawn with the course’s symbols; the board draws squiggle channels.

Sizing the stages and their logical efforts

Now size each stage, by Chapter 7’s stack rule, to drive like the reference inverter added.

The carry stage sized for the reference inverter’s drive added. Every path through each network passes two devices, so every NFET is 2 and every PFET 4. The cinc_{in} wire drives one NFET and one PFET, 6 units; the aa wire (and likewise bb) drives two of each, 12 units.

Widths and logical efforts (Chapter 7's sizing)

  1. Carry stage widths. Every path from the output to ground passes two NFETs (cinc_{in} then aa or bb; or bb then aa), so every NFET is 2×1=22 \times 1 = 2. Every path in the pull-up passes two PFETs, so every PFET is 2×2=42 \times 2 = 4.
  2. Carry stage, cinc_{in} input. It drives one NFET (2) and one PFET (4): 6 units. Logical effort gcin=6/3=2g_{c_{in}} = 6/3 = 2.
  3. Carry stage, aa input (and bb). It drives two NFETs and two PFETs, one in each branch: 2⋅2+2⋅4=122\cdot2 + 2\cdot4 = 12 units, so ga=gb=12/3=4g_a = g_b = 12/3 = 4.
  4. Sum stage widths. The series branch aa–bb–cinc_{in} is three high, so those NFETs are 3 and PFETs 6. In the other branch every path passes two devices (cout‾\overline{c_{out}} and one of the parallel three), so those are 2 and 4.
  5. Sum stage inputs. cout‾\overline{c_{out}} drives one 2 and one 4: 6 units, g=2g = 2. The aa input drives a 3 and a 2 (NFETs) and a 6 and a 4 (PFETs): 15 units, g=(3+2+6+4)/3=5g = (3 + 2 + 6 + 4)/3 = 5. So do bb and cinc_{in}.

Memorize or derive. Derive: size by the stack rule, add up the input’s gate widths, divide by 3. It takes a minute and needs nothing memorized.

The worked example’s lesson. The cinc_{in} input costs half as much to drive as aa or bb. That is just right, because cinc_{in} is the input on the critical path (§2): each carry stage drives the next one’s cinc_{in}, so its light load makes the chain fast. The sum stage is heavier (g=5g = 5 on aa, bb and cinc_{in}), but it is on the critical path only once, at the top bit.

Traps.

  • Sizing the sum stage’s three-high branch like the rest. It is three high, so 3 and 6, not 2 and 4.
  • Treating the inverter after cout‾\overline{c_{out}} as free. The next bit needs cinc_{in} in true polarity, so with this circuit every bit pays an inverter on the critical path. §7 removes it.
Check yourself Which devices in the carry stage are driven by cin, and where in their stacks are they?

One NFET and one PFET, each the device next to the output node: the NFET cinc_{in} sits directly under the output, above the parallel aa, bb; the PFET cinc_{in} sits directly above the output, below the parallel aa, bb.

Check yourself A two-input NAND sized for the reference inverter's drive has g = 4/3. How many times more input capacitance does the carry stage's a input present than a NAND input of the same drive, and why?

Step 1: the NAND input drives one 2-unit NFET and one 2-unit PFET, 4 units; the carry stage’s aa drives two NFETs of 2 and two PFETs of 4, 12 units. Step 2: 12/4=312/4 = 3 times. The reason is that aa appears in both branches of each network, and in each it sits in a two-high stack, so it drives two doubled devices per network instead of one.

6. The carry input goes next to the output

You need

Pin swapping (Chapter 7, §5). The order of devices in a series stack does not change the logic, but it changes the delay: for a single input switching, the device closest to the output switches with less delay. So a late-arriving signal goes to the device next to the output.

Why a device low in the stack is slow (Chapter 8, §10). Before a device lower in a stack can pull the output down, it must first discharge the internal node between it and the devices above. If those upper devices are already on, that node was charged high and must be emptied first; the penalty grows roughly as the square of the stack height. If instead the lower devices are the ones already on, the internal node is already at the rail and the top device switches like an inverter.

The carry stage (§5): cinc_{in} over (aa parallel bb), beside aa–bb in series, in both networks.

The mirror adder’s carry stage (§5; Lecture15 @ 21:39, redrawn), with its cinc_{in} devices next to the output. Original figure ↑

The question. In the carry stage, cinc_{in} and the pair (aa parallel bb) are in series. Either order gives the same logic. Which order should we draw, and why does it matter more here than in most gates?

The order of the stack (board, 16:25–17:40)

  1. The other way to draw it (16:25–16:58) board. Put cinc_{in} next to the rails (VDDV_{DD} above, ground below) and the parallel pair next to the output. The logic is unchanged: series devices conduct in either order. “This is not a good choice … even though logically it’s absolutely correct” (16:58–17:11).
  2. Which input arrives last (17:14–17:40). In a ripple adder all the aia_i and bib_i are set at the start of the cycle. The carry cinc_{in} of a high bit arrives only after the carry has rippled up to it, so cinc_{in} is the latest-arriving input of every carry stage.
  3. So cinc_{in} goes next to the output. By the time it arrives, the aa, bb devices below it have settled, and if they conduct, the internal node between them and the cinc_{in} device is already at the rail. The cinc_{in} device then switches like an inverter’s. With the order reversed, the late cinc_{in} device would be at the bottom and would have to discharge the internal node first.
  4. Every bit pays it. The choice is repeated in every carry stage, and every carry stage is on the critical path (“absolutely part of the critical path”, 17:57): eight times over in an 8-bit adder.

Two orders for the same branch of the carry stage, redrawn from the board (Lecture15 @ 18:06). Left (✓): the late cinc_{in} drives the devices next to the output, as in the lecture’s circuit. Right (✗): the board’s alternative, logically identical, with cinc_{in} next to the rails, where its device must first discharge the internal node.

The rule. No new formula: this is Chapter 7’s pin-swapping rule applied to the input whose lateness is built into the architecture. Memorize it: the late input goes next to the output.

Why no number. The course’s delay model gives every device in a stack the same strength; Chapter 8 §10 gives only the trend for the bottom device (∼n2\sim n^2), not a value. So the chapter does not put a figure on the penalty. What it can say is how often it is paid: once per bit, all along the critical path.

A worked trace added (no number). Take a=1a = 1, b=0b = 0, with cinc_{in} rising last, so cout‾\overline{c_{out}} must fall. In the ✓ order the pull-down is output, NFET cinc_{in}, the a∥ba\parallel b pair, ground: the aa device is already on, so the node between the pair and the cinc_{in} device is already at ground, and the cinc_{in} device discharges the output like an inverter’s NFET. In the ✗ order it is output, the pair, NFET cinc_{in}, ground: the aa device connects the internal node to the high output, so the node has charged to about VDD−VTV_{DD} - V_T, and when cinc_{in} rises its device must first empty that node before the output can fall. Same logic, a slower edge, in every bit.

Trap. Applying the rule to aa or bb. They arrive early, at the start of the cycle, so their place in the stack matters little. The rule is about the late input.

Check yourself In the sum stage, which input arrives last, and where does the lecture's circuit put it?

Step 1: the sum stage takes aa, bb, cinc_{in} and cout‾\overline{c_{out}}. cout‾\overline{c_{out}} comes from this bit’s carry stage, which itself waits for cinc_{in}, so cout‾\overline{c_{out}} is the last to arrive. Step 2: in the lecture’s sum stage the cout‾\overline{c_{out}} NFET is directly under the output and its PFET directly above it: next to the output, as the rule wants.

Check yourself Now the pull-up in the ✗ order: a = 0, b = 1, and cin falls last, so c̄out must rise. Which internal node holds the wrong charge, and which device must fix it before the output can rise?

Step 1: in the ✗ order the pull-up is VDDV_{DD}, PFET cinc_{in}, the a∥ba\parallel b pair, output. With a=0a = 0 the aa PFET is on and connects the node between the pair and the cinc_{in} device to the output, which is low; so the node has been pulled down (to within about a threshold of ground). Step 2: when cinc_{in} falls, the cinc_{in} PFET, the one by the rail, must first charge that node before the output can rise. In the ✓ order that node sits between VDDV_{DD}‘s pair and the cinc_{in} device and is already held at VDDV_{DD} by the on aa PFET.

7. Removing the carry chain’s inverters

You need

Self-duality (§4). Complementing every input complements the output: cout(aˉ,bˉ,cˉ)=cout(a,b,c)‾c_{out}(\bar a, \bar b, \bar c) = \overline{c_{out}(a, b, c)}, and the same for ss.

Gains (Chapter 8, §1). A stage’s delay is g⋅h τinvg\cdot h\,\tau_{inv}: its logical effort gg times its electrical effort hh, the load it drives over its own input capacitance. An inverter has g=1g = 1. A path’s delay is the sum of its stages’ gains.

The carry stage’s numbers (§5). Sized for the reference inverter’s drive (NFET 1, PFET 2), its cinc_{in} input is 6 units with gcin=2g_{c_{in}} = 2. The sum stage’s cout‾\overline{c_{out}} input is also 6 units; its cinc_{in} input is 15.

The carry stage sized for inverter drive (§5): cinc_{in} presents 6 units, gcin=2g_{c_{in}} = 2. Original figure ↑

The question. Every bit’s carry passes the carry stage and an inverter, and both are on the critical path. Can the inverter go?

Alternating polarity (board, 18:11–21:10)

  1. Take the inverters out (18:11) board. The board crosses out both output inverters, the carry’s and the sum’s (both are ringed and struck out by 21:39). Bit 0, fed a0a_0, b0b_0 and cinc_{in}, now produces cout‾\overline{c_{out}} (and sˉ0\bar s_0).
  2. Feed the next bit inverted inputs (19:17–20:20) board. Bit 1 receives the inverted carry. Give it inverted operands too, aˉ1\bar a_1 and bˉ1\bar b_1. Then all three of its inputs are complemented, and by self-duality its carry stage computes cout‾(aˉ1,bˉ1,cˉ1)=cout(a1,b1,c1)\overline{c_{out}}(\bar a_1, \bar b_1, \bar c_1) = c_{out}(a_1, b_1, c_1): the true carry. Its sum stage likewise gives the true s1s_1.
  3. Alternate. Bit 2 receives a true carry, so it takes true a2a_2, b2b_2 and gives an inverted carry and sˉ2\bar s_2, like bit 0. Bit 3 is like bit 1, and so on: even bits take true operands and produce inverted outputs, odd bits take inverted operands and produce true outputs.
  4. Where the inverters went (20:20–21:10). To the operands of the odd bits, which are ready at the start of the cycle and are inverted in parallel with everything else, and to the even bits’ sums, which leave the adder. Neither is on the carry chain. “I don’t pay any penalty in having to invert the A and the B’s … So this is a win” (21:00).

The inverterless carry chain, redrawn from the board (Lecture15 @ 21:39; the board draws three bits and part of a fourth, and bit 3 completes the pattern). Even bits take true operands and pass on an inverted carry; odd bits take inverted operands and, by self-duality, pass on the true carry. The only inverters left are on the even bits’ sums, off the carry path.

The board (Lecture15 @ 21:39)
Lightboard in violet and cyan: the transistor-level carry and sum stages with both output inverters ringed and crossed out in cyan; the alternative stack at the top; the eight-stage chain at the bottom; at the left in cyan the inverterless chain: FA blocks with a_0 b_0 and c_in at the right, ringed ā_1 b̄_1, bit 2's inputs written 'a_2 b_7', the carries c̄_out and c_out between them, outputs s̄_0, s_1 and bit 2's sum written 's̄_3', with inverters on the inverted sums; 'parallel adder' underlined in cyan. 'Lecture 15' at the top left; the lecturer stands in front of the chain.
Lecture15 @ 21:39The last board of the first take: both output inverters crossed out, and the inverterless chain with its alternating inputs.

Fair copy of the board above (Lecture15 @ 21:39), mark for mark in its own layout: the last board before the lecture’s re-taped second part. Black is the violet pen: the transistor-level full adder of 18:06, unchanged, and the title; the rest of the left column is erased (a stub of the “Datapath / dataflow” underline and the lone bb of 09:32’s column sum remain). Teal is the cyan pen: the rings of 18:06, the strokes through both output inverters (the carry and the sum stage drop them), and the inverterless chain with “parallel adder”. Two slips are copied as written and marked †: bit 2’s inputs "a2b7a_2b_7" are a2b2a_2b_2, and its sum "sˉ3\bar s_3" is sˉ2\bar s_2. The lower corner of the leftmost box, under the lecturer’s hand here, is copied from 21:00. The chain’s three left bits sit a little further apart than on the board, so the carry labels fit between the boxes.

What the win is worth

The lecture says “win” without a number. Chapter 8’s gains give one added. Use §5’s sizes: the carry stage’s cinc_{in} input is 6 units with gcin=2g_{c_{in}} = 2, and its own sum stage’s cout‾\overline{c_{out}} input is 6 units. Leave out, for now, the next bit’s sum stage, which also reads the carry through its cinc_{in} input; its load sins_{in} is the condition at the end.

Per bit, with and without the inverter (τ_inv)

  1. Without the inverter. Each carry node drives the next carry stage’s cinc_{in} (6) and its own sum stage’s cout‾\overline{c_{out}} (6): h=12/6=2h = 12/6 = 2, so the stage takes g⋅h=2×2=4 τinvg\cdot h = 2 \times 2 = 4\,\tau_{inv} per bit.
  2. With an inverter of size xx (input 3x3x units). The carry stage drives the inverter and its own sum stage: 2×(3x+6)/6=x+22 \times (3x + 6)/6 = x + 2. The inverter drives the next cinc_{in}: 1×6/(3x)=2/x1 \times 6/(3x) = 2/x. Per bit, t(x)=x+2+2/xt(x) = x + 2 + 2/x.
  3. The best inverter. The terms xx and 2/x2/x balance where x=2/xx = 2/x, at x=2x = \sqrt2: t=2+22=4.83 τinvt = 2 + 2\sqrt2 = 4.83\,\tau_{inv}. A unit inverter (x=1x = 1) gives 5 τinv5\,\tau_{inv}.
  4. Eight bits. Inverterless: 8×4=32 τinv8 \times 4 = 32\,\tau_{inv}. With the best inverters 38.6 τinv38.6\,\tau_{inv} (38.63); with unit inverters 40 τinv40\,\tau_{inv}. Removing the inverters saves 6.6 τinv6.6\,\tau_{inv} against the best, 17%.

The carry chain’s delay per bit added, computed from Chapter 8’s gains with §5’s sizes, the next sum stage’s cinc_{in} load left out: with an inverter of size xx after each carry stage, x+2+2/xx + 2 + 2/x (curve; least, 2+22=4.832 + 2\sqrt2 = 4.83, at x=2x = \sqrt2), and without it, 4 (line). No inverter size reaches the line.

Check (a bound). By the inequality of arithmetic and geometric means, x+2/x≥2x⋅2/x=22x + 2/x \ge 2\sqrt{x\cdot 2/x} = 2\sqrt2 for every x>0x > 0, so t(x)≥2+22>4t(x) \ge 2 + 2\sqrt2 > 4: no inverter, however sized, beats the inverterless chain here. The plot shows the same: the curve never touches the line.

Memorize or derive. Derive: two gains per bit, each g⋅hg\cdot h with the loads read off the circuit. The lesson to memorize is the lecture’s: an inverter on the carry chain is paid NN times.

What breaks it: the sum stage’s load. The next bit’s sum stage reads the carry too, through its cinc_{in} input; call that load sins_{in} units. Without inverters it sits on the carry node: 2(12+sin)/6=4+sin/32(12 + s_{in})/6 = 4 + s_{in}/3. With an inverter it sits on the inverter’s output: x+2+(6+sin)/(3x)x + 2 + (6 + s_{in})/(3x), least 2+2(6+sin)/32 + 2\sqrt{(6 + s_{in})/3}. The two are equal at sin=6s_{in} = 6 (both 6 τinv6\,\tau_{inv}, with x=2x = 2), and the inverterless chain wins exactly when sin<6s_{in} < 6: when the sum stage loads the carry less than the next carry stage does. A sum stage sized for full drive, as in §5, puts sin=15s_{in} = 15 units on it (g=5g = 5), and then the inverter wins: 9 τinv9\,\tau_{inv} against 2+27=7.29 τinv2 + 2\sqrt7 = 7.29\,\tau_{inv} at x=7=2.65x = \sqrt7 = 2.65. So the lecture’s win comes with a design rule added: build the sum stage small. It is off the critical path except at the top bit, so it can afford to be slow, and a small sum stage keeps the carry wire light. FN19-3’s CloadC_{load}, “the loading of the sum circuit at each bit”, is this load: in its inverterless chain the own sum stage’s cout‾\overline{c_{out}} input and the next one’s cinc_{in} input both sit on the carry node, lumped.

Traps.

  • Inverting the carry but not the next bit’s operands. The next stage would then compute the majority of mixed polarities, cout(a1,b1,cˉ1)c_{out}(a_1, b_1, \bar c_1), which is wrong.
  • Forgetting the even bits’ sums. They come out inverted and still need an inverter, off the carry path but there.
Check yourself In the inverterless chain, which bits take inverted a and b?

The odd bits: 1, 3, 5, …. Bit 0 takes true operands, because it receives the true cinc_{in}; each bit after it receives a carry of the opposite polarity to its neighbour’s.

Check yourself FN19-3's carry chain (solved in F2, §4) has, in every stage, the carry input's device in series with one conducting device on each side, the other two inputs tied to 1 and 0. Which part of the mirror carry stage is that, and why is the stage's logical effort 2?

Step 1: with a=1a = 1 and b=0b = 0 the stage is held in propagate. The aa–bb series branch could never conduct (one of its devices is always off), so FN19-3 leaves it out; what remains is the cinc_{in} branch, cinc_{in} in series with the one conducting device of the (aa parallel bb) pair on each side. Each stage inverts its carry, as this section’s chain does. Step 2: every device is in a two-high stack, so each is twice the inverter’s width; the cinc_{in} input drives one doubled NFET and one doubled PFET, twice an inverter’s input for the same drive: g=2g = 2.

FN19-3 itself, with its delay, energy and best width, is solved in F2, §4.

8. Datapath layout: the bit stack

You need

Layout image (Chapter 9, §8). Each metal layer has a preferred routing direction, alternating up the stack: if M1 runs horizontally, M2 runs vertically, M3 horizontally, and so on. A route that must turn changes layer instead of blocking the layer it is on.

Design rules (Chapter 9, §6). Every layer has a minimum width and a minimum spacing. A routing track is one wire’s width plus one spacing: the pitch at which parallel wires can be packed.

The question. A datapath does the same thing to every bit of a word. How does that shape its layout?

The bit stack (board, 23:24–27:40)

  1. The same circuit in every bit (23:24–24:42). Datapaths are “highly structured”, so their layouts are built as a bit stack board: each block (an adder, a shifter, a logic unit LU) is cut into identical bit slices, and the blocks are stacked so that bit ii of every block lies in the same column.
  2. Data one way, control the other (24:42–25:15) board. The data run up and down through every block, on the vertical layers M2 and M4. The control signals, which tell a whole block what to do and so are shared by all its bits, come in from the side on the horizontal layers M1, M3 and M5. That is layout image at the scale of the whole datapath.
  3. One bit pitch for every block (25:15–27:40) board. The width of a slice, the bit pitch, must be the same in every block. If a shifter’s slices were narrower than the adder’s, the data wires would have to jog sideways between them (the board’s crossed-wire sketch), which costs area and wiring.
  4. Choose the pitch first. The pitch is set early, from the number of routing tracks a slice needs, each a minimum width plus a minimum spacing (“# of routing tracks”, “minimum width”, to which the board soon adds “spacings”). A more complex block then grows taller, not wider.

A datapath as a bit stack, redrawn from the board (Lecture15 @ 27:07). Every block is cut into slices of one bit pitch, bit 7 at the left; data run vertically on M2 and M4, control horizontally on M1, M3 and M5. A more complex block is taller, not wider. Right (✗): blocks of different pitch force the data wires to jog between them.

The board (Lecture15 @ 27:07)
Lightboard in cream with a cyan sketch: 'Ripple carry adders' and 'Parallel adder architectures', underlined; 'Layout ⇒ Datapath/dataflow structures'; 'Bit stack', underlined; three stacked blocks adder, shifter, LU with bit numbers 7 … 0 above; a vertical arrow 'data M2, M4' and '↔ control M1, M3, M5'; 'bit pitch' ringed, '# of routing tracks', 'minimum width' ('spacings' comes at 27:53); in cyan, two rows of slices of different pitch joined by crossing wires.
Lecture15 @ 27:07The bit stack: blocks sliced by bit, data vertical, control horizontal, and one bit pitch for all.

Fair copy of the board above (Lecture15 @ 27:07), mark for mark in its own layout. Black is the cream pen: the titles and the bit stack with its data and control notes. Teal is the cyan pen, which added the pitch notes over it: the arrow beside the adder, the ring round “bit pitch”, “# of routing tracks”, “minimum width” and the sketch of two rows with different pitches joined by bent wires. Two board slips are copied as written and marked †: the 5 among the bit numbers is written like an 8, and “minimum” is written “aimimum”. The stroke after “width” is the start of the “/” of “width/spacings”, which the lecturer is writing here.

The ripple-carry adder in a bit stack

The adder's slices (board, 27:58–30:55)

  1. Two cells per bit (27:58) board. Each bit’s slice holds a carry cell C over a sum cell S; the eight slices sit side by side.
  2. Shared rails and wells (28:57–29:44) board. Horizontal M1 rails run along the rows: VDDV_{DD} above the carry cells, ground between the carry and sum cells, VDDV_{DD} below the sum cells. The PFETs sit next to VDDV_{DD} and the NFETs next to ground, so the rows read P, N (carry), N, P (sum), and the next block below shares the bottom n-well and VDDV_{DD} rail.
  3. A power grid (29:44) board. Vertical M2 straps over the slices alternate between vdd! and gnd! (the global net names), tying the rails into a grid.
  4. Cells that wire themselves (29:57–30:55). With forethought, each carry cell’s carry-out lands where the next cell’s carry-in is, so the cells abut and the carry chain connects with very little extra metal: “they just connect together like a set of Lincoln Logs” (30:24).

The ripple-carry adder as a bit stack, redrawn from the board (Lecture15 @ 30:26). Each bit is a carry cell C over a sum cell S. M1 rails run along the rows (VDDV_{DD}, ground, VDDV_{DD}), with the PFET rows (P) beside VDDV_{DD} and the NFET rows (N) beside ground; the dashed P row is the next block’s, sharing the n-well. M2 straps alternate vdd! and gnd! to form a grid.

The board (Lecture15 @ 30:26)
Lightboard in cream, cyan and violet: the bit-stack board of 27:07 plus 'Ripple carry adder:' underlined; a row of carry cells C over a row of sum cells S; M1 rails 'M1 vdd!', 'gnd!', 'vdd!'; vertical M2 straps labelled gnd!, vdd! alternating and 'M2 vdd!'; ringed device rows at the right; 'spacings' under 'minimum widths'; a hatched track sketch at the far right.
Lecture15 @ 30:26The ripple-carry adder in a bit stack: carry and sum cells, M1 rails, M2 straps.

Fair copy of the board above (Lecture15 @ 30:26), mark for mark in its own layout, on the coordinates of the 27:07 copy. Black is the cream pen (the titles and the bit stack); teal is the cyan pen (the pitch notes of 27:07, then the carry and sum cells with their M1 rails, “spacings” and the hatched tracks at the right); magenta is the violet pen, which added the M2 straps and, in the eighth column, the ringed device rows: P, N for the carry cell and N, P for the sum cell, then the next block’s P row sharing the bottom rail. Two board slips are copied as written and marked †: the 5 among the bit numbers is written like an 8, and “minimum” is written “aimimum”. The strap labels are wider in type than the columns they sit in, so the vdd! labels are set one row above the gnd! labels.

Memorize or derive. Derive it from the meaning of a track. The facts to remember are qualitative: one pitch for all blocks, set first; data vertical, control horizontal; complexity goes into height.

A worked example added (illustrative values; the course gives no metal pitch). For example, with 8 M2 tracks per bit at a track pitch of 0.2 µm, the bit pitch is at least 8×0.2=1.68 \times 0.2 = 1.6 µm, and a 32-bit datapath is at least 32×1.6=51.232 \times 1.6 = 51.2 µm wide, in every block.

Trap. Choosing each block’s pitch for its own density. The blocks then do not line up, and every boundary between them needs jogs.

Check yourself In the same stack, a shifter needs 10 M2 tracks per bit and the adder 8. What bit pitch must the stack use, and where does the adder's spare room go?

Step 1: the pitch must fit the block that needs the most tracks, the shifter: 10 tracks, for example 10×0.2=2.010 \times 0.2 = 2.0 µm, and the 32-bit stack is then 64 µm wide. Step 2: the adder keeps that same pitch; its two spare tracks per bit stay free for routing, and any extra logic it has goes into its height.

Check yourself A 64-bit stack's densest block needs 12 tracks per bit, at 0.2 µm a track. How wide is the stack, and how much narrower would it be if that block were redesigned to need 10?

Step 1: the pitch is set by the densest block: 12×0.2=2.412 \times 0.2 = 2.4 µm, so the stack is 64×2.4=153.664 \times 2.4 = 153.6 µm wide, in every block. Step 2: at 10 tracks the pitch is 2.0 µm and the stack 128 µm: 25.6 µm narrower, for the whole datapath, because every block shares the pitch.

9. Parallel adders start from generate and propagate

You need

The full adder (§1): cout=ab+bcin+acinc_{out} = ab + bc_{in} + ac_{in} (majority), s=a⊕b⊕cins = a\oplus b\oplus c_{in} (odd parity).

The ripple’s critical path (§2). In an NN-bit ripple-carry adder the worst case is a carry made at bit 0 rippling through every bit’s carry circuit: the delay grows linearly with NN.

The 8-bit ripple’s critical path (§2; Lecture15 @ 18:06, redrawn): every bit adds a carry stage. Original figure ↑

The question. To beat the ripple, the carries must be computed without waiting for each other. What do all the faster adders start from?

From the carry to g and p (21:10–34:50)

  1. Why parallel adders (21:10–21:44, and again after the seam, 22:30–22:58). They compute the carries in parallel, paying in hardware, power and area. For small adders the ripple is hard to beat: “for like 8-bit adders or so, a ripple carry adder is probably gonna be the fastest implementation” (22:58); beyond that, parallel architectures win. The lecture shows two “historical” ones first, carry bypass and carry select (34:25), then carry lookahead, “the way these adders are really done”.
  2. Rewrite the carry (32:17–32:52) board. Factor cinc_{in} out of two terms of the majority: cout=ab+cin(a+b)c_{out} = ab + c_{in}(a + b). Name the pieces: g=abg = ab, the generate, and p=a+bp = a + b, the propagate. Then cout=g+p cinc_{out} = g + p\,c_{in}.
  3. What the names mean (32:52–33:24). If g=1g = 1 (both bits 1), the bit makes a carry whatever cinc_{in} is: it generates one. If g=0g = 0 and p=1p = 1, the bit passes cinc_{in} through: it propagates it. If both are 0, cout=0c_{out} = 0: the bit kills the carry.
  4. Two choices of propagate (33:24–33:54) board. p=a+bp = a + b or p=a⊕bp = a\oplus b. They differ only at a=b=1a = b = 1, and there g=1g = 1 already makes cout=1c_{out} = 1. So the carry comes out right with either.
  5. Only a⊕ba\oplus b gives the sum (34:00–34:22). With p=a⊕bp = a\oplus b, the sum is s=a⊕b⊕cin=p⊕cins = a\oplus b\oplus c_{in} = p\oplus c_{in}: one more XOR. With p=a+bp = a + b it fails at a=b=1a = b = 1, cin=0c_{in} = 0: the true sum is 0, but (a+b)⊕cin=1(a + b)\oplus c_{in} = 1. “That’s a very important idea that students often get confused about” (34:22). From here on, p=a⊕bp = a\oplus b.
a ba\ bg=abg = aba+ba + ba⊕ba\oplus b
00000
01011
10011
11110

The PG cell and the carry and sum from it added (equations from Lecture15 @ 33:43 and 34:50). Left: one AND and one XOR turn aa, bb into gg and pp. Right: cout=g+p cinc_{out} = g + p\,c_{in} and s=p⊕cins = p\oplus c_{in}. Every parallel adder keeps the left half for each bit and replaces the right half’s carry by something faster.

The board (Lecture15 @ 33:43)
Lightboard: 'Parallel adders', underlined; c_out = ab + ac_in + bc_in = ab + c_in(a + b), with braces naming g 'generate' under ab and p 'propagate' under a + b; 'p = a + b' and 'p = a ⊕ b' below, both whole.
Lecture15 @ 33:43Generate and propagate: cout = g + p cin, with p = a + b or a ⊕ b.

Fair copy of the board above (Lecture15 @ 33:43), mark for mark in its own layout. One pen wrote the whole board, so the copy is all black. Nothing on the board is hidden: the lecturer’s hand is below "p=a⊕bp = a\oplus b", and both lines for pp are whole. Faint remnants of the wiped bit-stack board are left out.

Memorize or derive. Memorize all four, with the condition: the carry works for either propagate, the sum only for a⊕ba\oplus b. The derivation is one line: factor cinc_{in} out of the majority.

A worked example added. a=b=cin=1a = b = c_{in} = 1: g=1g = 1, p=0p = 0; cout=1+0⋅1=1c_{out} = 1 + 0\cdot1 = 1 and s=0⊕1=1s = 0\oplus1 = 1, so the bit writes 11, which is 1+1+1=31 + 1 + 1 = 3. With p=a+b=1p = a + b = 1 instead, the sum would come out 1⊕1=01\oplus1 = 0, wrong.

Trap. Computing p=a+bp = a + b because an OR is cheaper than an XOR, and then using it for the sum (or, §10, for a bypass).

Check yourself For which inputs do a + b and a ⊕ b differ?

Only for a=b=1a = b = 1, where the OR is 1 and the XOR is 0.

Check yourself A bit has g = 0 and p = 1, and its cin rises from 0 to 1. What do cout and s do?

Step 1: cout=g+p cin=cinc_{out} = g + p\,c_{in} = c_{in}, so it follows, 0 to 1: the bit propagates. Step 2: s=p⊕cin=1⊕cins = p\oplus c_{in} = 1\oplus c_{in}, so it falls, 1 to 0.

10. Carry bypass

You need

Propagate (§9). A bit with pi=ai⊕bi=1p_i = a_i\oplus b_i = 1 passes its carry-in straight to its carry-out (gig_i is then 0). A group of bits that all have pi=1p_i = 1 passes its carry-in through all of them.

The PG cell, and the carry and sum from gg and pp (§9). Original figure ↑

A 2:1 multiplexer (mux; Chapter 10, §7 builds them). Two data inputs and a select: the output copies one input or the other, chosen by the select.

The ripple’s critical path (§2): a carry made at bit 0, rippling through every bit; (N−1) tc+tsum(N-1)\,t_c + t_{sum} to the top sum.

Stage delays added, all in τinv\tau_{inv}: tct_c is one carry stage’s delay (carry-in to carry-out), tsumt_{sum} one sum stage’s, tmuxt_{mux} one 2:1 mux’s and tPGt_{PG} one PG cell’s.

The question. If a whole group of bits propagates, its carry-out is simply its carry-in. Can a wire around the group skip the ripple?

The bypass adder (board, 35:16–38:50)

  1. One group (35:16–36:29) board. Take a 4-bit group of the ripple adder. If p0p_0 to p3p_3 are all 1, the carry-in will reach the group’s end anyway, through four carry circuits. A mux at the group’s end chooses between the rippled carry-out and the group’s carry-in, carried around the group on a bypass wire; its select is P=p3p2p1p0P = p_3p_2p_1p_0 board. When P=1P = 1 the carry skips the group in one mux delay.
  2. Sixteen bits (36:29–37:21). Four groups, each with its bypass mux; the last group’s mux gives coutc_{out}.
  3. The critical path (37:21–38:24). A carry that bypasses everything is fast. The slow case starts and ends with a ripple: a carry generated at bit 0 cannot bypass group 0 (with g0=1g_0 = 1, p0=0p_0 = 0, so P=0P = 0). It ripples through group 0’s four bits and passes group 0’s mux; groups 1 and 2 propagate fully, so it bypasses each in one mux delay; then it ripples through group 3 to the top sum s15s_{15}.
  4. The lecturer’s count (38:24): “two ripples through four, and then two mux delays”, against sixteen carry stages. The careful count added adds two details: the path also passes group 0’s mux (the board draws one there), and in group 3 the carry into bit 15 needs only three carry circuits (c12c_{12} to c15c_{15}), then the sum. With the PG cells first (the select needs the pip_i, and the carry cells use gg, pp), the path is tPG+4tc+3tmux+3tc+tsumt_{PG} + 4t_c + 3t_{mux} + 3t_c + t_{sum}.
  5. “Historical” (34:25). Bypass adders are rarely used now, but finding their critical path is the reasoning every faster adder needs.

A 16-bit carry-bypass adder, redrawn from the board (Lecture15 @ 38:48). Each 4-bit group has a mux that passes the group’s carry-in straight on when every bit propagates (P=p3p2p1p0=1P = p_3p_2p_1p_0 = 1); the last one gives coutc_{out}. The bypass wires, which the board runs under the groups, are drawn as arcs over them; the board’s own violet arcs mark the critical path. The thick line is the critical path: generated at bit 0, rippling through group 0, through its mux, bypassing groups 1 and 2, and rippling through group 3 to s15s_{15}.

The board (Lecture15 @ 38:48)
Lightboard in cyan with violet arcs: 'Parallel adders'; c_out = ab + ac_in + bc_in; 'Carry bypass adder' ringed and underlined; four groups of four full adders right to left with p_3, p_2, p_1, p_0 over the first group, a mux at each group's end, four in all, the last giving c_out, with 'p₃p₂p₁p₀' under the first; the bypass wires in cyan under each group; violet arcs over groups 1 and 2 and a violet line, the critical path, ending in a sum arrow at the left; 'critical path?' underlined. The lecturer's body dims the left end.
Lecture15 @ 38:48Carry bypass: four groups, each with a mux selected by the AND of its propagates; the violet arcs mark the critical path.

Fair copy of the board above (Lecture15 @ 38:48), mark for mark in its own layout. Black is the cyan pen, which drew the adder: four groups of four full adders with a mux at the end of each group, fed by the group’s rippled carry and by its carry-in on the wire under the group. Magenta is the violet pen’s critical path: rippling through the first group, then along two arcs from mux to mux over the second and third groups, then rippling through the last group to the top sum. The board’s tiny FA labels inside the boxes are left out. The title’s first letter is written like a K (†): read “Carry”. The left end, dimmed behind the lecturer here, is read from 38:25.

Memorize or derive. Derive it by tracing: ripple out of the first group, one mux per group after that up to the last, ripple into the top bit, one sum.

A worked example added. Take, for example, tc=tsum=tmux=4 τinvt_c = t_{sum} = t_{mux} = 4\,\tau_{inv} and tPG=2 τinvt_{PG} = 2\,\tau_{inv}. Sixteen bits in groups of 4: 2+16+12+12+4=46 τinv2 + 16 + 12 + 12 + 4 = 46\,\tau_{inv}, against the ripple’s 15×4+4=64 τinv15 \times 4 + 4 = 64\,\tau_{inv}. The lecturer’s round count, 8tc+2tmux8t_c + 2t_{mux}, gives 40 τinv40\,\tau_{inv}.

The carry-out added. The same carry, generated at bit 0, reaches coutc_{out} through all four muxes, with no ripple at the end: tPG+4tc+4tmux=2+16+16=34 τinvt_{PG} + 4t_c + 4t_{mux} = 2 + 16 + 16 = 34\,\tau_{inv}, sooner than s15s_{15}. The top sum, not the carry-out, sets the clock.

Why the select must use p=a⊕bp = a\oplus b added. The lecture allows “A or B, or A XOR B” (35:30); for a bypass, only XOR works. Take a=1111a = 1111, b=1000b = 1000, cin=0c_{in} = 0. The true sum is 23, binary 10111, so the group’s carry-out is 1 (bit 3 generates it). With OR-propagate every bit has ai+bi=1a_i + b_i = 1, so P=1P = 1, and the mux passes the carry-in, 0: wrong. With XOR-propagate, p3=1⊕1=0p_3 = 1\oplus1 = 0, so P=0P = 0, and the mux takes the rippled carry, 1: right. A group with P=1P = 1 under XOR has no generating bit, so its carry-out really is its carry-in.

Traps.

  • Counting only the skipped groups’ muxes. The path also passes the first group’s mux: three muxes for four groups.
  • Taking the bypass path as the critical one. A carry that bypasses every group is the fast case; the slow one starts and ends with a ripple.
Check yourself Which input pattern makes group 1 (bits 4–7) bypass its carry?

P1=p7p6p5p4=1P_1 = p_7p_6p_5p_4 = 1: in each of bits 4 to 7 exactly one of aia_i, bib_i is 1 (ai⊕bi=1a_i\oplus b_i = 1).

Check yourself With the example delays, how long does a 64-bit bypass adder in groups of 4 take, and how does that compare with a 64-bit ripple adder?

Step 1: N/M−1=15N/M - 1 = 15 muxes, so t=2+16+15×4+12+4=94 τinvt = 2 + 16 + 15 \times 4 + 12 + 4 = 94\,\tau_{inv}. Step 2: the ripple takes 63×4+4=256 τinv63 \times 4 + 4 = 256\,\tau_{inv}. The bypass is still linear in NN (one mux per group), but with a slope of tmuxt_{mux} per four bits instead of tct_c per bit.

11. Carry select

You need

PG and the sum (§9): gi=aibig_i = a_ib_i, pi=ai⊕bip_i = a_i\oplus b_i, and the sum si=pi⊕cis_i = p_i\oplus c_i, where cic_i is the carry into bit ii.

The PG cell, and the carry and sum from gg and pp (§9). Original figure ↑

A 2:1 multiplexer (Chapter 10, §7): the select picks one of two inputs.

Critical-path reasoning (§10). Follow the slowest signal through the blocks, counting each block it must wait for once; blocks that work at the same time count once together.

Stage delays added, all in τinv\tau_{inv}: tct_c is one carry stage’s delay (carry-in to carry-out), tsumt_{sum} one sum stage’s, tmuxt_{mux} one 2:1 mux’s and tPGt_{PG} one PG cell’s.

The question. Instead of waiting to learn a group’s carry-in, compute the group’s carries for both possible carry-ins in advance, and choose when the real one arrives. How fast is that?

The select adder (board, 39:24–43:26)

  1. One bin of four (39:24–40:30) board. Bits 3–0: a PG generator, then two carry chains fed the same gg, pp: the “0 carry” chain assumes a carry-in of 0, the “1 carry” chain a carry-in of 1.
  2. Select (40:30–41:29) board. A mux on the real cinc_{in} picks one chain’s carries. This is speculation: half the work is thrown away, “hence the name select”.
  3. The sums (41:29–41:49). The sum generator needs only the pip_i and the chosen carries (“I don’t need the G’s”), because p=a⊕bp = a\oplus b gives si=pi⊕cis_i = p_i\oplus c_i (§9).
  4. Sixteen bits (41:49–42:42) board. Bins 7–4, 11–8 and 15–12 repeat the bin. Each bin’s carry-out, from its mux, is the select of the next bin’s mux; the last mux gives coutc_{out}.
  5. The critical path (42:42–43:26). All the bins’ chains run at the same time, right after PG. Then the muxes work in series: bin 0’s mux on cinc_{in}, then bin 1’s on bin 0’s carry-out, and so on. So: PG, one 4-bit chain, four muxes, and the top bin’s sum.

A 16-bit carry-select adder, redrawn from the board (Lecture15 @ 43:39). In every 4-bit bin, two carry chains compute the carries for a carry-in of 0 and of 1, at the same time; a mux, selected by the previous bin’s carry-out, picks one set, and the sum box forms si=pi⊕cis_i = p_i\oplus c_i. The thick line is the critical path: PG, one chain, the four muxes in series, and the top bin’s sum.

The board (Lecture15 @ 43:39)
Lightboard in violet with a cyan path: 'Parallel adders'; 'Carry select' with 'select' boxed; four bins labelled 15–12, 11–8, 7–4 and 3–0; in bin 3–0 'P/G', '0 carry ← “0”', '1 carry ← “1”', a mux with c_in and its carry out (written 'Cay'), 'S'; the other bins drawn as D shapes, bin 7–4's upper blocks washed out by the lecturer's raised hand; the cyan critical path from above bin 3–0's P/G box down through it, along the muxes and down to the top bin's sum.
Lecture15 @ 43:39Carry select: two speculative chains per bin, a mux on the real carry, and the critical path.

Fair copy of the board above (Lecture15 @ 43:39), mark for mark in its own layout. Black is the violet pen: the bins, their blocks (boxes in bin 3–0, D shapes in the others), the muxes and the select chain, and the pale title. Teal is the cyan pen: the title’s underline and the critical path, added last, from bin 3–0’s P/G down into its mux, along the select chain and down through bin 15–12. Two slips are copied as written and marked †: the 1 of “1 carry” is drawn with a hook and reads like a 2 (the quoted input “1” and the speech at 40:14 settle it as 1), and the carry-out at bin 3–0’s mux is written “Cay” for coutc_{out}. Bin 7–4’s upper blocks, washed out by the lecturer’s raised hand here, are copied from 42:40, as is the select wire under the cyan path.

Memorize or derive. Derive by tracing: one chain (they all run at once), then every mux (they run in series), then one sum.

A worked example added (the same example delays as §10: tc=tsum=tmux=4t_c = t_{sum} = t_{mux} = 4, tPG=2 τinvt_{PG} = 2\,\tau_{inv}). Sixteen bits in bins of 4: 2+16+16+4=38 τinv2 + 16 + 16 + 4 = 38\,\tau_{inv}, against bypass 46 and ripple 64. At 64 bits: 86 τinv86\,\tau_{inv}, and now the chain of 16 muxes is 64 of those 86. The mux chain is linear in NN; a tree (§13) avoids it.

Trap. Counting bin 0’s mux as free because cinc_{in} is known early. The mux still has to wait for bin 0’s chains to finish before it can pass their carries on.

Check yourself How much hardware does carry select add to a ripple adder, per bin, and what does it buy at 16 bits with the example delays?

Step 1: per bin, a second carry chain and a mux (and the PG cells, if the ripple’s full adders did not have them). Step 2: at 16 bits the delay falls from 6464 to 38 τinv38\,\tau_{inv}, for roughly twice the carry hardware.

Check yourself At 64 bits the bin size M is free. With the example delays, which M makes tPG + M tc + (N/M) tmux + tsum smallest, and what is the delay?

Step 1: bigger bins lengthen the one chain on the path (MtcMt_c) but shorten the mux chain ((N/M)tmux(N/M)t_{mux}); the sum of the two is least where they are equal, Mtc=(N/M)tmuxMt_c = (N/M)t_{mux}, so M=Ntmux/tc=64=8M = \sqrt{Nt_{mux}/t_c} = \sqrt{64} = 8. Step 2: 2+32+32+4=70 τinv2 + 32 + 32 + 4 = 70\,\tau_{inv}, against 86 with bins of 4 (and 86 again with bins of 16).

12. Carry lookahead: unrolling the carry

You need

Generate, propagate and the carry (§9). For bit ii: gi=aibig_i = a_ib_i (the bit makes a carry), pi=ai⊕bip_i = a_i\oplus b_i (the bit passes its carry-in on), and the bit’s carry-out is gi+pig_i + p_i times its carry-in. The sum is pip_i XOR the carry into the bit.

The PG cell and the carry and sum from gg and pp (§9). Original figure ↑

Carry numbering (this section and §13). cic_i is the carry into bit ii: c0=cinc_0 = c_{in}, bit 0’s carry-out is c1c_1, and bit ii‘s carry-out is ci+1c_{i+1}. So si=pi⊕cis_i = p_i\oplus c_i, and a 4-bit group’s carry-out is c4c_4.

The question. Each carry depends on the one before it, which is why it ripples. Can we write every carry directly from the gg‘s, pp‘s and cinc_{in}, so that all of them are computed at once?

Unrolling (board, 44:10–47:59)

  1. The recursion (44:10–44:52) board. In the new numbering, bit ii‘s carry-out is ci+1=gi+picic_{i+1} = g_i + p_ic_i. Each carry needs the one below it: that is the ripple.

  2. Substitute (44:58–46:49) board, “⇒ unroll”. Put each carry into the next:

    c1=g0+p0cinc2=g1+p1c1=g1+p1(g0+p0cin)=g1+p1g0+p1p0cinc3=g2+p2c2=g2+p2g1+p2p1g0+p2p1p0cinc4=g3+p3c3=g3+p3g2+p3p2g1+p3p2p1g0+p3p2p1p0cin\begin{aligned} c_1 &= g_0 + p_0c_{in}\\ c_2 &= g_1 + p_1c_1 = g_1 + p_1(g_0 + p_0c_{in})\\ &= g_1 + p_1g_0 + p_1p_0c_{in}\\ c_3 &= g_2 + p_2c_2 = g_2 + p_2g_1 + p_2p_1g_0 + p_2p_1p_0c_{in}\\ c_4 &= g_3 + p_3c_3\\ &= g_3 + p_3g_2 + p_3p_2g_1 + p_3p_2p_1g_0 + p_3p_2p_1p_0c_{in} \end{aligned}

    Every carry is now a sum of products of the gg‘s, pp‘s and cinc_{in}: two levels of logic, with no carry waiting for another. Four bits at a time is called radix 4 board.

  3. Read each line in words. c4c_4 is 1 if bit 3 generates; or bit 2 generates and bit 3 propagates; or bit 1 generates and bits 3 and 2 propagate; or bit 0 generates and bits 3 to 1 propagate; or cinc_{in} is 1 and all four bits propagate. Each term is “a carry made here, passed by everything above”.

  4. Group generate and propagate (47:15–47:59) board. Each line has the shape G+P cinG + P\,c_{in}. The board braces them for c2c_2: G=g1+p1g0G = g_1 + p_1g_0 and P=p1p0P = p_1p_0; for c3c_3: G=g2+p2g1+p2p1g0G = g_2 + p_2g_1 + p_2p_1g_0 and P=p2p1p0P = p_2p_1p_0. The group generate GG says the group makes a carry by itself; the group propagate PP says it passes cinc_{in} through. They are gg and pp again, one level up.

The board (Lecture15 @ 48:01)
Lightboard in blue: 'Parallel adders'; c_(i+1) = g_i + p_i c_i '⇒ unroll'; c_0 = c_in; c_1 = g_0 + p_0 c_in; c_2 and c_3 unrolled with braces marking G and P; 'radix-4' underlined; c_4's two lines partly behind the lecturer.
Lecture15 @ 48:01The unrolled carries c₁ to c₄, radix 4, with the braces for group generate G and group propagate P.

Fair copy of the board above (Lecture15 @ 48:01), mark for mark in its own layout. All black: one blue pen wrote the board (the title and its underline are left from 33:43). c4c_4’s lines lie over the lecturer’s striped shirt here, which washes them out; their terms are read on 47:09, where they are clear, and the G bracket over the second line and the start of the P bracket under the last, new at 48:01, on a frame at 48:15. Two slips are copied as written and marked †: "p2p1s0p_2p_1s_0" for p2p1g0p_2p_1g_0 and "p3s2p_3s_2" for p3g2p_3g_2. The fourth term’s p3p_3 is written over a first attempt. The lines are levelled; on the board they drift down to the right.

Groups of four, and groups of groups

For the four bits added (the bit range in the subscript, high index first):

G3:0=g3+p3g2+p3p2g1+p3p2p1g0,P3:0=p3p2p1p0,c4=G3:0+P3:0 cin.\begin{gathered} G_{3:0} = g_3 + p_3g_2 + p_3p_2g_1 + p_3p_2p_1g_0,\qquad P_{3:0} = p_3p_2p_1p_0,\\ c_4 = G_{3:0} + P_{3:0}\,c_{in}. \end{gathered}

The smallest case is two bits added: c2=G1:0+P1:0cinc_2 = G_{1:0} + P_{1:0}c_{in} with G1:0=g1+p1g0G_{1:0} = g_1 + p_1g_0 and P1:0=p1p0P_{1:0} = p_1p_0. Read the formula with “bit 1” and “bit 0” replaced by “the upper group” and “the lower group”: the pair generates if the upper part generates, or the lower part generates and the upper part propagates; it propagates if both parts do. That is the radix-2 element:

G=Ghi+PhiGlo,P=PhiPlo.G = G_{hi} + P_{hi}G_{lo},\qquad P = P_{hi}P_{lo}.

It combines any two adjacent groups, of any size, into one. Two 2-bit groups give the 4-bit group: G3:2+P3:2G1:0=(g3+p3g2)+p3p2(g1+p1g0)G_{3:2} + P_{3:2}G_{1:0} = (g_3 + p_3g_2) + p_3p_2(g_1 + p_1g_0), which is G3:0G_{3:0} term by term, and P3:2P1:0=P3:0P_{3:2}P_{1:0} = P_{3:0}. And the carry-in can join as a group of its own below bit 0, with (G,P)=(cin,0)(G, P) = (c_{in}, 0): it “generates” exactly when cin=1c_{in} = 1 and passes nothing through. Combining bit 0 with it gives (g0+p0cin, 0)=(c1,0)(g_0 + p_0c_{in},\ 0) = (c_1, 0): the carry into bit 1. So the carry into any bit is the group generate of everything below it, the carry-in included. Chapter 17’s radix-2 trees, and FN17-8’s adder, are networks of this one element.

The radix-2 element added. Main: it combines an upper group (Ghi,Phi)(G_{hi}, P_{hi}) and the adjacent lower group (Glo,Plo)(G_{lo}, P_{lo}) into one group. Middle: applied to two bits, it gives the two-bit group terms of the board’s c2c_2. Right: with the carry-in entered as the group (cin,0)(c_{in}, 0), it gives the carry c1=g0+p0cinc_1 = g_0 + p_0c_{in} and a propagate of 0 (the box’s equations are written inside it).

Memorize or derive. Memorize the recursion ci+1=gi+picic_{i+1} = g_i + p_ic_i and the radix-2 element. Derive c2c_2 to c4c_4 by substitution (three lines), and G3:0G_{3:0}, P3:0P_{3:0} by reading off the coefficient of cinc_{in}.

A worked example

An added example added: a=1011a = 1011 (11), b=0110b = 0110 (6), cin=0c_{in} = 0.

bit ii3210
aia_i1011
bib_i0110
gi=aibig_i = a_ib_i0010
pi=ai⊕bip_i = a_i\oplus b_i1101
cic_i (into bit ii)1100
si=pi⊕cis_i = p_i\oplus c_i0001

1011 + 0110 by lookahead

  1. PG. Because every carry formula needs only gg and pp: g3g2g1g0=0010g_3g_2g_1g_0 = 0010 and p3p2p1p0=1101p_3p_2p_1p_0 = 1101.
  2. The carries, each from its unrolled formula. c1=g0+p0cin=0+1⋅0=0c_1 = g_0 + p_0c_{in} = 0 + 1\cdot0 = 0. c2=g1+⋯=1c_2 = g_1 + \dots = 1, since g1=1g_1 = 1. c3=g2+p2g1+⋯=0+1⋅1=1c_3 = g_2 + p_2g_1 + \dots = 0 + 1\cdot1 = 1. c4=g3+p3g2+p3p2g1+⋯=0+0+1⋅1⋅1=1c_4 = g_3 + p_3g_2 + p_3p_2g_1 + \dots = 0 + 0 + 1\cdot1\cdot1 = 1. None waited for another.
  3. The sums. si=pi⊕cis_i = p_i\oplus c_i: 1, 0, 0, 0 from bit 0 up, so s=0001s = 0001, and cout=c4=1c_{out} = c_4 = 1. The answer is binary 10001, which is 17, and 11+6=1711 + 6 = 17.
  4. The group terms. G3:0=1G_{3:0} = 1 (the group makes its own carry, at bit 1, and bits 2 and 3 pass it) and P3:0=0P_{3:0} = 0 (bit 1 does not propagate). So c4=1+0⋅cin=1c_4 = 1 + 0\cdot c_{in} = 1 whatever cinc_{in} is.

A second case, all-propagate: a=1011a = 1011, b=0100b = 0100, cin=1c_{in} = 1. Then g=0000g = 0000 and p=1111p = 1111, so G3:0=0G_{3:0} = 0 and P3:0=1P_{3:0} = 1: the group passes cinc_{in} straight through. Every carry is 1, s=0000s = 0000 and cout=1c_{out} = 1: binary 10000, which is 16, and 11+4+1=1611 + 4 + 1 = 16.

Check. The ripple of §2 gives the same carries bit by bit: in the first example bit 0 adds 1+0+01 + 0 + 0 (no carry), bit 1 adds 1+1+01 + 1 + 0 (carry), bit 2 adds 0+1+10 + 1 + 1 (carry), bit 3 adds 1+0+11 + 0 + 1 (carry): c1,c2,c3,c4=0,1,1,1c_1, c_2, c_3, c_4 = 0, 1, 1, 1, as in the table. (The page’s test compares the two on all 512 inputs of a 4-bit adder.)

Traps.

  • Off by one in the carries. cic_i is the carry into bit ii, so si=pi⊕cis_i = p_i\oplus c_i and c4c_4 is the 4-bit group’s carry-out. Wiring sis_i from ci+1c_{i+1} shifts every sum one place. Past papers number bits differently (FN17-8 counts its bits from 1, with the carry-in at position 0), so settle the numbering before wiring a sum.
  • Putting cinc_{in} inside PP. PP is the coefficient of cinc_{in}, p1p0p_1p_0, as the board’s brace marks it (the brace stops at cinc_{in}), so that the carry is G+P cinG + P\,c_{in}. Fold cinc_{in} into PP and the group no longer combines with its neighbour by P=PhiPloP = P_{hi}P_{lo}.
Check yourself Write c3 fully unrolled.

c3=g2+p2g1+p2p1g0+p2p1p0cinc_3 = g_2 + p_2g_1 + p_2p_1g_0 + p_2p_1p_0c_{in}: a carry made at bit 2, or at bit 1 and passed by bit 2, or at bit 0 and passed by bits 1 and 2, or the carry-in passed by all three.

Check yourself An 8-bit group is two 4-bit groups. Write G7:0 and P7:0 with the radix-2 element, say in words when the 8-bit group generates, and evaluate it for (G7:4, P7:4) = (0, 1) and (G3:0, P3:0) = (1, 0).

Step 1: G7:0=G7:4+P7:4G3:0G_{7:0} = G_{7:4} + P_{7:4}G_{3:0} and P7:0=P7:4P3:0P_{7:0} = P_{7:4}P_{3:0}: the byte generates if its upper half generates, or its lower half generates and every bit of the upper half propagates. Step 2: G7:0=0+1⋅1=1G_{7:0} = 0 + 1\cdot1 = 1 and P7:0=1⋅0=0P_{7:0} = 1\cdot0 = 0: the carry made in the lower half passes through the upper half, so the byte’s carry-out is 1 whatever its carry-in.

Check yourself Start from the carry-in as the group (cin, 0) and apply the radix-2 element twice, first with bit 0 and then with bit 1. What do you get, and what does the order of the combinations do to the delay?

Step 1: (g0,p0)(g_0, p_0) with (cin,0)(c_{in}, 0) gives (g0+p0cin, 0)=(c1,0)(g_0 + p_0c_{in},\ 0) = (c_1, 0); then (g1,p1)(g_1, p_1) with (c1,0)(c_1, 0) gives (g1+p1c1, 0)=(c2,0)(g_1 + p_1c_1,\ 0) = (c_2, 0), the board’s c2c_2. Step 2: combined one bit at a time like this, the elements form a chain, one after another: the ripple again. A tree (§13, Chapter 17) combines the same pairs in a different order, so that each carry passes far fewer elements.

13. The radix-4 lookahead unit and the tree adder

You need

Group generate and propagate (§12). Four bits’ carries can be computed at once from their gig_i, pip_i and the carry-in: c1=g0+p0cinc_1 = g_0 + p_0c_{in} up to c4=G3:0+P3:0cinc_4 = G_{3:0} + P_{3:0}c_{in}, with G3:0=g3+p3g2+p3p2g1+p3p2p1g0G_{3:0} = g_3 + p_3g_2 + p_3p_2g_1 + p_3p_2p_1g_0 (the group makes a carry) and P3:0=p3p2p1p0P_{3:0} = p_3p_2p_1p_0 (the group passes cinc_{in}). The same formulas work with groups in place of bits.

The radix-2 element (§12): two adjacent groups make one. Original figure ↑

The PG cell and the sum (§9): each bit makes gi=aibig_i = a_ib_i and pi=ai⊕bip_i = a_i\oplus b_i, and, once its carry cic_i is known, si=pi⊕cis_i = p_i\oplus c_i.

The PG cell, and the carry and sum from gg and pp (§9). Original figure ↑

Stage delays added, all in τinv\tau_{inv}: tct_c is one carry stage’s delay (carry-in to carry-out), tsumt_{sum} one sum stage’s, tmuxt_{mux} one 2:1 mux’s and tPGt_{PG} one PG cell’s; tLAt_{LA} is the delay through one lookahead unit.

The question. Lookahead computes four carries at once. How do we build a 16-bit or 64-bit adder from it without rippling again?

From one unit to a tree (board, 48:52–54:50)

  1. The radix-4 lookahead unit (48:52–50:44) board. One block, “LA (radix-4)”, holds §12’s logic. Below it sit four cells, one per bit. Each cell takes aia_i, bib_i and sends pip_i, gig_i up to the LA; the LA sends each cell its carry cic_i back down; the cell gives sis_i. For four bits the critical path is: PG in the cells, the LA, the sum in the cells.
  2. Sixteen bits, rippled (50:44–51:38) board. Four units in a row, each unit’s coutc_{out} into the next unit’s carry-in. It works, but each unit must wait for the one before: the carry ripples again, four bits at a step. “Not great”.
  3. A second level (51:38–53:15) board. Each first-level unit can also give its group’s GG and PP, which do not depend on its carry-in. Put one more LA unit, the same logic, over the four: it takes the four groups’ (G,P)(G, P) and cinc_{in} and returns the group carries c4c_4, c8c_8, c12c_{12} and coutc_{out}, all at once, exactly as the first level returns bit carries.
  4. The critical path (53:23–54:07). aa, bb into the cells (PG); up to the first level (GG, PP); up to the second level (group carries); back down to the first level, which now has its carry-in and makes the bit carries; down to the cells (sums). This is a tree, radix 4: a tree adder.
  5. Counting the LA delays added. Rippled units put N/4N/4 LA delays on the path. A tree of LL levels puts 2L−12L - 1: up through LL levels, then back down through L−1L - 1 (the top level’s carries go straight out). Sixteen bits: rippled 4, tree 3. Sixty-four bits: rippled 16, tree 5. The tree’s count grows with log⁡4N\log_4 N.
  6. What comes next (54:07–54:50). Radix-2 trees, Brent–Kung and Kogge–Stone, built from §12’s two-group element: the next lecture (Chapter 17).

A radix-4 lookahead unit over its four cells, redrawn from the board (Lecture15 @ 51:37, as first drawn at 50:17). Each cell sends its pip_i, gig_i up (labelled on bit 0); the LA returns the carries c0c_0 to c3c_3 (and coutc_{out}) all at once; each cell then forms si=pi⊕cis_i = p_i\oplus c_i. The carry labels are added.

Sixteen bits from four lookahead units in a row, redrawn from the board (Lecture15 @ 51:37). Each unit waits for the carry-out of the one before it: the thick line is the rippled path through c4c_4, c8c_8, c12c_{12} to coutc_{out} (labels added), one LA delay per four bits.

The board (Lecture15 @ 51:37)
Lightboard in blue: 'Parallel adders'; four LA blocks in a row, the right one labelled 'LA (radix-4)', with c_in at the right and c_out at the left and carries between the blocks; four cells under the right block with 'p a b g', carry arrows down into them and 'S' outputs.
Lecture15 @ 51:37Four radix-4 lookahead units rippled: the right one with its four cells.

Fair copy of the board above (Lecture15 @ 51:37), mark for mark in its own layout. All black: one blue pen wrote the board (the title and its underline are left from 33:43). The three blocks at the left are the rippled lookahead units, still unlabelled; the lecturer’s arm crosses them here, and every stroke matches 53:45, where he stands clear. Only the right cell is labelled on the board (“p a b g”).

A 16-bit radix-4 lookahead tree, redrawn from the board (Lecture15 @ 53:45; the labels c4c_4, c8c_8, c12c_{12} are added, and the top unit is drawn wide, with straight wires, where the board draws it narrow with curves). The first-level units send their groups’ GG, PP up; the second-level unit returns the group carries; each first-level unit then makes its bit carries. The thick line is a critical path: PG, up two levels, down one, and the sum: three LA delays.

The board (Lecture15 @ 54:50)
Lightboard in blue and violet: the top LA with c_out and c_in; four first-level LA blocks with their 'PG' pairs going up and curved carries coming down; the cells and 'S' outputs; 'tree' underlined, '(radix-4)', and 'radix-2' underlined. The lecturer stands in front of the middle.
Lecture15 @ 54:50The radix-4 tree: a second-level LA over four first-level units, and 'radix-2' for next time.

Fair copy of the board above (Lecture15 @ 54:50), mark for mark in its own layout: the 51:37 board grown into a tree. All black: one blue pen (it looks violet towards the left edge, where the light shifts its hue). The title, the ripple arrows between the blocks, and the radix-4 unit’s own cinc_{in} and coutc_{out} are erased by now; the unit keeps a stub of its coutc_{out} wire. The lecturer stands in front of the middle, and his shirt washes out the strokes there: the curves above the third block and the right unit’s left cell are copied from 53:45, where they are clear. The board writes each pair “PG”; they are set as PP and GG.

Memorize or derive. Derive both by tracing the board’s path: up LL levels for the group terms, down L−1L - 1 for the carries. What to memorize is the shape: rippled units are linear in NN, a tree is logarithmic.

Comparing the five adders

An added comparison added, with the same example stage delays as §10 and §11 (tc=tsum=tmux=4t_c = t_{sum} = t_{mux} = 4, tPG=2t_{PG} = 2) and, for example, tLA=10 τinvt_{LA} = 10\,\tau_{inv} (a radix-4 unit is a two-level gate with up to five-input terms, so slower than one carry stage). These are illustrations of the path counts, not the course’s numbers.

AdderCritical path8 bits16 bits64 bits
ripple(N−1)tc+tsum(N-1)t_c + t_{sum}3264256
bypass (groups of 4)tPG+4tc+(N/4−1)tmux+3tc+tsumt_{PG} + 4t_c + (N/4 - 1)t_{mux} + 3t_c + t_{sum}384694
select (bins of 4)tPG+4tc+(N/4)tmux+tsumt_{PG} + 4t_c + (N/4)t_{mux} + t_{sum}303886
LA units rippledtPG+(N/4)tLA+tsumt_{PG} + (N/4)t_{LA} + t_{sum}2646166
radix-4 treetPG+(2L−1)tLA+tsumt_{PG} + (2L - 1)t_{LA} + t_{sum}363656

The five adders’ critical paths added, computed from the path counts with example stage delays tc=tsum=tmux=4t_c = t_{sum} = t_{mux} = 4, tPG=2t_{PG} = 2 and tLA=10 τinvt_{LA} = 10\,\tau_{inv}. RCA: ripple carry; CBA: carry bypass; CSA: carry select (not the carry-save adder of multipliers); LA×4, LA×16: lookahead units rippled. Left, 16 bits; right, 64 bits. The tree pulls away as NN grows; the others are linear in NN.

What the numbers say. At 16 bits the tree is fastest (2+30+4=36 τinv2 + 30 + 4 = 36\,\tau_{inv}), with select close behind (38). At 64 bits the tree takes 56 against 86 for select and 256 for ripple: logarithmic against linear. At 8 bits all five are within a few stage delays of each other (26 to 38), and which one wins depends on the stage delays assumed. That is where the lecturer places the ripple’s limit, “8-bit adders or so”; the example numbers neither confirm nor contradict that rule of thumb.

Check. Count the LA units on the tree’s thick path: the rightmost first-level unit, the second-level unit, the leftmost first-level unit. Three, which is 2L−12L - 1 with L=2L = 2.

Traps.

  • Counting the tree’s levels once. The carries come back down through the first level: 2L−12L - 1 LA delays, not LL.
  • Using the second level’s carries as bit carries. They are group carries (c4c_4, c8c_8, c12c_{12}); the first-level units still turn them into the carries of each bit.
Check yourself How many radix-4 lookahead units does a 64-bit tree need, and how many levels?

16 units over the bits, 4 over those, 1 at the top: 21 units in 3 levels.

Check yourself With the example delays, at what width does the radix-4 tree first beat the ripple adder: 4, 8 or 16 bits?

Step 1: at 4 bits the tree is one unit: 2+10+4=162 + 10 + 4 = 16, and the ripple 3×4+4=163 \times 4 + 4 = 16: a tie. Step 2: at 8 bits the tree needs two levels, 2+30+4=362 + 30 + 4 = 36, against the ripple’s 32: slower. At 16 bits the tree still has two levels, 36, against 64: it wins from 16 bits.

On the exam

Adders carry little direct weight in the past finals. One part is new to this chapter, FN17-8 (15 points), which it shares with Chapter 17; the others are already solved elsewhere in the guide, and this chapter supplies the adder background they lean on.

PartPointsWhat it asksSections
FN17-815an 8-bit parallel adder built from PG generators, radix-2 lookahead elements and sum generators, and its critical path§9, §12 (the radix-2 element and the (cin,0)(c_{in}, 0) entry), §13; the prefix network in Chapter 17
FN19-3a–d39a static ripple-carry chain: delay, energy, best width§7 (it is this chain, held in propagate), §5
FN12-10b9a full adder in NP domino, Z=ABC+Yˉ(A+B+C)Z = ABC + \bar Y(A + B + C)§4 (the sum identity), §1
MT24-5a15the Sum and Carry of a dynamic full adder§1, §4
MT23-2b, HW4-3b16, —carry and XOR in pass-transistor and CPL logic§1

FN17-8 is solved, with its own figure and key, on the datapath practice page (FD1). What this chapter prepares: the three kinds of block are §9’s PG cell, §12’s radix-2 element and §9’s sum si=pi⊕cis_i = p_i\oplus c_i; the carry into each bit is the group generate of everything below it, with the carry-in entered as (cin,0)(c_{in}, 0) (§12); and the critical path runs up the network and out through a sum (§13). Chapter 17 adds the radix-2 network itself. At the finals’ pace of 0.7–0.9 minutes a point, it is a 10–14 minute part.

Memorize.

  • cout=ab+bcin+acinc_{out} = ab + bc_{in} + ac_{in} (majority) and s=a⊕b⊕cins = a\oplus b\oplus c_{in} (odd parity).
  • Self-dual: fˉ(a,b,c)=f(aˉ,bˉ,cˉ)\bar f(a, b, c) = f(\bar a, \bar b, \bar c); both outputs have it, so each gate’s pull-up can mirror its pull-down. s=abcin+cout‾(a+b+cin)s = abc_{in} + \overline{c_{out}}(a + b + c_{in}).
  • The late input, cinc_{in}, goes next to the output.
  • g=abg = ab, p=a⊕bp = a\oplus b (not a+ba + b, for the sum or a bypass); cout=g+p cinc_{out} = g + p\,c_{in}; s=p⊕cins = p\oplus c_{in}.
  • ci+1=gi+picic_{i+1} = g_i + p_ic_i, with cic_i the carry into bit ii; two groups combine as (Ghi+PhiGlo, PhiPlo)(G_{hi} + P_{hi}G_{lo},\ P_{hi}P_{lo}).
  • Each architecture’s critical path in words: ripple (every carry), bypass (ripple, muxes, ripple), select (one chain, every mux), tree (up, down, sum).

Derive (with the path).

  • The unrolled carries. Substitute ci+1=gi+picic_{i+1} = g_i + p_ic_i into itself three times; read GG and PP as the terms without and with cinc_{in}.
  • The radix-2 element. The two-bit case c2=g1+p1g0+p1p0cinc_2 = g_1 + p_1g_0 + p_1p_0c_{in}, with groups in place of bits.
  • The carry chain per bit. Gains g⋅hg\cdot h from the loads: without inverters 2×12/6=42 \times 12/6 = 4; with an inverter of size xx, x+2+2/x≥2+22x + 2 + 2/x \ge 2 + 2\sqrt2; the next sum stage’s load decides.
  • The critical-path counts of ripple, bypass, select, rippled lookahead and the tree, by tracing.

Method card. The playbook’s adder-architecture card: recognize a block diagram of PG, lookahead and sum blocks, or “draw the critical path”; moves PG, then carries as G+PcG + Pc, then sums p⊕cp\oplus c, marking the path up and down the tree; traps, the carry index and p=a⊕bp = a\oplus b.

The lecture’s boards

The boards of Lecture 15 used in this chapter (25 frames)