17. Prefix adders and shifters: radix-2 trees, shifters and control logic
Lecture 16 finishes the adders and moves on to the other datapath blocks. Chapter 16 ended with a radix-4 lookahead tree. This lecture builds trees out of the smallest possible block, the radix-2 element, which merges two adjacent groups of bits into one. Because the element is associative, the carries can be computed by many different networks of it. The lecture draws the two classic ones, Kogge–Stone and Brent–Kung, and compares them: the first is fast and regular, the second small. The textbook name for these adders is prefix adders, because every carry turns out to be a prefix of the row of bits. The lecture then turns to shifters: the three kinds of shift, the logarithmic shifter built from rows of multiplexers, and the barrel shifter built from a grid of pass transistors with a one-hot select. It ends with control logic: why it is synthesized, how the synthesis and place-and-route flow runs, and why the course builds its control logic as a PLA instead (Chapter 18).
After this chapter you can:
- combine two adjacent groups with the radix-2 element, in the right order, and say why any bracketing works;
- say which group each carry and each sum needs, with the carry-in entered as ;
- draw the Kogge–Stone and Brent–Kung networks for a given width and count their elements, levels and fan-outs;
- say which is faster and which is smaller, and why;
- draw a complete prefix adder (PG cells, network, sums) and its critical path;
- shift a word logically, arithmetically and by rotation, and explain sign extension;
- build a logarithmic shifter from 2:1 multiplexers, logical or arithmetic, and find its stack height;
- build a barrel shifter from pass transistors and explain why its select must be one-hot;
- describe the two ways to build control logic and the synthesis and place-and-route flow;
- say what a PLA implements (two-level sum-of-products logic) and where Chapter 18 takes it up.
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. Chapter 16 built the pieces this chapter assembles. Each bit of an adder has a PG cell that makes its generate (the bit makes a carry by itself) and its propagate (the bit passes an incoming carry on); the bit’s carry out is and its sum is (Chapter 16, §9). A group of bits behaves like one big bit, with a group generate and group propagate , and two adjacent groups merge into one by the radix-2 element (Chapter 16, §12). A lookahead tree computes the carries in a number of steps that grows with , not (Chapter 16, §13). Delays are counted in levels, the number of elements a signal passes in series, as Chapter 16 counted lookahead units. Where a delay is given in (the fan-out-of-one inverter delay, the course’s unit), it uses example values, labelled “for example”: a PG cell , a sum XOR (Chapter 16’s) and one element , the same as one carry stage, since an element’s is the carry stage’s one level up.
Bit numbering. This chapter numbers the bits from 1, as the board and FN17-8 do, with the carry-in at position 0. Chapter 16 numbered them from 0. The carry wires keep their names: here, the carry out of bit , is the same wire as Chapter 16’s . The sum’s index shifts: here , there .
Symbols
| Symbol | Meaning | Unit | First appears |
|---|---|---|---|
| , | bit of the two operands, ; bit 1 is the least significant (the board’s and FN17-8’s numbering; Chapter 16’s bit ) | — | §2 |
| , | the adder’s carry in (position 0) and carry out () | — | §1, §2 |
| , | generate and propagate of bit (Chapter 16 §9) | — | §1 |
| , | the board’s names for the element’s two inputs: unprimed the higher group, primed the lower | — | §1 |
| , | group generate and propagate of positions to , high index first; the board writes the span low–high, “–” | — | §1 |
| , | the element’s higher and lower inputs in the chapter’s form | — | §1 |
| the radix-2 element (the circle drawn inside the board’s box) | — | §1 | |
| the carry-in entered as a group of its own at position 0: it generates when and propagates nothing | — | §1, §2 | |
| , the carry out of bit (the board’s ); the same wire as Chapter 16’s | — | §2 | |
| sum bit : , with | — | §2 | |
| the number of bits (§2–§4) or of positions (§5); the number of bits of a shifter (§8–§9) | — | §2 | |
| level | one element on a signal’s path; a network’s depth is its number of levels | — | §2 |
| , , | the delays of one element added, one PG cell and one sum XOR (Chapter 16) | §5 | |
| the fan-out-of-one inverter delay, the unit of delay | ps | §5 | |
| KS, BK | Kogge–Stone, Brent–Kung | — | §3, §4 |
| MSB, LSB | the most and least significant bits of a word | — | §7 |
| bit of a shifter’s input word, the LSB (the board’s ) | — | §7 | |
| bit of the logarithmic shifter’s output | — | §8 | |
| a select bit: encoded in the logarithmic shifter (§8); one-hot in the barrel shifter (§9) | — | §8 | |
| sel, | a 2:1 multiplexer’s select and its complement | — | §8 |
| bit of the barrel shifter’s output | — | §9 | |
| stack height | the number of devices a signal’s charge passes in series, its driver included | — | §8 |
| RTL, SOP, PLA, P&R, STA, GDS | register-transfer level; sum of products; programmable logic array; place and route; static timing analysis; the layout file that goes to the foundry | — | §10 |
1. The radix-2 element and why its order matters
You need
Generate and propagate (Chapter 16, §9). One bit with operands , has and . If , the bit makes a carry whatever comes in; if and , it passes its incoming carry through; if both are 0 it kills the carry. Its carry out is .
Groups (Chapter 16, §12). A run of bits behaves like one big bit: its carry out is . For two bits, (bit 1 generates, or bit 0 generates and bit 1 passes it) and (both pass).
The question. A tree adder needs one small block it can repeat everywhere. What is the smallest block that merges the carry information of two groups, and what rules must a tree of such blocks follow?
The element (board, 00:53–03:32)
- Where we are (00:53–02:03) board. The lecture opens with a recap: the ripple-carry adder, then the parallel architectures, carry bypass, carry select and the radix-4 lookahead tree. Today, radix-2 trees: “Brent–Kung” and “Kogge–Stone” (both ringed on the board at 03:32).
- The block (02:03–02:47) board. A square box with a small circle inside. A pair enters from the left, a pair from below, and leaves on the right. Read it as Chapter 16’s two-bit group with groups in place of bits: the left input is the higher group, the primed input from below the lower one. The output generates if the higher group generates, or if the lower group generates and the higher group passes it on; it propagates only if both do.
- Spans added. Name a group by the positions it covers, high index first: and cover positions to . The element merges two spans that touch, the higher on the left: . In the chapter’s form, .
- Associativity (02:47–03:10). The lecturer’s key claim: “I can combine them and associate them in any way I choose … and ultimately you get the same answer” (03:00). Three adjacent groups , , (highest first) give the same result whether and are merged first or and . The derivation is below.
- Not commutative added. The two inputs cannot be swapped. A killing high group, , over a generating low group, , gives : the carry made below is killed above it. Swap them and : a carry appears that the real bit order never makes. Of the nine ordered pairs of possible inputs ( cannot occur, since a bit’s and are never both 1, and a group’s means no bit in it generates), two change when swapped: exactly the kill-over-generate pair of this example, in either order. Bracket as you like; never swap.
The radix-2 element as the board draws it (Lecture16 @ 03:32). The higher group enters from the left, the lower group from below, and the element returns . The second line under each label is the chapter’s form: .
The board (Lecture16 @ 03:32)

Fair copy of the board above (Lecture16 @ 03:32), mark for mark in its own layout. All black: the violet pen wrote the recap at the left, from “Lecture 16” to “lookahead”; the cream pen wrote the double rule and the right half, the next topic, and boxed “lookahead” on the recap with its branch to “radix-4” and “tree”. The board writes “ripple” with its i shrunk to a dot and its l to a tick; it is set in full. “architectures” trails off after “architec” into a squiggle, copied as it stands.
Any two adjacent spans merge in one element added: the higher span 8:5 enters from the left, the lower span 4:0 from below, and the result is the span 8:0, (and ). Position 0 is the carry-in.
Memorize or derive. Memorize the element: it is FN17-8’s “radix-two lookahead element”, , , with groups for bits. Derive associativity added by expanding both bracketings of three groups , , (highest first):
Both are “a carry made in , or made in and passed by , or made in and passed by and ”: the same group. That is what lets a tree replace the chain: any bracketing of the same bits in the same order gives the same carry.
A worked example added. Bits 3, 2, 1 with , , : bit 3 passes, bit 2 generates, bit 1 passes. Bracketed from the top, . Bracketed from the bottom, . Both say the group 3:1 generates a carry and does not propagate one: bit 2 makes the carry and bit 3 passes it, and bit 2’s blocks any carry from below.
Traps.
- Putting the lower group on the left. The result is the group of a different bit order; the counter-example in step 5 shows it can invent a carry.
- Reading the board’s primes as “later” or “the output”. They mark the lower group, nothing else.
Check yourself What (G, P) does a group have whose every bit propagates (each gk = 0, pk = 1)?
: no bit generates, so the group makes no carry of its own, and every bit passes, so it passes its carry-in through. Merging two such groups gives again.
Check yourself Combine a group (Ghi, Phi) with the carry-in entered as (cin, 0) below it. What comes out, and what is it?
Step 1: . Step 2: the first half is Chapter 16’s group carry, : the group’s carry out with this carry-in. The propagate is 0 because the carry-in is already inside the span; nothing below it is left to pass on.
2. Every carry is a prefix: the serial chain
You need
The element and its order (§1). Two adjacent spans merge, the higher on the left: . Any bracketing works; the order of the spans does not change.
The sum (Chapter 16, §9). A bit’s sum is , where and is the carry into the bit.
The ripple (Chapter 16, §2). In a ripple-carry adder each carry waits for the one below it, so the delay grows linearly with the number of bits.
The question. What exactly must a carry network produce, and how fast could any network of radix-2 elements possibly produce it?
The target (board, 03:53–05:21; framing added)
- The inputs (03:53–04:46) board. Eight bits, numbered 1 to 8 from the bottom. Each enters the network as its from its PG cell. The carry-in enters at the bottom as the pair (05:21): position 0.
- The goal (04:55–05:21). Every carry, in parallel. The first is one element: , “my carry, my C1, my carry out of my first bit position” (05:38). Its span is 1:0.
- Every carry is a prefix added. In the same way, the carry out of bit is the group generate of everything from position 0 to bit : . Each is a prefix of the row of positions, which is why these are called prefix adders; the lecture calls them radix-2 tree adders. Since position 0 has , for every : only the half of a carry span matters.
- The sums added. Bit adds its own to the carry into it, which is the carry out of the bit below: and . In Chapter 16’s numbering, where bit there is bit here, this is ; only the label moved.
- The serial chain added. The simplest network makes the prefixes one after another: , then , and so on, . Eight elements in a line, 8 levels to . Each element is Chapter 16’s carry stage, : this is the ripple-carry adder again.
- How fast a tree could be added. By associativity, can be bracketed any way, for example . But each element has only two inputs, so after one level a signal depends on at most 2 positions, after two on at most 4, after levels on at most . depends on the positions 0 to , so it needs at least levels. For , nine positions: is too few, so at least 4 levels.
Every carry is a prefix added: , the group generate from bit down to the carry-in at position 0. Made one element after another, , each element adds one bit to the span: this is the ripple-carry adder, eight levels in series for eight bits.
Memorize or derive. Memorize and : the sum takes the carry of the bit below. Derive the bound in two lines: an element at most doubles the number of positions a signal depends on, and depends on of them.
A worked example added. (6), (3), , through the serial chain.
| bit | 4 | 3 | 2 | 1 |
|---|---|---|---|---|
| 0 | 1 | 1 | 0 | |
| 0 | 0 | 1 | 1 | |
| (0, 0) | (0, 1) | (1, 0) | (0, 1) | |
| (out of bit ) | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
; (bit 2 generates); (bit 3 passes it); (bit 4 kills it). Sums from bit 1 up: , , , . So with , and . §6 gets the same carries from a tree.
Traps.
- . is the carry out of bit ; using it shifts every sum one place up. With and it gives , but has .
- Leaving out the carry-in. A network over bits 1 to alone computes , which are the carries only when . Position 0 is what makes the adder take a carry in.
Check yourself Which two signals does s5 need, and which span is its carry?
from bit 5’s PG cell and , the carry out of bit 4: .
Check yourself Why can no network of radix-2 elements deliver C8 in 3 levels, however it is wired?
Step 1: depends on nine positions, and bits 1 to 8. Step 2: each element has two inputs, so after 3 levels a signal can depend on at most positions. Nine do not fit; 4 levels () do.
3. The Kogge–Stone adder
You need
The element and its order (§1): , the higher span on the left, the lower from below; the spans must touch.
What the network must produce (§2). The carry out of bit is the prefix , with the carry-in entered as at position 0. Any network needs at least levels for ; the serial chain takes .
The question. How can the eight carries be built so that every one of them arrives as early as the bound allows?
The idea is doubling. After one column of elements, each row holds a span of 2 positions; after the second, 4; after the third, 8. A row stops as soon as its span reaches position 0, because it then holds its carry. The board builds it column by column (05:21–09:58) board; the table lists every row’s span after each column.
Kogge–Stone, column by column (board, 05:21–09:58)
- Column 1 (05:21–06:46). Every row merges with the row directly below it: 1:0 (bit 1 with , giving ), then 2:1, 3:2, 4:3, 5:4, 6:5, 7:6, 8:7. Eight elements.
- Column 2 (06:46–07:31). Each unfinished row merges with the row two below: 2:0 = 2:1 ∘ gives ; 3:0 = 3:2 ∘ 1:0 gives ; then 4:1 = 4:3 ∘ 2:1, 5:2, 6:3, 7:4 and 8:5. Seven elements; rows 1 to 3 are done.
- Column 3 (07:31–09:32). Each unfinished row merges with the row four below: 4:0 = 4:1 ∘ , 5:0 = 5:2 ∘ 1:0, 6:0 = 6:3 ∘ 2:0, 7:0 = 7:4 ∘ 3:0, and 8:1 = 8:5 ∘ 4:1. Five elements; rows 4 to 7 are done.
- Column 4 (09:32–09:58). Row 8 merges with the row eight below: 8:0 = 8:1 ∘ gives . One element. The rule: in column , every unfinished row merges with the row below it.
- What the lecturer likes about it (09:58–11:47). “This is Kogge–Stone. Has this particular pattern, this particular regularity” (10:28). Every element’s output drives one or two other elements (the last carries, 4:0 to 8:0, drive none), so “very relatively consistent fan out, which means that the sizing of these blocks can be … much more uniform” (11:38): one element design serves everywhere. The one exception is not an element: the carry-in entry, a primary input, drives four, 1:0, 2:0, 4:0 and 8:0, which is why the board writes twice.
- How deep each carry is added. is 1 level deep, and are 2, to are 3, and is 4: every carry meets its bound from §2. No radix-2 network does better.
| row | after column 1 | column 2 | column 3 | column 4 | depth of |
|---|---|---|---|---|---|
| 8 | 8:7 | 8:5 | 8:1 | 8:0 | 4 |
| 7 | 7:6 | 7:4 | 7:0 | 3 | |
| 6 | 6:5 | 6:3 | 6:0 | 3 | |
| 5 | 5:4 | 5:2 | 5:0 | 3 | |
| 4 | 4:3 | 4:1 | 4:0 | 3 | |
| 3 | 3:2 | 3:0 | 2 | ||
| 2 | 2:1 | 2:0 | 2 | ||
| 1 | 1:0 | 1 |
The Kogge–Stone network as the board builds it (Lecture16 @ 10:41), redrawn. Each row is a bit position, bit 1 at the bottom; the carry-in enters once, as the pair in row 0 at the bottom, where the board writes it twice. Each element takes its higher input along its own row from the left and its lower input on a diagonal from a lower row; the label above each output is its span, high index first (the board writes 0–8 for 8:0). Column (grey numbers, added) combines spans rows apart. Row ends in the carry . 21 elements, 4 levels.
The board (Lecture16 @ 10:41)

Fair copy of the board above (Lecture16 @ 10:41), mark for mark in its own layout. All black: one cream pen wrote the network, and the right half is 03:32’s, with “Tree adders” now boxed. The three small strokes at the top left are what is left of the wiped recap. Span labels are copied as the board writes them, low index first (“7–8” is the span 8:7); where a diagonal crosses a label, the label sits on a white patch. The lecturer’s 7 looks like a 2 throughout (in “7–8”, “6–7”, and ), and the title’s gg look like ss; they are set as 7 and “Kogge”. The lower input of the 8:5 element carries its arrowhead at its row-6 end, as drawn.
The cone of added: the Kogge–Stone network (Lecture16 @ 10:41, redrawn) with the eight elements that build drawn thick: 8:7, 6:5, 4:3 and 2:1 in column 1, 8:5 and 4:1 in column 2, 8:1 in column 3 and 8:0 in column 4. They form a balanced binary tree over the nine inputs, so is four levels deep.
Memorize or derive. Memorize the rule (column reaches rows down). Derive the counts: in column the rows to are already finished, so the other rows each get an element. For 8 bits that is .
A worked example added. The board’s network has 21 elements in 4 levels, with carry depths 1, 2, 2, 3, 3, 3, 3, 4 for to . A 16-bit Kogge–Stone with a carry-in has 17 positions: levels and elements. Check: the cone of in the figure is a balanced tree over nine leaves, eight elements and four levels deep, which is the bound for nine positions.
Traps.
- Merging with the row directly below in every column. That is the serial chain again: each column then adds only one position.
- Reading the board’s top label “2–8” as a span from 2. It is 7–8 (the lecturer’s 7 has a crossbar and curl); the element sits in column 1 of row 8, so it can only be 8:7.
Check yourself Which two spans make 6:0 in the Kogge–Stone network, and in which column?
6:3 (row 6 after column 2) and 2:0 (row 2’s finished carry, four rows below): , in column 3.
Check yourself In a 16-bit Kogge–Stone with a carry-in, at which level does C11 arrive, and which two spans make it?
Step 1: covers 12 positions, so it needs levels, and Kogge–Stone meets the bound. Step 2: after three columns row 11 holds 11:4 (eight positions); column 4 merges it with the row eight below, row 3, which holds 3:0: .
4. The Brent–Kung adder
You need
The element and the target (§1, §2). Two touching spans merge, the higher on the left: . The network must produce every carry , with the carry-in as at position 0, and needs at least 4 levels.
The Kogge–Stone network (§3). Column merges each unfinished row with the row below: 21 elements, 4 levels, every carry as early as possible.
The question. Kogge–Stone spends 21 elements on 8 carries. Many of its spans, such as 5:2 or 6:3, are used once and thrown away. Can a network reuse a few spans and get by with far fewer elements?
The idea is to build power-of-two spans from position 0 (2:0, 4:0, then 8:0) and fill in the other carries from them. The lecturer motivates it before drawing it: “I’ll have many, many fewer of these look-ahead blocks in the Brent–Kung than I have in the Kogge–Stone” (11:56).
Brent–Kung on the same eight bits (board, 13:24–16:51)
- Pairs (13:24–14:19) board. 1:0 = bit 1 ∘ , which is already . Then the pairs 4:3, 6:5 and 8:7. Bit 2 is not paired: it joins 1:0 directly in the next step.
- Powers of two from 0 (14:21–14:52) board. 2:0 = bit 2 ∘ 1:0 gives ; 4:0 = 4:3 ∘ 2:0 gives .
- Fill in (14:52–16:51) board. 3:0 = bit 3 ∘ 2:0 (); 5:0 = bit 5 ∘ 4:0; 6:0 = 6:5 ∘ 4:0; 7:5 = bit 7 ∘ 6:5, then 7:0 = 7:5 ∘ 4:0; 8:5 = 8:7 ∘ 6:5, then 8:0 = 8:5 ∘ 4:0. Each lower input rises on a vertical wire from a lower row. Thirteen elements.
- The price: fan-out (14:59–15:26, 17:02–17:29). The reused spans drive many loads. “The fan out here is very irregular, right? Look at this guy here. It fans out here, here, here, here, and here” (17:19): the 4:0 node drives 5:0, 6:0, 7:0, 8:0 and the output, five loads. The 2:0 node drives three (3:0, 4:0 and ), and so does the 6:5 node (6:0, 7:5 and 8:5).
- How deep each carry is added. 1 level, 2, and 3, to 4. arrives at level 4, as in Kogge–Stone, but and to are a level later than their bound.
- The board’s variant added. The strict Brent–Kung pattern would make 7:0 as bit 7 ∘ 6:0: one element fewer (12), but 6:0 is already 4 levels deep, so 7:0 would be 5. The board spends the extra element 7:5 to keep every carry within 4 levels. This chapter teaches the board’s network; §5’s general counts use the strict pattern.
The Brent–Kung network as the board builds it (Lecture16 @ 17:54; , behind the lecturer’s hands there, from 17:26), redrawn. The rows and inputs are those of the Kogge–Stone figure, with the carry-in drawn once in row 0; each lower input rises on a vertical wire from a lower row. Pairs (4:3, 6:5, 8:7) and the chain 1:0, 2:0, 4:0 go up; 4:0 then serves 5:0, 6:0, 7:0 and 8:0. Spans are written high index first (the board writes 0–8 for 8:0). 13 elements, 4 levels.
The board (Lecture16 @ 17:54)

Fair copy of the board above (Lecture16 @ 17:54), mark for mark in its own layout. All black: one cream pen wrote the board; the small strokes at the top left and top middle are left from the wiped boards. and the end of its wire, under the lecturer’s hands here, are copied from 17:26. Span labels are copied as the board writes them, low index first (“0–4” is the span 4:0). The lecturer’s 7 looks like a 2 (in “0–7”), his 8 like a 6 over an o (in “5–8”) or a 9 (in ), and the g of “Kung” like a y; they are set as what they are. The lower input of the 3:0 element is a short stroke that stops below the element, as drawn.
Fan-out in the Brent–Kung network added (Lecture16 @ 17:54, redrawn). The 4:0 node (thickest) drives four elements, 5:0, 6:0, 7:0 and 8:0, and the output : a fan-out of 5. The 2:0 node (3:0, 4:0 and ) and the 6:5 node (6:0, 7:5 and 8:5) drive three each (medium). Kogge–Stone’s element outputs drive at most three, counting a carry output (its carry-in entry, a primary input, drives four).
Memorize or derive. Memorize the shape: pair up, build 2:0, 4:0, 8:0 from position 0, then fill in. Derive the element count and each carry’s depth by drawing it; there is no new formula here.
A worked example added. Counted on the board’s network: 13 elements against Kogge–Stone’s 21; carry depths 1, 2, 3, 3, 4, 4, 4, 4 against 1, 2, 2, 3, 3, 3, 3, 4; the largest fan-out of an element output 5 against 3 (Kogge–Stone’s carry-in entry, a primary input, drives four). Check: add one element per new carry and per pair: the four pair elements (1:0, 4:3, 6:5, 8:7), the seven other carries (2:0 to 8:0) and the two helpers 7:5 and 8:5 make .
Traps.
- “Fewer elements, so fewer levels.” The elements saved are the parallel ones. The chain through 4:0 gets longer, and the 4:0 node is heavily loaded.
- Pairing bit 2 with bit 1. On the board 1:0 already contains ; bit 2 joins it directly as 2:0, and the pairs start at 4:3.
Check yourself Which two spans make 6:0 in the Brent–Kung network?
6:5 (the pair of bits 6 and 5) and 4:0: .
Check yourself Suppose the 4:0 node is slow because of its load. Which carries wait for it, and which sums does that delay?
Step 1: is the node itself, and 5:0, 6:0, 7:0 and 8:0 all take it as their lower input: to wait. Step 2: the sums that use them are to (each takes ), and . Only to are unaffected.
5. Kogge–Stone against Brent–Kung: levels, elements, fan-out
You need
The two networks (§3, §4). Kogge–Stone merges each row with the row below in column : 21 elements for 8 bits, every carry at its bound. Brent–Kung pairs up, builds 2:0, 4:0, 8:0 and fills in: 13 elements, but several carries a level later, and the 4:0 node drives five loads.
Load and sizing (Chapter 8, §1). A gate’s delay grows with the capacitance it drives, its electrical effort , unless the gate is made larger. A node with many loads is slow or needs a bigger driver; a design in which every node has about the same load can use one size everywhere.
The question. Both 8-bit networks deliver in 4 levels. Which is faster, which is smaller, and how does the difference grow with the width?
The comparison (spoken 11:07–12:22 and 17:02–17:40; numbers added)
- What the lecturer says (11:07–12:22, 17:02–17:40). Kogge–Stone is regular, and every element’s output drives “either two or one” others, so the elements can be sized uniformly (11:38). Brent–Kung has “many, many fewer” elements (11:56), is “much more area efficient” (12:04) and takes “much less area” (17:38), but its fan-out is very irregular, so its elements need several sizes. Every advantage he gives Brent–Kung is about area.
- Each carry’s depth added. Kogge–Stone 1, 2, 2, 3, 3, 3, 3, 4; Brent–Kung 1, 2, 3, 3, 4, 4, 4, 4. The sum needs , so , , and wait one level longer in Brent–Kung (they need , , and ). does not: is at level 3 in both.
- Example delays added. With the PG cell’s delay , one element’s and the sum XOR’s (for example; is the fan-out-of-one inverter delay), the top sum is ready at in Kogge–Stone ( at level 3) and at in Brent–Kung ( at level 4). is at in both. The serial chain of §2 reaches at : Chapter 16’s ripple count, , plus the PG cell in front.
- Growth with the width added. For positions, a power of 2, Kogge–Stone takes levels and elements; the strict Brent–Kung pattern takes levels and elements. At 64 positions that is 6 levels against 10, and 321 elements against 120.
- Wiring added. Kogge–Stone’s other cost is its wires. On the 8-bit board, column runs lower-input wires, each rows long: the board’s long diagonals. Summed per lower input, the lower-input wires span 50 row pitches in Kogge–Stone and 21 in Brent–Kung. Brent–Kung shares some verticals (4:0’s single wire up to 8:0 feeds four elements), so its true wiring is shorter still.
- The verdict. Kogge–Stone is the faster adder: every carry at the bound, low and even fan-out. Brent–Kung is the smaller one: fewer elements, less area, fewer long wires, but more levels for half the carries at 8 bits (, , , ) and for most of them from 32 positions on, and loaded nodes.
The level at which each carry is ready added, computed from the two board networks (Lecture16 @ 10:41 and 17:54). Kogge–Stone (solid) reaches every carry at the lower bound ; Brent–Kung (hatched) matches it at , , and but delivers and – one level later, so the sums and – wait longer.
Levels (left) and elements (right) against the number of positions added, computed from the general constructions ( a power of 2): Kogge–Stone needs levels and elements; the strict Brent–Kung pattern needs levels and elements. Brent–Kung’s levels grow twice as fast; at 64 positions it has 120 elements against 321.
| positions | 4 | 8 | 16 | 32 | 64 |
|---|---|---|---|---|---|
| KS levels | 2 | 3 | 4 | 5 | 6 |
| KS elements | 5 | 17 | 49 | 129 | 321 |
| BK levels | 2 | 4 | 6 | 8 | 10 |
| BK elements | 4 | 11 | 26 | 57 | 120 |
The board’s 8-bit adders have 9 positions (with ), so they fall between the table’s 8 and 16 columns: 21 and 13 elements, 4 levels each (§3, §4).
Memorize or derive. Memorize the verdict: Kogge–Stone fast and regular but large, Brent–Kung small but deeper and irregular. Derive the counts when needed. Kogge–Stone: columns, and column has elements, so the total is . Brent–Kung: the up-sweep builds the power-of-two spans in levels with elements; the down-sweep fills in the other carries in more levels with elements.
A worked example added. Take positions. Kogge–Stone: four columns, combining rows 1, 2, 4 and 8 apart, of , , and elements: elements in 4 levels. Brent–Kung: the up-sweep builds the power-of-two spans with elements in 4 levels and makes four of the 15 carries (1:0, 3:0, 7:0, 15:0); the down-sweep adds one element for each of the other , the last of them (14:0) at level 6. So 26 elements and 6 levels. Check: the formulas give and elements, and levels, as in the table; the gap of 2 levels is , which is 0 at and opens from .
Traps.
- “Brent–Kung is faster.” The lecturer once says so (12:45), right after listing its area savings; the boards and the counts say otherwise. Brent–Kung is the smaller adder, never the faster one.
- Comparing only . In the 8-bit networks both put at level 4; the difference is in the carries the sums need.
Check yourself At 32 positions, how many more elements does Kogge–Stone use than Brent–Kung?
: Kogge–Stone , Brent–Kung .
Check yourself For a 64-position adder with the example element delay te = 4 τinv, how much sooner is Kogge–Stone's last carry than Brent–Kung's, counting levels only?
Step 1: levels: Kogge–Stone , Brent–Kung . Step 2: sooner. The PG cell and the sum XOR are the same in both, so they cancel.
6. The whole prefix adder: PG, network, sums
You need
The PG cell and the sum (Chapter 16, §9). Each bit’s PG cell makes and ; the sum is XOR the carry into the bit. The propagate must be the XOR, not , because the sum reuses it.
The carries (§2). is the carry out of bit , with the carry-in as at position 0; so and .
A network (§3). Kogge–Stone: in column each unfinished row merges with the row below.
The question. FN17-8 asks for the complete adder, not only the network. How do the PG cells, the network and the sum XORs connect, and where is the critical path?
The lecture draws only the networks. The assembly is added here added, at 4 bits so that every wire can be checked by hand. It is drawn as FN17-8’s paper draws its adder: the highest bit at the left, so the carry-in comes in from the right.
A 4-bit Kogge–Stone adder (added)
- Three rows of blocks. At the bottom, one PG cell per bit. In the middle, the network over positions 0 to 4. At the top, one sum XOR per bit. enters the network at position 0.
- The network. Kogge–Stone over five positions: level 1 makes 1:0, 2:1, 3:2 and 4:3; level 2 makes 2:0 (2:1 ∘ ), 3:0 (3:2 ∘ 1:0) and 4:1 (4:3 ∘ 2:1); level 3 makes 4:0 (4:1 ∘ ). Eight elements, 3 levels.
- The sums. , , , , and . Each sum takes its on a wire straight up from its own PG cell, past the network, and its carry from the column of the bit below it, which in this drawing is the column to its right.
- The critical path. Trace each output back to the inputs. needs , which is 2 levels deep: → PG → 3:2 → 3:0 → , so (the delays of the PG cell, one element and the sum XOR, §5). needs , 3 levels deep: → PG → 4:3 → 4:1 → 4:0, so . With the example values both are . Which one is “the” critical path depends on the sum XOR against one element: if the top sum is, otherwise is. On the exam, mark both and say why.
A 4-bit prefix adder added, drawn with bit 4 at the left as FN17-8’s paper draws its adder. Bottom: the PG cells give . Middle: a 4-bit Kogge–Stone network in three levels (grey numbers); each element takes its higher input from below and its lower input from the right, and the carry-in enters at the right as . Top: each sum XOR forms , so it takes its carry from the column to its right ( takes ). Thick: the path to the top sum, through bit 3’s PG cell, 3:2 and 3:0 (two levels). Thick dashed: the path to , through 4:3, 4:1 and 4:0 (three levels).
Memorize or derive. Derive by tracing: PG, then the levels of the carry the output needs, then the sum (or nothing, for ). Remember only that the top sum needs , not .
A worked example added. §2’s addition, now through the tree: , , , so bits 1 to 4 have , , , .
| level | span | inputs (higher ∘ lower) | |
|---|---|---|---|
| 1 | 1:0 | (0, 0) | |
| 1 | 2:1 | (1, 0) | |
| 1 | 3:2 | (1, 0) | |
| 1 | 4:3 | (0, 0) | |
| 2 | 2:0 | 2:1 ∘ = | (1, 0) |
| 2 | 3:0 | 3:2 ∘ 1:0 = | (1, 0) |
| 2 | 4:1 | 4:3 ∘ 2:1 = | (0, 0) |
| 3 | 4:0 | 4:1 ∘ = | (0, 0) |
The carries are the of the spans ending at 0: . The sums: , , , , so and . Check: the serial chain of §2 gave the same carries, 0, 1, 1, 0, one bit at a time; and . Note 4:1: bit 4 kills the carry that bit 2 makes, so the span from 1 to 4 neither generates nor propagates.
Traps.
- , the sums one position too high. It is the commonest slip in drawing this adder: wiring each sum to the carry span of its own column, , instead of the one below, . With and it gives , but . In a 4-bit adder this wiring gets 350 of the 512 possible additions wrong.
- Feeding the sums from the network’s outputs. The sums need each bit’s own , straight from its PG cell, and only the of the carry span.
Check yourself Which block does C4 feed in the 4-bit adder?
No sum: it is the carry out, . The top sum takes .
Check yourself In the board's 8-bit Kogge–Stone adder, which sums are the last to have their carries, and at what level? With the example delays, when is s8 ready?
Step 1: to take to , which arrive at level 3 (and , take , at level 2). Step 2: is ready at , the same time as ().
7. Shifters: logical, arithmetic, rotator
You need
Two’s complement (Chapter 15, §11). In an -bit two’s-complement word the MSB carries the weight , so a word with MSB 1 is negative. To negate, invert every bit and add 1: , so .
Place value added. Moving every bit one place toward the MSB doubles an unsigned number ( becomes ); moving every bit one place toward the LSB halves it and drops the old LSB.
The question. A shifter slides a word’s bits left or right by some number of places. The bits that fall off one end are lost or reused, and the open end must be filled with something. What fills it, and why does the answer depend on what the word means?
Three kinds of shift (board, 17:40–22:47)
- Logical (18:40–19:51) board. Shift either way and fill the open end with 0. The word is treated as a pattern of bits.
- Arithmetic (19:51–21:37) board. A left shift fills with 0 and multiplies by 2 (“shift by 1”, on the board). A right shift must divide by 2 and keep the sign: “If I divide minus four, I want to get minus two” (21:07). So the right shift fills the open MSB end with a copy of the MSB, sign extension: becomes , while a logical shift would give .
- Rotator (21:37–22:33) board. The bit that falls off one end comes back in at the other; nothing is lost. “Very commonly used in signal processing applications.”
- One word, three ways added. Shift ( in two’s complement; 182 unsigned) right by 2. Logical: , a positive number. Arithmetic: . Rotate: , the two dropped bits 10 now at the top.
- Rounding added. An arithmetic right shift by gives , rounding down. For by 2: , and , which is the arithmetic result. Rounding toward zero would give .
The three kinds of shift, redrawn from the board (Lecture16 @ 22:11), top to bottom. Logical: the word moves left or right and a 0 enters the end being vacated. Arithmetic: a left shift (×2) brings a 0 into the LSB; a right shift (÷2) copies the MSB back into itself, so the sign is kept (sign extension). Rotator: the bit leaving one end enters the other, in either direction.
The board (Lecture16 @ 22:11)

Fair copy of the board above (Lecture16 @ 22:11), mark for mark in its own layout. One pen (cyan) wrote the whole board, copied in black. The rotator box’s msb end and the outer loop’s arrowhead, under the lecturer’s hand here (he is finishing that arrowhead), are restored from the video at 22:14–22:40; the board is wiped by 23:16. The double arrow after “arithmetic” sits a little right of the board’s, because the typeset word runs wider.
One word shifted right by 2 three ways added. ( as a signed number), then, top to bottom: logically (two 0s enter at the MSB end: , the sign is lost), arithmetically (two copies of the MSB enter: , the floor of ), and rotated (the two bits that fall off the LSB end re-enter at the MSB end: ). The shaded cells are the bits each shift brings in.
Memorize or derive. Memorize the three fill rules: logical 0; arithmetic 0 on the left, a copy of the MSB on the right; rotate, the bit that fell off. Derive the rounding: each one-place shift halves the value and drops the LSB, which removes when that bit was 1, so the result moves down, for a negative number away from zero.
A worked example (the board’s and an added one). Board: right by 1 with sign extension gives (21:07). Added: the three shifts of in step 4; check the arithmetic one by value, , and .
Traps.
- A logical right shift of a negative number. () becomes : the sign is lost.
- Expecting . It is : becomes , and . The shift rounds down, not toward zero.
Check yourself Rotate 1011 0110 right by 3.
: the three bits that fall off the LSB end, 110, re-enter at the MSB end in the same order.
Check yourself What does an arithmetic right shift by 1 do to −1 = 1111 1111, and why is that the floor of −1/2?
Step 1: the bits move one place right and the MSB, 1, is copied in: again, which is . Step 2: , and : the shift rounds down, so never shifts to 0.
8. The logarithmic shifter
You need
The 2:1 multiplexer (Chapter 10, §7). A select line picks one of two inputs and connects it to the output.
Pass transistors (Chapter 10, §4–§5). An NFET used as a switch passes a 0 fully but a 1 only up to . An NFET and a PFET in parallel, gated by complementary signals (a transmission gate), pass both levels fully. A pass transistor has no supply of its own: its signal comes from the gate that drives it.
Stacks (Chapter 7, §5; Chapter 8, §10). Devices in series add their resistance, and the delay through a stack grows roughly as the square of its height; stacks taller than about three are avoided. Here the stack height of a path is the number of devices its charge passes in series: the driver’s device plus each pass transistor.
The kinds of shift (§7). A logical right shift fills the open MSB end with 0; an arithmetic one copies the MSB.
The question. A shifter must move an 8-bit word right by any amount from 0 to 7. Building eight separate shifts and choosing one is wasteful. What is the cheapest structure that does every amount, and what does it cost in speed?
The building block (board, 22:55–26:31)
- The specification (22:55–24:14) board. An “8-bit right shifter”, logical, whose shift amount is given fully encoded as a binary number : 111 shifts by 7, 010 by 2, 000 by 0, 110 by 6.
- The 2:1 mux (25:15–26:31) board. A block with inputs “1” and “0”, a select sel and an output : “when select is a 1, it’s going to select this input”, the 1 input. As pass transistors it is two NFETs joined at , one gated by sel (passing input , the 1 input) and one by (passing ). Each NFET passes a weak high, ; making each switch a transmission gate fixes that, “I don’t have to pay a VT drop”, at the cost of two more devices and the complement signals.
The 2:1 multiplexer the shifters are built from (Lecture16 @ 27:12). Left: the block: is the “1” input when sel = 1 and the “0” input when sel = 0. Middle: the board’s pass-transistor form, two NFETs from (the 1 input) and (the 0 input) to , gated by sel and ; a high passes only to . Right added (from the lecture’s spoken remark, 26:03–26:31): the complementary form, each NFET paired with a PFET on the complementary gate (a transmission gate), which passes a full at the cost of two more devices.
The board (Lecture16 @ 27:12)

Fair copy of the board above (Lecture16 @ 27:12), mark for mark in its own layout. Magenta is the pink pen, which draws the shifter and the mux sketches; black is the cyan pen of the notes. The left of the board was wiped before 26:27, so the title “logarithmic shifter” and the line “S₂S₁S₀”, both whole at 24:09, are copied as they remain. The mux block’s top labels are A and B, written at 26:00 as the lecturer names the inputs; the 1 and 0 inside it mark which input each value of sel passes. At 26:15 each pass device was redrawn as a complementary pair, a loop of two channels, with small gate labels between the two (sel-bar and sel, set as read). The dash after “(fully encoded)” sits a little right of the board’s.
Three rows of muxes (board, 26:57–30:56)
- Row : shift by 1 (26:57–28:31) board. Eight muxes, one per output bit, all selected by . Mux takes on its 0 input (straight down) and on its 1 input (diagonally from the left). Mux 7 has no , so its 1 input is a pad, 0, because the shift is logical.
- Row : shift by 2 (28:58–29:41) board. The same, with the 1 input taken from two positions to the left of the row above; muxes 7 and 6 take 0 pads.
- Row : shift by 4 (29:48–30:56) board. The 1 input comes from four positions to the left; muxes 7 to 4 take 0 pads. The outputs are .
- Why it covers every amount added. The rows shift by 1, 2 and 4 or not at all, so together they shift by : the binary shift amount itself. Any amount from 0 to 7 is a sum of distinct powers of 2. That is why the select is encoded and why there are rows: “logarithmic”.
The 8-bit logarithmic right shifter as the board builds it (Lecture16 @ 31:19, before the inverters), redrawn. Each box is a 2:1 multiplexer that passes its “1” input when its row’s select is 1 and its “0” input otherwise. Row shifts by 1, row by 2, row by 4: mux takes the bit straight above on its 0 input and the bit places to the left on its 1 input, and the inputs with no bit to the left take a 0 pad (a logical shift): one in row , two in row , four in row . The encoded amount is the shift: 101 shifts by 5.
The board (Lecture16 @ 32:54)

Fair copy of the board above (Lecture16 @ 32:54), mark for mark in its own layout, on the coordinates of the 27:12 copy. Magenta is the pink pen (the network, its pads and outputs, “(logical)”, “S₂ S₁ S₀” and the mux sketches); black is the cyan pen of the notes. to , behind the lecturer’s hand and paper here, are restored from the video at 33:10, where the lower half is unchanged while he wipes the top. The bars over the outputs mark them inverted. Every pad is a quoted 0; the quote marks of the S₂ row’s second pad are written upright, so it reads like “10”. With the inverters, the S₂ row’s pads should become 1, as the lecturer says at 32:12, but the board keeps 0.
Stack height, and breaking it (board, 31:00–32:50)
- Count the stack (31:00–31:30). A bit reaching passes one pass transistor in each of the three rows, and before them the inverter that drives : “My stack height here is at least four, which obviously isn’t very good” (31:30).
- Break it with inverters (31:41–32:29) board. Put an inverter after each mux of the row. A path is then the driver and two pass devices (height 3), then the new inverter and one pass device (height 2). The outputs come out inverted, , as the board marks them.
- The pads change (32:12). After the inverters, the row carries inverted data, so its pads must be inverted too: “I would need to also invert these zeros”. Its four pads become 1, though the board still shows them as 0.
- The lesson. “You have to be very wary of the stack heights that you create when you use pass transistors” (32:45). Without buffers the height grows as ; buffers every two or three rows keep it short, at the cost of an inverter delay each.
Stack height in the logarithmic shifter added (from the lecture’s spoken count, 31:00–32:42; the inverters’ place as on the board, Lecture16 @ 32:54). Top: the path from a driving inverter to an output passes one conducting pass NFET in each row (, , ), so the driver’s pull-down sees four devices in series. Bottom: inverters after the row break the path into a stack of three (driver, , ) and a stack of two (inverter, ); the outputs come out inverted, .
The arithmetic version (added)
- What changes. An arithmetic right shift fills with copies of the MSB, so every pad must carry instead of 0.
- Where the pad can come from. Straight from the input , in every row. An arithmetic right shift never changes the MSB (it copies it), so after any row the MSB is still .
- At 4 bits. Two rows, (by 1) and (by 2); three pads, all wired to : mux 3’s 1 input in row , and muxes 3 and 2 in row . FN12-6 asks for the 8-bit version (seven pads); it is solved on the datapath practice page (FD1).
The logarithmic shifter made arithmetic, at 4 bits added: every input that the logical shifter ties to 0 is wired to , the sign bit, taken straight from the input (an arithmetic right shift never changes the MSB, so each row’s MSB is still ). Row shifts by 1 and row by 2.
Memorize or derive. Memorize the structure: row shifts by under , the 1 input takes the shifted bit, and the pads are 0 or . Derive the counts and the stack height from it: one row per select bit, one mux per output bit, one pass device per row plus the driver.
A worked example added. (182 unsigned, signed), (shift by 5), row by row:
| after row | shift | logical | arithmetic |
|---|---|---|---|
| input | 1011 0110 | 1011 0110 | |
| 1 | 0101 1011 | 1101 1011 | |
| 0 | 0101 1011 | 1101 1011 | |
| 4 | 0000 0101 | 1111 1101 |
Logical: , and . Arithmetic: , and .
Traps.
- Inverting the row outputs but leaving the next row’s pads at 0. After the inversion a 0 pad stands for a true 1: a shift by 4 would fill the top four bits with 1s.
- Swapping the mux inputs. With the board’s convention the 1 input takes the shifted bit (FN12-6’s has as that input). Wired the other way, shifts by 7.
Check yourself With S = 011, which input bit reaches Y2?
: the amount is , so . The row moves to position 4, the row moves it on to position 2, and the row passes it straight down.
Check yourself A 16-bit logarithmic shifter: how many rows and muxes, and what is its stack height without buffers?
Step 1: rows (, shifts 1, 2, 4, 8) of 16 muxes: 64 muxes. Step 2: the driver plus one pass device per row: , too tall; an inverter after the second row gives 3 and 3.
9. The barrel shifter and one-hot selects
You need
Static, ratioed, floating (Chapter 10, §7). A pass-transistor multiplexer is static only when exactly one select is on: its output is then connected to exactly one driven input. Two selects on with different data make a fight, whose result depends on the ratio of the drivers’ strengths (ratioed logic). No select on leaves the output floating, held only by its own capacitance. Selects with exactly one 1 are called one-hot or orthogonal; a decoder makes them from a binary number (Chapter 19 builds decoders).
Sign extension (§7). An arithmetic right shift fills the open MSB end with copies of the MSB.
The logarithmic shifter (§8): rows of 2:1 muxes, a stack height of .
The question. The logarithmic shifter puts a pass device per row on every path. Can each output be connected to the input it needs through one pass transistor, and what does that demand of the select lines?
A 4-bit arithmetic right barrel shifter (board, 33:10–41:38)
- The select (33:10–35:19) board. Four lines , “fully decoded, one-hot, orthogonal”: exactly one is 1, and means shift by . “If that’s not true, then the circuit will not be static. It’ll be ratioed” (35:19).
- The lines (35:19–36:33) board. Inputs run across from the left, outputs leave to the right; a right shift, arithmetic, by 0 to 3.
- The shift devices (37:04–39:07) board. One NFET per output and select. Under , each connects to ; under , to , to , to ; under , to and to ; under , to .
- The sign-extension devices (39:18–41:13) board. The outputs left without a source get the MSB: under , to ; under , and to ; under , , and to . The rule in one line added: under , connects to . Sixteen devices, six of them sign extension (those with ; the board rings them with a cyan arc).
- Stack height (41:38). The driver and one pass transistor: 2, for any shift.
The 4-bit arithmetic right barrel shifter (Lecture16 @ 42:04), redrawn as a clean crossbar; the board’s own routing is kept in its fair copy. The columns run to , as the board’s header. Each output connects through one NFET per select line to the input : exactly one select is on (one-hot), so each output passes the input places to its left through a single device. The six devices in the dashed outline connect outputs to beyond the word’s end: they copy the sign bit (sign extension). For example, with on gives : .
The board (Lecture16 @ 42:04)

Fair copy of the board above (Lecture16 @ 42:04), mark for mark in its own layout, with the board’s own routing of the vertical wires. Magenta is the violet pen: the input lines with their labels, and both notes. Teal is the cyan pen: the output lines with their labels, and the large arc. Black is the white pen: the select ring with its arrows and “1”s, the sixteen pass transistors with their gate labels, and the vertical wires, each running from its input line to one device. The diagonal below the arc’s right end (cyan at the top, two white dashes lower down) cuts down between the devices to the arc’s lower end: with the arc it encloses the six sign-extension devices. In the ring the lecturer’s looks like “S>”; the routing checks out device by device against . The input labels are read on 41:42, where the sheet in his hand is clear of . The white pen retraces the output lines inside the array; the copy draws them in teal throughout.
Why the select must be one-hot (spoken 35:19, 41:13; floating case added)
- One select on. Each output has exactly one conducting device, to one driven input: a static circuit. With on and , connects to .
- Two selects on. and together join to both and . If they differ, one driver pulls up and the other down: a fight, settled by the ratio of their strengths. With and both on, 14 of the 16 possible input words make at least one output fight (only 0000 and 1111 do not).
- No select on added. Every device is off, so each output floats: it keeps whatever charge it had, a dynamic node.
- So the select lines come from a decoder, which guarantees exactly one 1.
One output of the barrel shifter, , with its four devices added. (a) Exactly one select on (): one device conducts and . (b) Two selects on ( and ) with and : two inputs drive against each other, so its level depends on the devices’ strengths (ratioed). (c) No select on: nothing drives , which floats and holds whatever charge it had (dynamic). Only the one-hot case is static.
Against the logarithmic shifter added. The barrel shifter has one pass device per path but devices and one-hot select lines, plus the decoder that makes them. The logarithmic shifter has pass devices per path, muxes (two NFETs each) and only encoded select lines.
| bits | 4 | 8 | 16 | 32 |
|---|---|---|---|---|
| barrel: NFETs | 16 | 64 | 256 | 1024 |
| barrel: select lines | 4 | 8 | 16 | 32 |
| logarithmic: muxes (NFETs) | 8 (16) | 24 (48) | 64 (128) | 160 (320) |
| logarithmic: select lines | 2 | 3 | 4 | 5 |
Memorize or derive. Memorize the one-hot rule and its reason (two on fight, none on float). Derive any output’s device list from , and the counts from the grid.
A worked example added. (), on: (sign extension), , , . So , and .
Traps.
- Driving the select lines from a binary amount. Wired to and , the 2-bit amount 3 (binary 11) turns both on at once: a fight. A 2-to-4 decoder must come first.
- Leaving out the sign-extension devices. Then on a shift by the top outputs have no path at all: they float, which is not even a logical shift.
Check yourself Which input reaches B1 when S2 is on?
: . A right shift by 2 puts bit 3 at position 1.
Check yourself An 8-bit arithmetic right barrel shifter: how many devices and select lines does it need, and how many of the devices are sign extension?
Step 1: one NFET per output and select: devices, with 8 one-hot select lines. Step 2: sign extension where : output has 7 such devices (), has 6, down to with 1, so .
10. Other datapath blocks, control logic and the synthesis flow (background for the final)
You need
The three kinds of circuit (Chapter 15, §11). A processor is datapath (structured, often custom), control logic (“random”, unstructured) and arrays (memory, structured).
Static timing analysis (Chapter 14, §8). A tool checks every path between storage elements against the clock period, without simulating patterns.
The question. The adders and shifters are hand-built, bit by bit. The control logic that steers them cannot be: what is it, and how is it built instead?
From the datapath to control logic (board, 42:02–54:46)
- Other datapath blocks (42:02–42:32). Fixed-point multipliers, “even dividers”, and logic units are datapath blocks too; the course names them only. The adder and the shifter are the two most critical.
- Control logic (42:53–44:20) board. Back to the taxonomy: datapath, control, memory and arrays. Control logic is “random” logic: “All the term random means is that it’s not structured” (43:38). It also changes up to the last minute, since most of a processor’s bug fixes land in it before tape-out (“rapid changes”). So it is built with CAD automation, a semi-custom flow.
- Two strategies (44:20–47:05) board. Unstructured: multi-level logic, made by a synthesis and place-and-route (P&R) flow. Structured: two-level sum-of-products (SOP) logic in a programmable logic array (PLA). A PLA is regular and has good heuristic optimization tools; its disadvantage is area. It “comes and goes in vogue”.
- The synthesis flow (47:34–52:11) board. An RTL description (Verilog or VHDL) goes into logic synthesis (for example Synopsys Design Compiler), which maps it onto a standard-cell library of gates (NANDs, NORs, AOIs: channel-connected components) and writes a netlist. Place-and-route puts the cells’ layouts in rows and wires them up (“a rat’s nest”) and writes the GDS file for the foundry. Every cell has the same height, between M1 supply rails (vdd! and gnd!) that join up along a row; widths vary, each gate comes in several drive strengths (“power levels”), and gaps are filled with filler cells. Static timing analysis with the real wire loads then sends the design back to synthesis until it meets timing. “We’re not going to be using these in this class” (52:11).
- What the course uses: PLAs (52:11–54:46). The design project builds its processor’s control logic as a PLA. The logic is written as a sum of products: each product term is an AND of input literals (a variable or its complement), and each output is an OR of product terms. An RTL description converts easily into such a sum-of-products table and back. When the lecturer was at IBM, some argued that all logic should be captured in these tables instead of in VHDL or Verilog, an idea that “never caught on” (53:58–54:32). Chapter 18 §1 takes up the lecture’s example and turns its AND–OR form into the NOR–NOR form a PLA is built from.
The two ways to build control logic, redrawn from the board (Lecture16 @ 46:44). Control (“random”, unstructured logic) changes quickly during a design, so it is built semi-custom, with CAD automation. Two routes: unstructured, as multi-level logic through logic synthesis and place-and-route (P&R); or structured, as a programmable logic array (PLA), a two-level sum-of-products (SOP) form.
The board (Lecture16 @ 46:44)

Fair copy of the board above (Lecture16 @ 46:44), mark for mark in its own layout. All black: a white pen wrote the words, and a cyan pen drew the right-hand rule, the underlines, the up arrow, the box round PLA and “SOP”. The two pens alternate through the topic without marking a separate layer, and by this frame the camera’s colour has tinted the whole board cyan. The hand writes some words small (“unstructured”, “implementation”, “programmable logic array”), and they are set smaller here; the bracket after “automation” moves right to clear the typeset word.
The semi-custom flow, redrawn from the board (Lecture16 @ 52:19). RTL, written in Verilog or VHDL, goes to logic synthesis (the lecture names Synopsys Design Compiler), which maps it onto the gates of a standard-cell library and writes a netlist; place-and-route (P&R) places the cells’ layouts and wires them, and writes the GDS file for the mask shop; static timing analysis (STA) with the wires’ parasitics loops back to synthesis until timing closes. Below: standard cells all have one height , so they sit in rows between shared metal-1 rails (vdd! above, gnd! below); a filler cell (hatched) fills a gap in a row.
The board (Lecture16 @ 52:19)

Fair copy of the board above (Lecture16 @ 52:19), mark for mark in its own layout. All black: by now the camera shows a single colour, and the white and cyan pens of 46:44 cannot be told apart. The right half is the 46:44 board with “Rapid changes” now boxed; the taxonomy and the double rule at the left are erased, and the design flow, the standard-cell rows and a cell’s outline take their place. The lecturer’s hand, holding the eraser over “unstructured”, hides nothing new: every stroke matches 51:57, where it is clear. The loop under the flow, labelled “static timing analysis”, carries the results of P&R back into logic synthesis. The cell rows are copied cell by cell, each a bar and a D-shaped outline as the hand drew them; the right half’s words are set a size smaller than at 46:44, since this copy is drawn at a smaller scale.
Check yourself Why does control logic suit an automated flow better than a hand layout, and what does a PLA give up for its regularity?
Step 1: control logic is unstructured and changes late and often, since most bug fixes land in it before tape-out; an automated flow can redo it overnight, while a hand layout would have to be redrawn. Step 2: a PLA’s regular two-level array is easy to generate and optimize, but it can waste area compared with multi-level logic.
Check yourself An RTL statement sets y = (a and b) or (not c). Write y as a sum of products, and on how many of the eight input combinations is y = 1?
Step 1: : two product terms, (an AND of two literals) and (one complemented literal), ORed. Step 2: on the 4 combinations with , and adds the one with , : 5 of 8. Check: needs and , which is 3 combinations, and .
On the exam
Two past-final parts rest directly on this chapter, both 15-point block drawings, and both with a twist the lecture does not draw. A third, FN12-10a, uses the sum-of-products form that §10 introduces; it is Chapter 18’s.
| Part | Points | What it asks | Sections |
|---|---|---|---|
| FN17-8 | 15 | the block diagram of an 8-bit parallel adder from PG generators, radix-two lookahead elements and sum generators, and its critical path | §1, §2, §3, §6 (§5 for the levels); with Chapter 16 §9, §12, §13 |
| FN12-6 | 15 | the block-level schematic of an 8-bit arithmetic right shifter from 2:1 muxes (), with a 3-bit shift amount | §7, §8 (the arithmetic pads); §9 for contrast |
| FN12-10a | 9 | the functions of a NOR–NOR PLA | Chapter 18 §1 onward; §10 here names the sum-of-products form only |
All three are solved, with their own figures and keys, on the datapath practice page (FD1). What this chapter prepares:
- FN17-8. The three blocks are Chapter 16’s PG cell, the radix-2 element (§1) and the sum XOR. The network is any radix-2 network over positions 0 to 8, the carry-in entering as : Kogge–Stone (§3) or Brent–Kung (§4). Each sum takes the carry of the bit below it, , and : wiring to its own column’s is the trap of §6. The critical path runs PG, up the network to the carry the top sum needs, and through that sum, or up to (§6). At the finals’ pace of 0.7–0.9 minutes a point, it is a 10–14 minute part.
- FN12-6. The lecture’s logarithmic shifter (§8) is logical; the arithmetic version fills every pad with (§8, the arithmetic steps), and the mux’s input takes the shifted bit. Also a 10–14 minute part.
Memorize.
- The element , higher span first: bracket freely, never swap.
- with entered as ; ; .
- Kogge–Stone’s rule (column reaches rows down) and Brent–Kung’s shape (pairs, then 2:0, 4:0, 8:0 from position 0, then fill in).
- Kogge–Stone is the faster, Brent–Kung the smaller; Brent–Kung’s cost is levels and irregular fan-out.
- The three kinds of shift and their fill bits; an arithmetic right shift rounds down.
- The logarithmic shifter: row shifts by under ; stack height unless buffered.
- The barrel shifter’s one-hot select and why (two on fight, none on float).
- The two ways to build control logic: synthesis and P&R, or a PLA.
Derive (with the path).
- Associativity. Expand and : both are .
- The lower bound. Each element at most doubles the positions a signal depends on: levels for .
- Counts at a given width. Kogge–Stone: elements in column for bits. Brent–Kung: draw it.
- A critical path. , plus the depth of times , plus ; and plus the depth of times for .
- The arithmetic pads. , straight from the input, because an arithmetic right shift never changes the MSB.
- A barrel output’s devices. Under , .
Method cards. The playbook’s cards: “prefix adder” (recognize PG, lookahead-element and sum blocks, or “draw the critical path”; moves: PG, a network over positions 0 to , sums from the carry below, mark the deepest path; traps: the sum index and ) and “shifter from muxes” (recognize a mux block and an encoded shift amount; moves: one row per select bit shifting by , the shifted bit on the select-1 input, the pads; traps: logical against arithmetic pads, and the stack height). FN12-10a’s card belongs to Chapter 18.
The lecture’s boards
The boards of Lecture 16 used in this chapter (23 frames)






















