Registers & Shift Registers
Digital Electronics · 13 min read
A single flip-flop stores one bit. Connect several together under a shared clock and you get a register — the basic word-storage unit inside every processor, memory chip, and serial interface.
Registers become intuitive only when you can see bits being captured and moved. Every section below has an interactive demo — press the clock button and watch what happens.
1. Parallel-Load Register
Four D flip-flops share a single clock line and an enable (EN) gate. On the active clock edge — when EN is HIGH — every flip-flop samples its D input at exactly the same instant. Before the edge, Q holds whatever it captured last.
Try it — interactive capture
Toggle the D input bits, then press ↑ Clock Edge to capture them into Q. Watch the stored word update and the binary/decimal/hex interpretation below change.
Before and after the clock edge
2. Shift Register Types
Instead of loading all bits at once, a shift register moves data one bit per clock cycle. The four modes are named by how data enters and exits.
| Type | Full name | Typical use |
|---|---|---|
| SISO | Serial In, Serial Out | Delay lines, serial links |
| SIPO | Serial In, Parallel Out | UART/SPI receivers, bus expansion |
| PISO | Parallel In, Serial Out | UART/SPI transmitters |
| PIPO | Parallel In, Parallel Out | Pipeline registers, CPU buffers |
3. SISO — Serial In, Serial Out
Each clock edge pushes every bit one stage to the right. The oldest bit exits the last stage. Press Next Clock → below and watch 1011 load stage by stage.
4. SIPO — Serial In, Parallel Out
Same shift chain as SISO, but all four Q outputs are tapped simultaneously. After N clock cycles the full N-bit word appears at Q[3:0] at once — serial to parallel conversion.
- UART receiver: samples each data bit from the line, assembles a parallel byte.
- SPI slave: shifts in the MOSI stream and presents a parallel byte to the MCU.
5. PISO — Parallel In, Serial Out
A control signal selects between two modes: LOAD (all D inputs captured in one cycle) and SHIFT (bits serialised out one per clock).
6. PIPO — Parallel In, Parallel Out
All bits in, all bits out — a pure pipeline register. It captures a snapshot of the data bus on the clock edge and holds it stable for one cycle while the next stage processes it.
7. Ring Counter
Feed the last flip-flop’s Q output back to the first flip-flop’s D input and the register becomes a ring counter. A single 1 circulates continuously — one position per clock.
Watch the bit circulate
- One-hot output — exactly one Q is HIGH at any time.
- N flip-flops produce N unique states (vs 2N for a binary counter).
- Used for simple sequencing, LED chasers, and one-hot state machines.
8. Johnson Counter
Feed back the complement of the last output — a “twisted ring” — and the counter produces 2N unique states from N flip-flops, with only one bit changing per clock (glitch-free decoded outputs).
| State | Q3 | Q2 | Q1 | Q0 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 |
| 3 | 1 | 1 | 1 | 0 |
| 4 | 1 | 1 | 1 | 1 |
| 5 | 0 | 1 | 1 | 1 |
| 6 | 0 | 0 | 1 | 1 |
| 7 | 0 | 0 | 0 | 1 |
9. LFSR (Linear Feedback Shift Register)
XOR selected tap outputs and feed the result back to the input. With the right tap polynomial, an N-bit LFSR cycles through states — a pseudo-random binary sequence (PRBS).
10. Real Applications
| Register type | Real-world uses |
|---|---|
| Parallel register (PIPO) | CPU registers, pipeline buffers, bus latches |
| Shift register (SISO) | Delay lines, synchroniser chains |
| SIPO shift register | UART/SPI receivers, LED driver ICs |
| PISO shift register | UART/SPI transmitters, keyboard encoders |
| Ring counter | One-hot state machines, LED chasers, sequencing |
| Johnson counter | Phase generation, glitch-free decoders |
| LFSR | CRC, data scrambling, BIST, test patterns |