---
title: Problem set 7
heading: "Problem set 7: sequential circuits and timing"
eyebrow: C7 · Problem set 7
type: problems
---

::: hook
These problems use lessons 26 to 34: latches and flip-flops, sequential timing, registers and counters, counter design, shift registers and LFSRs, testing, and the timing lab.
:::

::: pool
pick: 12

::: check
kind: parts
given: P = 0.05 | 0.12; D = 0.4 | 1.2; S = 0.03 | 0.08; K = 0.05 | 0.1

## Registers ($t_{pcq}$ = {P} ns, setup {S} ns) surround {D} ns of logic; the capture clock is {K} ns late.

::: part
answer: P + D + S - K
unit: ns
tolerance: 0.5%

### What's the minimum period?

::: misses
- [P + D + S + K] A late capture clock helps setup.
- [any] $t_{pcq} + t_{pd} + t_\text{setup} - t_\text{skew}$.
:::
:::

::: part
answer: 1/(P + D + S - K)
unit: GHz
tolerance: 0.5%

### What's the maximum frequency?

::: misses
- [any] The reciprocal.
:::
:::
:::

::: check
kind: parts
given: Q = 0.03 | 0.06; C = 0.02 | 0.1; H = 0.02 | 0.05; K = 0.04 | 0.08

## A short path has $t_{ccq}$ = {Q} ns and {C} ns of logic, into a flop with {H} ns of hold; the capture clock is {K} ns late.

::: part
answer: Q + C - H - K
unit: ns
tolerance: 1%

### What's the hold slack?

::: misses
- [Q + C - H + K] A late capture clock hurts hold.
- [any] $t_{ccq} + t_{cd} - t_\text{hold} - t_\text{skew}$.
:::
:::

::: part
answer: H + K - Q
unit: ns
tolerance: 1%

### What's the least logic delay that avoids a violation?

::: misses
- [any] Solve for $t_{cd}$ at zero slack.
:::
:::
:::

::: check
kind: parts
given: T = 1 | 2 | 4; s = 0.05 | 0.1; t = 20 | 40; u = 30 | 100; f = 10 | 100

## A synchronizer has a {T} ns clock, {s} ns setup, flops with τ = {t} ps and $T_0$ = {u} ps, and data changing {f} million times a second.

::: part
answer: log(exp((T - s)*1000/t)/(u*1e-12*1e9/T*f*1e6))
tolerance: 0.5%

### What's the log10 of its MTBF in seconds, with two stages?

::: misses
- [any] $\log_{10}\frac{e^{(T - t_\text{su})/\tau}}{T_0f_\text{clk}f_\text{data}}$.
:::
:::

::: part
answer: (T - s)*1000/t/ln(10)
tolerance: 0.5%

### How many decades does a third stage add?

::: misses
- [any] $\frac{T - t_\text{su}}{\tau\ln10}$.
:::
:::
:::

::: check
kind: parts
given: n = 4 | 6 | 10; f = 8 | 100

## An n-flip-flop register with n = {n} runs from a {f} MHz clock.

::: part
answer: 2*n
tolerance: 0

### How many states does it have as a Johnson counter?

::: misses
- [any] $2n$.
:::
:::

::: part
answer: f*1000/(2*n)
unit: kHz
tolerance: 0.5%

### What frequency comes out of any one bit of that Johnson counter?

::: misses
- [any] The clock over the number of states.
:::
:::
:::

::: check
kind: parts
given: N = 6 | 10 | 12 | 24

## A divide-by-{N} counter is built from flip-flops.

::: part
answer: ceil(log(N)/log(2))
tolerance: 0

### How many flip-flops?

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

::: part
answer: 2^ceil(log(N)/log(2)) - N
tolerance: 0

### How many unused states must be checked for lock-up?

::: misses
- [any] $2^{\lceil\log_2N\rceil} - N$.
:::
:::
:::

::: check
kind: boolean
vars: Q, N
answer: Q ^ N
ops: xor

## A flip-flop is at Q and must go to N. Write the T input that does it.

::: right
Right: $T = Q \oplus N$, 1 when the bit must change.
:::

::: misses
- [any] Not yet. T toggles the flip-flop.
:::
:::

::: check
kind: parts
given: n = 5 | 8 | 16 | 31; f = 1 | 100

## A maximal-length LFSR of n = {n} bits runs at {f} MHz.

::: part
answer: 2^n - 1
tolerance: 0

### What's its period, in clocks?

::: misses
- [any] $2^n - 1$.
:::
:::

::: part
answer: (2^n - 1)/(f*1e6)
unit: s
tolerance: 0.5%

### How long until it repeats?

::: misses
- [any] Period over the clock rate.
:::
:::
:::

::: check
kind: parts
given: Y = 0.7 | 0.9; FC = 0.95 | 0.99 | 0.999

## A chip yields {Y} and is tested at {FC} coverage.

::: part
answer: (1 - Y^(1 - FC))*1e6
unit: ppm
tolerance: 0.5%

### What defect level ships?

::: misses
- [any] $1 - Y^{1 - FC}$.
:::
:::

::: part
answer: (1 - ln(1 - 100e-6)/ln(Y))*100
unit: %
tolerance: 0.1%

### What coverage would reach 100 ppm?

::: misses
- [any] Solve $1 - Y^{1 - FC} = 10^{-4}$.
:::
:::
:::

::: check
kind: parts
given: F = 5000 | 50000; c = 8 | 32; p = 500 | 4000; f = 20 | 100

## A design has {F} scan flops in {c} chains and needs {p} patterns at a {f} MHz scan clock.

::: part
answer: F/c
tolerance: 0.5%

### How long is each chain?

::: misses
- [any] $\frac{F}{c}$.
:::
:::

::: part
answer: p*F/c/(f*1e6)*1000
unit: ms
tolerance: 0.5%

### About how long does the test take?

::: misses
- [any] Patterns × chain length × clock period.
:::
:::
:::

::: check
kind: parts
given: L = 6 | 12 | 24; o = 0.3 | 0.8; k = 2 | 4 | 6

## Logic of {L} ns is pipelined evenly into {k} stages with {o} ns of overhead each.

::: part
answer: L/k + o
unit: ns
tolerance: 0.5%

### What's the clock period?

::: misses
- [any] $\frac Lk + o$.
:::
:::

::: part
answer: L + k*o
unit: ns
tolerance: 0.5%

### What's the latency?

::: misses
- [any] $L + ko$.
:::
:::
:::

::: check
kind: parts
given: n = 4 | 9 | 16; m = 0.6 | 1.2; s = 0.04 | 0.1

## A path sums {n} independent stages of {m} ns mean and {s} ns standard deviation.

::: part
answer: s*sqrt(n)
unit: ns
tolerance: 0.5%

### What's the path's standard deviation?

::: misses
- [any] $\sigma\sqrt n$.
:::
:::

::: part
answer: n*m + 2*s*sqrt(n)
unit: ns
tolerance: 0.5%

### What period gives about 97.7% yield (two standard deviations)?

::: misses
- [any] $n\mu + 2\sigma\sqrt n$.
:::
:::
:::

::: check
kind: parts
given: su = 0.05 | 0.15; ho = 0.02 | 0.08; t = 4 | 10

## A flip-flop with {su} ns setup and {ho} ns hold is clocked at {t} ns.

::: part
answer: su + ho
unit: ns
tolerance: 0.5%

### How wide is the window in which D must be stable?

::: misses
- [any] Setup plus hold.
:::
:::

::: part
answer: t - su
unit: ns
tolerance: 0.1%

### When does it open?

::: misses
- [any] Setup before the edge.
:::
:::
:::

::: check
kind: parts
given: n = 6 | 8 | 12; t = 0.5 | 1.5

## An n-bit ripple counter with n = {n} uses flops of {t} ns.

::: part
answer: n*t
unit: ns
tolerance: 0.5%

### How long does its top bit take to settle?

::: misses
- [any] $nt_{cq}$.
:::
:::

::: part
answer: 2^n
tolerance: 0

### How many clocks between the top bit's rising edges?

::: misses
- [any] $2^n$.
:::
:::
:::

::: check
kind: parts
given: N = 100 | 10000; b = 9600 | 115200

## A UART at {b} baud sends {N} bytes, each with a start and a stop bit.

::: part
answer: N*10/b*1000
unit: ms
tolerance: 0.5%

### How long does it take?

::: misses
- [N*8/b*1000] Each byte takes 10 bit times.
- [any] $\frac{10N}{\text{baud}}$.
:::
:::

::: part
answer: b/10
tolerance: 0.5%

### What's its byte rate?

::: misses
- [any] $\frac{\text{baud}}{10}$.
:::
:::
:::

::: check
kind: boolean
vars: Q2, Q1, Q0
answer: Q1 & Q0 | Q2 & ~Q0
ops: and, or, not
dontcare: 6, 7

## A divide-by-6 counter counts 000 to 101. Write $Q_2^+$ with 6 and 7 as don't-cares.

::: right
Right: $Q_1Q_0 + Q_2\bar Q_0$.
:::

::: misses
- [any] Not yet. $Q_2^+$ is 1 after states 3 and 4.
:::
:::
:::
