Skip to content

FD1. Adders, shifters and PLAs: the exam way

This is the exam way of FD1: each part as you would write it on the paper, with what to recognize, the lines to write, the trap to watch and the answer. Every part keeps the anchor it has on FD1, so the switch at the top of the page takes you to the same part’s full solution. The methods are three cards of the playbook: parallel-prefix adders for FN17-8, logarithmic shifters for FN12-6, and PLAs for FN12-10a and FN19-6, whose replica clocks also use the clock-generation card. FD1’s seven harder variations stay on FD1 only, at the end of each family: adders, shifters and PLAs. Work them there, against the budgets their titles give.

The clock. The past finals gave 180 minutes. FN12 had 200 points, 0.9 min a point, so its 15-point shifter has about 14 minutes and its 9-point PLA about 8; FN17 and FN19 had 250, 0.72 min a point, so FN17-8’s 15 points have about 11 minutes and FN19-6’s 10 and 8 points about 7 and 6. (The past midterms gave 75 minutes for 150 points, 0.5 min a point: a final part has more time, and more steps.)

Three conventions run through every line below. The adder’s carry-in is position 0, entered as the pair (cin,0)(c_{in}, 0), and the bits are 1 to 8; a span i:ji{:}j is positions jj to ii, high index first. Delays in τinv\tau_{inv} are Chapter 17’s example values, tPG=2t_{PG} = 2, te=4t_e = 4 (one radix-2 element), tsum=4t_{sum} = 4, with fan-out ignored. A PLA’s literal lines run xˉi\bar x_i, ground, xix_i; a device whose gate sits on a line pulls its row low when that line is 1. Input rows are written x0x1x2x_0x_1x_2.

FN17-8: an 8-bit parallel-prefix adder and its critical path (15 points)

FN17-8, p18. Draw the block schematic diagram of an 8-bit parallel adder composed of an interconnection of three logic building blocks: a PG generator with the equations: p=a⊕bp = a\oplus b, g=abg = ab, a radix-two lookahead element with the equations: P=p1p0P = p_1p_0, G=g1+p1g0G = g_1 + p_1g_0, and sum generator with the equation: s=p⊕cs = p\oplus c. Draw the critical path through your network. (15 points)

FN17-8 prints no figure. This is the network its adder is built on: the 8-bit Kogge–Stone network (Chapter 17 §3; Lecture16 @ 10:41, redrawn). Row kk ends in Ck=Gk:0C_k = G_{k:0}; 21 elements in 4 levels. Turned a quarter turn anticlockwise, its rows are the key’s bit columns, bit 8 at the left.

The adder and its critical path (15 points)

FN17-8, p18. Draw the block schematic diagram of an 8-bit parallel adder composed of an interconnection of three logic building blocks: a PG generator with the equations: p=a⊕bp = a\oplus b, g=abg = ab, a radix-two lookahead element with the equations: P=p1p0P = p_1p_0, G=g1+p1g0G = g_1 + p_1g_0, and sum generator with the equation: s=p⊕cs = p\oplus c. Draw the critical path through your network. (15 points)

Hint
Which carry does sum bit kk need: the one into the bit or the one out of it? Which span’s group generate is that, and which bit’s line carries it?

Recognize. Parallel-prefix adders: three rows of blocks, “radix-two” means a tree of two-input merges, “critical path” means the deepest chain. About 11 minutes, all of it drawing: lay out the nine columns first, then the levels.

On the paper.

  1. Positions: (cin,0)(c_{in}, 0) at 0, bits 1–8; bit 8 at the left
  2. Bottom: 8 PG blocks, gk=akbkg_k = a_kb_k, pk=ak⊕bkp_k = a_k\oplus b_k
  3. Network: Kogge–Stone; level mm merges a row with the one 2m−12^{m-1} below
  4. Levels: 1:0 … 8:7 (8); 2:0, 3:0, 4:1 … 8:5 (7); 4:0 … 7:0, 8:1 (5); 8:0 (1): 21 elements
  5. Element: (Ghi,Phi)∘(Glo,Plo)=(Ghi+PhiGlo, PhiPlo)(G_{hi}, P_{hi})\circ(G_{lo}, P_{lo}) = (G_{hi} + P_{hi}G_{lo},\ P_{hi}P_{lo}), higher span on the left
  6. Carries: Ck=Gk:0C_k = G_{k:0}; cout=G8:0c_{out} = G_{8:0}
  7. Top: s1=p1⊕cins_1 = p_1\oplus c_{in}; sk=pk⊕Gk−1:0s_k = p_k\oplus G_{k-1:0}, the carry from the column to its right
  8. Depths: C7C_7 3 levels (⌈log⁡28⌉\lceil\log_2 8\rceil), C8C_8 4 (⌈log⁡29⌉\lceil\log_2 9\rceil)
  9. Path to s8s_8: PG7_7 → 7:6 → 7:4 → 7:0 → XOR: tPG+3te+tsumt_{PG} + 3t_e + t_{sum}
  10. Path to coutc_{out}: PG8_8 → 8:7 → 8:5 → 8:1 → 8:0: tPG+4tet_{PG} + 4t_e
  11. e.g. 2+12+4=182 + 12 + 4 = 18 and 2+16=18 τinv2 + 16 = 18\,\tau_{inv} (fan-out ignored): mark both
  12. Check 1+11 + 1, cin=0c_{in} = 0: C1=1C_1 = 1, s1=0s_1 = 0, s2=1s_2 = 1 → 2 ✓
What to draw (FD1’s adder): each sum takes its carry from the column one to its right; both critical paths marked. Original figure ↗

Watch out. Each sum takes the carry into its bit, Ck−1C_{k-1}, not its own column’s CkC_k. The key wires every sum one position too high: 1+11 + 1 comes out 1. The board’s Brent–Kung is smaller (13 elements), not faster: its C7C_7 is 4 levels deep, so s8s_8 comes at 22 τinv\tau_{inv}.

Answer: Eight PG generators feed a Kogge–Stone network of 21 radix-2 elements in 4 levels over (cin,0)(c_{in}, 0) and bits 1–8, making Ck=Gk:0C_k = G_{k:0}; eight sum generators make s1=p1⊕cins_1 = p_1\oplus c_{in} and sk=pk⊕Gk−1:0s_k = p_k\oplus G_{k-1:0}, and cout=G8:0c_{out} = G_{8:0}. Critical path: PG → three elements → s8s_8 (tPG+3te+tsumt_{PG} + 3t_e + t_{sum}), or PG → four elements → coutc_{out} (tPG+4tet_{PG} + 4t_e); 18 τinv\tau_{inv} each with the example delays.

Full solution

FN12-6: an 8-bit arithmetic right shifter from 2:1 muxes (15 points)

FN12-6, p7. Draw the (block-level) schematic of an 8-bit arithmetic right shifter using the basic multiplexer building block shown below. The shift amount should be determined by a three-bit control signal. (15 points)

FN12-6’s building block (Final 2012, p7, redrawn): a 2:1 multiplexer with y=ac+bcˉy = ac + b\bar c, so y=ay = a when c=1c = 1 and y=by = b when c=0c = 0.

The shifter (15 points)

FN12-6, p7. Draw the (block-level) schematic of an 8-bit arithmetic right shifter using the basic multiplexer building block shown below. The shift amount should be determined by a three-bit control signal. (15 points)

Hint
Any shift amount from 0 to 7 is a sum of which three fixed shifts, and what must enter a row at the top when a bit is shifted in from beyond A7A_7?

Recognize. Logarithmic shifters: a mux block with its equation, “shift amount”, “three-bit control signal”, “arithmetic right”. About 14 minutes: the drawing is 24 boxes, so draw one row whole and repeat it.

On the paper.

  1. y=ac+bcˉy = ac + b\bar c: aa passes when c=1c = 1
  2. s=4S2+2S1+S0s = 4S_2 + 2S_1 + S_0: three rows, shifting by 1, 2, 4
  3. Row kk, mux ii: c=Skc = S_k, a=wi+2ka = w_{i+2^k} (diagonal from the left), b=wib = w_i (straight down)
  4. Row S0S_0: mux 7’s aa = A7A_7
  5. Row S1S_1: muxes 7, 6 take A7A_7
  6. Row S2S_2: muxes 7–4 take A7A_7
  7. All pads straight from the input A7A_7: an arithmetic right shift never changes the MSB
  8. 3×8=243\times8 = 24 muxes; 1+2+4=71 + 2 + 4 = 7 pads
  9. Check: A=1001 0111A = 1001\,0111 (−105-105), S=110S = 110
  10. S0=0S_0 = 0: 1001 01111001\,0111; S1=1S_1 = 1: 1110 01011110\,0101; S2=1S_2 = 1: 1111 1110=−21111\,1110 = -2
  11. ⌊−105/64⌋=⌊−1.64⌋=−2\lfloor -105/64\rfloor = \lfloor -1.64\rfloor = -2 ✓
What to draw (FD1’s shifter): three rows, the diagonals 1, 2 and 4 columns long, and the seven pads on the A7A_7 rail. Original figure ↗

Watch out. Pad with A7A_7, not 0: with 0 pads the same word comes out 0000 0010=20000\,0010 = 2, a logical shift. Put the shifted bit on aa, the input that passes on a 1; swapped, S=000S = 000 shifts by 7.

Answer: A logarithmic shifter: three rows of eight muxes, 24 in all. Row kk (k=0,1,2k = 0, 1, 2) is controlled by SkS_k and shifts by 2k2^k: mux ii has c=Skc = S_k, aa = the row input’s bit i+2ki + 2^k, bb = its bit ii. The seven aa inputs with i+2k>7i + 2^k > 7 (mux 7 in row S0S_0; 7, 6 in row S1S_1; 7–4 in row S2S_2) are tied to A7A_7, the sign bit.

Full solution

FN12-10a: reading a static PLA (9 points)

FN12-10, p14. In this problem, we consider some of the combinational logic circuit styles we studied in the course.

FN12-10a’s circuit (Final 2012, p14, redrawn). Dashed lines are ground lines. The row names P0P_0, P1P_1, P2P_2 are the key’s (its p0, p1, p2); the paper prints none.

Part (a): f0 and f1 (9 points)

FN12-10a, p14. In the following circuit, find f0 and f1 (Boolean equations) as a function of x0, x1, and x2. (9 points)

Hint
A row with a device on xˉ0\bar x_0 is pulled low when xˉ0=1\bar x_0 = 1. When is that row high?

Recognize. PLAs, reading one: rows of devices on literal lines, columns at the right, inverters under them. About 8 minutes: rows, columns, simplify, one trace.

On the paper.

  1. Row = NOR of its device lines = AND of their complements
  2. P0P_0: devices on xˉ0\bar x_0, xˉ1\bar x_1 → x0x1x_0x_1
  3. P1P_1: on x2x_2 → xˉ2\bar x_2
  4. P2P_2: on xˉ0\bar x_0, xˉ1\bar x_1, xˉ2\bar x_2 → x0x1x2x_0x_1x_2
  5. Columns + inverters: each output is the OR of its column’s rows
  6. f0=P0+P1=x0x1+xˉ2f_0 = P_0 + P_1 = x_0x_1 + \bar x_2
  7. f1=P1+P2=xˉ2+x0x1x2f_1 = P_1 + P_2 = \bar x_2 + x_0x_1x_2
  8. Since aˉ+ab=aˉ+b\bar a + ab = \bar a + b (a=x2a = x_2): f1=xˉ2+x0x1=f0f_1 = \bar x_2 + x_0x_1 = f_0
  9. Trace x0x1x2=101x_0x_1x_2 = 101: xˉ1=1\bar x_1 = 1 pulls P0P_0, P2P_2 low; x2=1x_2 = 1 pulls P1P_1 low
  10. No row high → both columns high → f0=f1=0f_0 = f_1 = 0; formula 0+00 + 0 ✓
  11. f0=f1=1f_0 = f_1 = 1 on x0x1x2=x_0x_1x_2 = 000, 010, 100, 110, 111
What to write on the figure (FD1’s reading): each row’s product at its right, each column’s sum below, and one input traced. Original figure ↗

Watch out. A device on a line puts the complement of that line’s literal in the product: a device on xˉ0\bar x_0 means the row needs x0=1x_0 = 1. Simplify f1f_1 before you stop; it is the same function as f0f_0.

Answer: P0=x0x1P_0 = x_0x_1, P1=xˉ2P_1 = \bar x_2, P2=x0x1x2P_2 = x_0x_1x_2; f0=x0x1+xˉ2f_0 = x_0x_1 + \bar x_2; f1=xˉ2+x0x1x2=x0x1+xˉ2f_1 = \bar x_2 + x_0x_1x_2 = x_0x_1 + \bar x_2, the same function as f0f_0.

Full solution

FN19-6: a dynamic PLA and its replica clocks (18 points)

FN19-6, p13. Consider the following dynamic PLA structure.

FN19-6’s dynamic PLA (Final 2019, p13, redrawn; dashed lines are virtual-ground lines). ϕAND\phi_{AND} clocks the rows, ϕOR\phi_{OR} the columns. The columns are the outputs y0y_0, y1y_1: there are no output inverters.

Part (a): the logic function (10 points)

FN19-6a, p13. We discussed in class how it is necessary to derive the clocks ϕAND\phi_{AND} and ϕOR\phi_{OR} in such a manner that the OR plane does not being (sic) to evaluate until after the AND plane has evaluated. Furthermore, both ϕAND\phi_{AND} and ϕOR\phi_{OR} must allow for adequate precharge time. If the clocks satisfy this relationship, what is the logic function of this PLA (i. e, what are y0y_0 and y1y_1 as a function of x0x_0, x1x_1, and x2x_2)? (10 points)

Hint
Once both planes have evaluated, what does each row hold, and what does a column with no inverter after it give?

Recognize. PLAs, reading one: the long preamble is a condition (the clocks are right), so read it as a static PLA. About 7 minutes; look for output inverters before you write anything.

On the paper.

  1. Clocks right → each row and column settles to its NOR, as in a static PLA
  2. P0P_0: xˉ0\bar x_0, xˉ1\bar x_1 → x0x1x_0x_1; P1P_1: x2x_2 → xˉ2\bar x_2
  3. P2P_2: xˉ0\bar x_0, xˉ1\bar x_1, xˉ2\bar x_2 → x0x1x2x_0x_1x_2; P3P_3: x0x_0, xˉ1\bar x_1 → xˉ0x1\bar x_0x_1
  4. No output inverters: y=OR of the column’s rows‾y = \overline{\text{OR of the column's rows}}
  5. y0=P0+P1‾=x0x1‾⋅x2=x2(xˉ0+xˉ1)y_0 = \overline{P_0 + P_1} = \overline{x_0x_1}\cdot x_2 = x_2(\bar x_0 + \bar x_1)
  6. y1=P1+P2+P3‾y_1 = \overline{P_1 + P_2 + P_3}: needs x2=1x_2 = 1; then x0x1+xˉ0x1‾=xˉ1\overline{x_0x_1 + \bar x_0x_1} = \bar x_1
  7. y1=xˉ1x2y_1 = \bar x_1x_2
  8. Trace x0x1x2=111x_0x_1x_2 = 111: P0P_0, P2P_2 stay high → both columns fall → y0=y1=0y_0 = y_1 = 0 ✓
  9. Trace x0x1x2=001x_0x_1x_2 = 001: every row pulled low → both stay precharged → y0=y1=1y_0 = y_1 = 1 ✓

Watch out. This paper draws no output inverters: y0=P0+P1y_0 = P_0 + P_1, the FN12-10a habit, is the complement of the right answer on every one of the 8 input rows. A device on x0x_0 (row P3P_3) means xˉ0\bar x_0 in the product.

Answer: y0=x0x1+xˉ2‾=x2(xˉ0+xˉ1)y_0 = \overline{x_0x_1 + \bar x_2} = x_2(\bar x_0 + \bar x_1); y1=xˉ2+x0x1x2+xˉ0x1‾=xˉ1x2y_1 = \overline{\bar x_2 + x_0x_1x_2 + \bar x_0x_1} = \bar x_1x_2.

Full solution

Part (b): a replica AND row for both clocks (8 points)

FN19-6b, p14. Design a replica AND row, two instance (sic) of which can be used in the circuits below to generate ϕAND\phi_{AND} and ϕOR\phi_{OR} to meet the timing constraints described in (a). (8 points)

FN19-6b’s clock generators (Final 2019, p14, redrawn; each box RR is the paper’s “replica AND row”). Upper: ϕAND\phi_{AND} is the NAND of ϕ\phi and the inverted output of a replica row clocked by ϕˉ\bar\phi. Lower: ϕOR\phi_{OR} is the inverted output of a replica row clocked by ϕAND\phi_{AND}.

Hint
In each generator, which edge does the replica row’s delay set, and what makes a real row’s precharge or evaluate the slowest?

Recognize. PLAs, clocking a dynamic one, with the clock-generation card’s replica delay: “replica AND row, two instance of which” means one design used twice. About 6 minutes: a transistor sketch and two edge equations.

On the paper.

  1. Upper box (clocked by ϕˉ\bar\phi): its precharge sets how long ϕAND\phi_{AND} stays low
  2. Lower box (clocked by ϕAND\phi_{AND}): its evaluate sets ϕOR ⁣↑\phi_{OR}\!\uparrow
  3. Copy a real row: precharge PFET and NFET foot, both on the box’s clock input uu
  4. Slowest precharge = most capacitance: 3 NFETs, the most on any row (P2P_2)
  5. Slowest evaluate = one device on: gates VDDV_{DD}, 0, 0
  6. Load like the most loaded row: 2 OR-plane gates (P1P_1 feeds y0y_0 and y1y_1) + the full row wire
  7. Same layout, same array: it tracks the real rows at every corner
  8. ϕAND\phi_{AND} low =2tinv+tpre= 2t_{inv} + t_{pre}; ϕOR ⁣↑=ϕAND ⁣↑+teval+tinv\phi_{OR}\!\uparrow = \phi_{AND}\!\uparrow + t_{eval} + t_{inv}
  9. e.g. Chapter 18’s example: tinv=20t_{inv} = 20, tNAND=30t_{NAND} = 30, tpre=150t_{pre} = 150, teval=200t_{eval} = 200 ps
  10. ϕAND\phi_{AND} low 30–220 ps: 190>150190 > 150 ✓
  11. ϕOR ⁣↑\phi_{OR}\!\uparrow at 220+200+20=440220 + 200 + 20 = 440 ps, after the slowest row ends at 420 ✓
What to draw (FD1’s replica row): three devices, one on, the foot and the precharge PFET on uu, and CrowC_{row}. Original figure ↗

Watch out. All devices on is the fastest evaluate: ϕOR\phi_{OR} would rise before the slowest real row has fallen. The lecture’s two different dummy rows work, but the paper asks for one design used twice. A typical row’s load is not enough: copy the worst.

Answer: One replica row, used in both boxes: a copy of a real AND row (precharge PFET and foot on its clock input) with three NFETs, the widest product, one gated by VDDV_{DD} and two by ground, loaded like the heaviest real row (two OR-plane gates, as P1P_1, plus the full row wire). One device on gives the slowest evaluate, which times ϕOR ⁣↑\phi_{OR}\!\uparrow; a full row gives at least the slowest precharge, which times ϕAND\phi_{AND}‘s low pulse.

Full solution