---
title: "Problem set 12: digital design across the course"
heading: "Problem set 12: problems that combine the whole course"
eyebrow: S3 · Problem set 12
type: problems
---

::: hook
These problems each combine several parts of the course: a datapath and its timing, a pipeline and its cache, a clock crossing and its FIFO, a chip's cost and its test. Work them as a designer would, carrying numbers from one step to the next.
:::

::: pool
pick: 12

::: check
kind: parts
given: N = 32 | 64; t = 25 | 35; c = 50; s = 30; k = 2 | 4

## An {N}-bit adder at {t} ps per logic level, between flip-flops with {c} ps clock-to-Q and {s} ps setup.

::: part
answer: 1/((N*t + c + s)*1e-12)/1e6
unit: MHz
tolerance: 1%

### Maximum clock with a ripple-carry adder?

::: misses
- [any] N levels plus register overhead.
:::
:::

::: part
answer: 1/(((log(N)/log(2) + 2)*t + c + s)*1e-12)/1e6
unit: MHz
tolerance: 1%

### With Kogge–Stone ($\log_2N + 2$ levels)?

::: misses
- [any] Prefix levels plus register overhead.
:::
:::

::: part
answer: 1/((N*t/k + c + s)*1e-12)/1e6
unit: MHz
tolerance: 1%

### With the ripple adder pipelined into {k} equal stages?

::: misses
- [any] $Nt/k$ plus overhead.
:::
:::
:::

::: check
kind: parts
given: m = 1 | 2; n = 14 | 15; K = 50 | 200; f = 50 | 200; c = 300 | 600

## A {K}-tap FIR with Q{m}.{n} data and coefficients filters a {f} MHz stream on a {c} MHz clock.

::: part
answer: 2*(m + n) + ceil(log(K - 0.5)/log(2))
tolerance: 0

### Accumulator width?

::: misses
- [any] Product width plus guard bits.
:::
:::

::: part
answer: ceil(K*f/c - 0.0001)
tolerance: 0

### Multipliers, time-shared?

::: misses
- [any] $\lceil Kf_s/f_\text{clk} \rceil$.
:::
:::
:::

::: check
kind: parts
given: B = 300 | 1200; w = 200 | 250; r = 80 | 150; u = 20 | 25; f = 200 | 400

## A burst of {B} words at {w} MHz crosses into a {r} MHz domain through an asynchronous FIFO; the synchronizers use flip-flops with τ = {u} ps and $T_0$ = 20 ps, and the reader's clock samples data changing at up to {f} MHz.

::: part
answer: B*(1 - r/w)
tolerance: 0.5%

### FIFO depth to absorb the burst?

::: misses
- [any] $B(1 - f_r/f_w)$.
:::
:::

::: part
answer: 2^ceil(log(B*(1 - r/w))/log(2))
tolerance: 0

### Smallest power-of-two depth that absorbs it?

::: misses
- [any] Round the depth up to a power of two.
:::
:::

::: part
answer: u*ln(1000*3.156e7*20e-12*r*1e6*f*1e6)
unit: ps
tolerance: 0.5%

### Settling time the read domain's synchronizer needs for an MTBF of 1000 years?

::: misses
- [any] $t_r = \tau\ln(\text{MTBF} \cdot T_0f_cf_d)$.
:::
:::
:::

::: check
kind: parts
given: L = 0.25 | 0.3; u = 0.4 | 0.5; B = 0.15 | 0.2; m = 0.1 | 0.2; h = 1 | 2; q = 0.02 | 0.05; M = 60 | 100; d = 0.3 | 0.4

## A pipelined core: {L} loads ({u} used at once), {B} branches mispredicted {m} of the time with a 2-cycle penalty. Its data cache hits in {h} cycle(s) (already in the pipeline) and misses {q} of the time with a {M}-cycle penalty; {d} of instructions access data.

::: part
answer: 1 + L*u + B*m*2
tolerance: 0.5%

### CPI with a perfect cache?

::: misses
- [any] Hazard stalls only.
:::
:::

::: part
answer: 1 + L*u + B*m*2 + d*q*M
tolerance: 0.5%

### CPI with the cache's misses?

::: misses
- [any] Add accesses × miss rate × penalty per instruction.
:::
:::
:::

::: check
kind: parts
given: S = 32 | 128; W = 4 | 8; B = 64; A = 32 | 40; L = 50 | 120; w = 16

## A {S} KB, {W}-way, {B}-byte-line write-back cache with {A}-bit addresses; misses wait {L} cycles and move lines over a {w}-byte bus.

::: part
answer: A - log(S*1024/W)/log(2)
tolerance: 0.4

### Tag bits?

::: misses
- [any] A − log₂(bytes per way).
:::
:::

::: part
answer: 100*(A - log(S*1024/W)/log(2) + 2)/(8*B)
unit: %
tolerance: 0.5%

### Tag, valid and dirty overhead, as a percentage of the data bits?

::: misses
- [any] (tag + 2) over the line's data bits.
:::
:::

::: part
answer: L + B/w
tolerance: 0.5%

### Miss penalty?

::: misses
- [any] Latency plus transfer.
:::
:::
:::

::: check
kind: parts
given: T = 1000 | 1250; c = 50; L = 700 | 950; s = 30; m = 20 | 60; h = 25; k = 30 | 60; j = 2 | 3

## A path with {c} ps clock-to-Q, logic {m} to {L} ps, {s} ps setup and {h} ps hold, {k} ps of capture skew, a {T} ps clock and {j} ps rms jitter (Q = 7.03, peak-to-peak taken as uncertainty).

::: part
answer: T + k - 2*7.03*j - (c + L + s)
unit: ps
tolerance: 0.5%

### Setup slack?

::: misses
- [any] Subtract the jitter's peak-to-peak.
:::
:::

::: part
answer: c + m - h - k
unit: ps
tolerance: 0.5%

### Hold slack (jitter ignored, since both edges are the same edge)?

::: misses
- [any] $(t_{cq} + m) - (h + k)$.
:::
:::

::: part
answer: ceil((h + k - c - m)/15 - 0.0001)*step(h + k - c - m)
tolerance: 0

### 15 ps buffers needed to fix hold, if any?

::: misses
- [any] Round up the deficit, or zero.
:::
:::
:::

::: check
kind: parts
given: G = 1.67 | 2.5; H = 60 | 300; P = 5 | 7; r = 0.4 | 1; l = 2 | 4

## A gate path with logical effort {G}, electrical effort {H} and parasitic delay {P}, driving a {l} mm wire at {r} Ω/µm and 0.2 fF/µm.

::: part
answer: log(G*H)/log(4)
tolerance: 1%

### Best number of stages?

::: misses
- [any] $\log_4F$.
:::
:::

::: part
answer: 0.38*r*0.2e-15*(l*1000)^2*1e12
unit: ps
tolerance: 1%

### Unrepeated wire delay?

::: misses
- [any] $0.38rcL^2$.
:::
:::
:::

::: check
kind: parts
given: a = 0.1 | 0.2; C = 2 | 5; V = 0.8 | 0.9; f = 1 | 2; v = 0.65 | 0.7; I = 30 | 80; R = 4 | 10

## A block switching {C} nF at activity {a}, {V} V and {f} GHz, fed by a {R} Ω rail from both ends carrying {I} mA spread along it.

::: part
answer: a*C*1e-9*V^2*f*1e9
unit: W
tolerance: 1%

### Dynamic power?

::: misses
- [any] $\alpha CV^2f$.
:::
:::

::: part
answer: a*C*1e-9*v^2*f*1e9*v/V
unit: W
tolerance: 1%

### After lowering the supply to {v} V and the clock in proportion to the voltage?

::: misses
- [any] $V^2f$ with f scaled by v/V.
:::
:::

::: part
answer: I*R/8
unit: mV
tolerance: 0.5%

### Worst IR drop on the rail?

::: misses
- [any] $IR/8$.
:::
:::
:::

::: check
kind: parts
given: A = 80 | 300; D = 0.1 | 0.25; W = 8000 | 12000; F = 200000 | 600000; C = 32 | 100; P = 4000 | 12000; f = 50 | 100

## A {A} mm² chip ({D} defects/cm², {W}-dollar wafers) with {F} flip-flops tested through {C} scan chains with {P} patterns at {f} MHz.

::: part
answer: W/((pi*150^2/A - pi*300/sqrt(2*A))*exp(-D*A/100))
tolerance: 1%

### Cost per good die, in dollars?

::: misses
- [any] Wafer cost over good dies.
:::
:::

::: part
answer: P*(ceil(F/C - 0.0001) + 1)/(f*1e6)
unit: s
tolerance: 0.5%

### Scan test time per chip?

::: misses
- [any] $P(L + 1)/f$.
:::
:::

::: part
answer: 1e6*(1 - exp(-D*A/100)^(1 - 0.99))
unit: ppm
tolerance: 0.5%

### Defect level at 99% coverage?

::: misses
- [any] $1 - Y^{1-T}$ with the Poisson yield.
:::
:::
:::

::: check
kind: parts
given: n = 12 | 24 | 50; k = 4 | 6; L = 0.12 | 0.15; R = 0.4 | 0.5

## An {n}-input XOR on {k}-input LUTs, with {L} ns per LUT and {R} ns of routing per level, between flip-flops with 0.3 ns of combined overhead.

::: part
answer: ceil(log(n)/log(k) - 0.0001)
tolerance: 0

### Levels?

::: misses
- [any] $\lceil \log_kn \rceil$.
:::
:::

::: part
answer: 1000/(ceil(log(n)/log(k) - 0.0001)*(L + R) + 0.3)
unit: MHz
tolerance: 0.5%

### Maximum clock?

::: misses
- [any] Levels times (LUT + route), plus overhead.
:::
:::
:::

::: check
kind: parts
given: N = 64 | 256; p = 0.0002 | 0.00005; c = 0.99 | 0.999

## A coverpoint with {N} bins, and a corner case of probability {p} per random test.

::: part
answer: N*(ln(N) + 0.5772)
tolerance: 1%

### Expected tests to fill the coverpoint?

::: misses
- [any] $N(\ln N + 0.577)$.
:::
:::

::: part
answer: ln(1 - c)/ln(1 - p)
tolerance: 0.5%

### Tests to hit the corner with confidence {c}?

::: misses
- [any] $\ln(1 - c)/\ln(1 - p)$.
:::
:::
:::

::: check
kind: parts
given: m = 32 | 64; R = 0.9 | 0.98; w = 64 | 128; f = 250 | 400; b = 16 | 32; o = 4

## A {m}-bit memory word with SECDED, a TMR block whose copies each work with probability {R}, and a {w}-bit bus at {f} MHz moving {b}-beat bursts with {o} overhead cycles.

::: part
answer: 2 + step(m - 0.5) + step(m - 1.5) + step(m - 4.5) + step(m - 11.5) + step(m - 26.5) + step(m - 57.5) + step(m - 120.5)
tolerance: 0

### Check bits?

::: misses
- [any] Smallest r with $2^r \ge m + r + 1$, plus one.
:::
:::

::: part
answer: 3*R^2 - 2*R^3
tolerance: 0.01%

### TMR reliability?

::: misses
- [any] $3R^2 - 2R^3$.
:::
:::

::: part
answer: w/8*f*1e6/1e9*b/(b + o)
unit: GB/s
tolerance: 0.5%

### Sustained bus bandwidth?

::: misses
- [any] Peak times $b/(b + o)$.
:::
:::
:::

::: check
kind: parts
given: N = 1024 | 4096; L = 3 | 4 | 6; D = 8 | 12

## An HLS dot product of {N} floating-point pairs accumulates through an {L}-cycle adder; the loop is {D} cycles deep.

::: part
answer: (N - 1)*L + D
unit: cycles
tolerance: 0

### How many cycles does it take as written?

::: misses
- [any] The recurrence forces II = L.
:::
:::

::: part
answer: N - 1 + D
unit: cycles
tolerance: 0

### And with {L} interleaved partial sums (ignoring the final combining)?

::: misses
- [any] II = 1.
:::
:::
:::

::: check
kind: parts
given: B = 12.8 | 25.6; a = 4 | 8; b = 2 | 4; c = 1 | 2

## Three masters share a {B} GB/s memory port by weighted round-robin with weights {a}, {b} and {c}.

::: part
answer: c/(a + b + c)*B
unit: GB/s
tolerance: 0.5%

### What bandwidth is the last master guaranteed when all are busy?

::: misses
- [any] $w/\sum w$ of the port.
:::
:::
:::

::: check
kind: parts
given: R = 25 | 100 | 400; f = 400 | 800; n = 32

## A {R} Gb/s link's frames carry a 32-bit CRC computed at {f} MHz.

::: part
answer: R*1000/f
unit: bits
tolerance: 0.5%

### How many bits per clock must the CRC engine take?

::: misses
- [any] Rate over clock.
:::
:::

::: part
answer: 2^ceil(log(R*1000/f)/log(2) - 1e-9)
unit: bits
tolerance: 0

### What power-of-two datapath width covers it?

::: misses
- [any] Round up to a power of two.
:::
:::
:::
:::
