C7 · Problem set 8
Problem set 8: state machines, datapaths and clock domains
These problems use lessons 37 to 42: finite state machines, their analysis and their design, register-transfer design, crossing clock domains, and the state machine lab.
Check
A state machine has 9 states and 1 input bits.
(a)
How many flip-flops does binary encoding need?
(b)
How many more does one-hot need?
Check
A detector flags a 5-bit pattern, overlaps allowed.
(a)
How many states as a Moore machine?
(b)
How many flip-flops as a binary-encoded Mealy machine?
Check
In the 101 detector (S0 = 00, S1 = 01, S2 = 10, S3 = 11), write .
Write AND as · or & (or just AB), OR as +, XOR as ⊕, and NOT as ¬ or a trailing ': A·B + C' works.
Check
A shift-and-add multiplier for n = 16 bits adds in 1 ns with 0.6 ns of register overhead.
(a)
How long does one product take?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(b)
How many products per second, in millions?
Check
An operation of 3 steps of 2 ns each runs 10000 times, with 0.4 ns of overhead per clock.
(a)
How long does a single-cycle design take?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
(b)
A k-stage pipeline?
Check
The subtraction GCD machine starts with A = 70, B = 12.
(a)
How many subtractions from A happen before A first drops below B?
(b)
What's left in A then?
Check
A synchronizer clocked every 1 ns uses flops with τ = 50 ps and 0.05 ns setup.
(a)
By what factor does one extra stage raise the MTBF?
(b)
How many decades is that?
Check
A writer at 150 MHz sends bursts of 80 words; the reader runs at 100 MHz.
(a)
What FIFO depth does the burst need?
(b)
How long does the burst last?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
Check
A four-phase handshake with two-flop synchronizers passes words from 20 MHz to 50 MHz.
(a)
About how long per word?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(b)
About how many million words per second?
Check
A controller asserts done in state 10, and asserts load in state 01 when E is 1. Write the OR of load and done.
Write AND as · or & (or just AB), OR as +, XOR as ⊕, and NOT as ¬ or a trailing ': A·B + C' works.
Check
A 4-bit pointer steps from 7 to the next value (each of these values ends in a run of 1s).
(a)
How many bits change in Gray code?
(b)
How many change in plain binary?
Check
Two state machines have 4 and 3 states.
(a)
At most how many state pairs can an equivalence check visit?
(b)
How many transitions can it follow, with one input bit?
Check
A pulse of one fast-clock period, 5 ns, must cross into a domain whose clock period is 5 times longer.
(a)
How long is the slow domain's clock period?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(b)
What's the chance a raw pulse lands on a slow clock edge and is seen at all?
Check
A multi-cycle datapath shares one ALU across 3 steps of 4 ns, with 0.5 ns overhead per clock; a single-cycle version has 3 ALUs.
(a)
What's the multi-cycle time per result?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(b)
And the single-cycle time per result?
Check
A 3-bit Johnson counter has , and . From state = 010, what's the next state?
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
13 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.