43 / 63 · Check
Design check: latency, alignment and preserving accepted inputs
Check shift direction together with accepted-data movement count and observation points.
Lessons are free to read. Enroll to save your learning progress.
Fix the reference point for counting latency
A three-bit registerRegister A circuit that stores multiple bits of state. The synchronous registers in this course store their specified inputs at a clock edge. Learn more executes q <= {q[1:0], din} only for valid inputs; valid=0 holds q. Starting from 0 just after resetReset A control that returns state to a specified initial value. Define whether it is synchronous or asynchronous and whether it has priority over other controls. Learn more, apply (valid,din) = (1,1), (0,0), (1,0), (1,1) at successive rising edgesRising edge The instant at which the clock changes from 0 to 1. Distinguish it from a level, which refers to the entire interval during which CLK=1. Learn more.
There are four clock edges but only three shifts. Check that state tracking agrees with any claim about “cycle latency.”
Each column below records a rising edge. Inputs are pre-edge; states labeled “after” are post-update. Alignment is sample order, not physical propagation delayPropagation delay The time from an input change until the output settles to the correct value. Logical equivalence and timing behavior are separate properties. Learn more. The diagram expands the given input sequence. The second column has valid=0, so state holds. Do not confuse the number of q updates with the number of clock columns.
View waveform data
| Signal | Wave | Bus values |
|---|---|---|
| edge | 2345 | E0 → E1 → E2 → E3 |
| valid | 101. | |
| din | 10.1 | |
| accepted count | 2.34 | 1 → 2 → 3 |
| q after | 2.34 | 001 → 010 → 101 |
Further design question
If the design is extended to a pipelinePipeline A structure that divides computation into register-separated stages and overlaps processing of multiple inputs. Data, valid and control signals must be aligned by stage. Learn more accepting eight-bit data per input, three data-register stages with only one valid-delay stage are incorrect. Apply the same movement rule to data and valid, or design acceptance and forwarding rules together for a stallable buffer.
Try it yourself
If the circuit shifts on every edge regardless of valid, how does the final q change for this input sequence?
Read the explanation
It also stores din=0 on the invalid cycle, giving 001 → 010 → 100 → 001. Final q is 001, rather than the 101 of the valid-only design. The implementation must honor the contract that invalid data values are ignored.
After applying the valid-qualified input sequence in the lesson, what are final q and the actual number of shifts?
The state sequence is 000 → 001 → 001 → 010 → 101. The second edge has valid=0 and holds state. A correct answer must account for shift direction, the shift condition and the number of shifts.