Bits march one position to the right on every clock tick. A ready-made registers circuit you can open in the TorchAnvil simulator.
Four D flip-flops in a line, each one's Q feeding the next one's D, all sharing a single clock. Whatever you put on the lever ends up in FF1 on the next tick; whatever was in FF1 moves to FF2; FF2 to FF3; FF3 to FF4. The data walks rightward across the lamps, one step per clock.
Set the lever on, press Clock four times. Watch a single 1
march from left to right: 1000 → 1100 → 1110 → 1111. Flip the lever
off and keep pressing — the trailing zeros follow: 0111 → 0011 → 0001 → 0000.
Here's the wiring, stage by stage:
The shared clock is the crucial part. All four FFs capture their D simultaneously — so FF2 gets the old FF1 value, not the new one. Without that synchronisation the whole thing would collapse into a single big latch instead of a chain.
| tick | lever | Q1 Q2 Q3 Q4 |
|---|---|---|
| 0 | 1 | 0 0 0 0 |
| 1 | 1 | 1 0 0 0 |
| 2 | 1 | 1 1 0 0 |
| 3 | 0 | 1 1 1 0 |
| 4 | 0 | 0 1 1 1 |
| 5 | 0 | 0 0 1 1 |
Shift registers are everywhere. They're how serial protocols like SPI and UART turn a stream of bits back into parallel words (and vice-versa). They're the heart of LFSR-based pseudo-random number generators. They're how you build polynomial arithmetic for CRCs. Even the WS2812 LED strips on your desk use shift registers internally to clock colour data from pixel to pixel.