← ProblemsCircuits / Sequential Logic / Latches and Flip-Flops
Shift register stage
36%flip-flopsmuxproceduresImplement one stage of a shift register with load and enable controls. The flip-flop triggers on the rising edge of clk, and the controls have priority order:
- If
Lis 1, load:QcapturesR. - Else if
Eis 1, shift:Qcapturesw(the bit arriving from the neighboring stage). - Otherwise (
L = 0andE = 0), hold:Qkeeps its current value.
So: Q <= L ? R : (E ? w : Q).