7. Registers
Learning Objectives
- Define a register and explain how it groups flip-flops to store multi-bit data
- Distinguish parallel loading from serial shifting of data in a register
- Explain the four shift register types: SISO, SIPO, PISO, and PIPO
- Trace how bits move through a shift register over successive clock pulses
- Explain how shift registers convert between serial and parallel data formats
- Identify where registers are used inside a CPU and in communication hardware
Quick Answer
A register is a group of flip-flops, all clocked together, used to store or move a multi-bit binary value as a single unit. An 8-bit register, for example, is simply eight D flip-flops sharing one clock, holding one byte. Registers come in two operating styles: parallel registers load and read all bits simultaneously, while shift registers move bits one position at a time on each clock pulse, which is how a register converts data between serial (one wire, one bit at a time) and parallel (many wires, all bits at once) formats. Registers matter because every CPU's working data — operands, addresses, results — lives briefly in registers, and every serial communication interface (like UART or SPI) relies on shift registers to convert data formats.
How Registers Work
Because a register is just several flip-flops clocked together, its behavior is entirely determined by how the flip-flops' D inputs are wired: to external data lines (parallel load) or to each other in a chain (serial shift).
Parallel Registers
In a parallel register, every flip-flop's D input connects to its own independent data line. On a clock edge, all bits load simultaneously — this is the fastest way to store or read a multi-bit value, and it's exactly what a CPU's general-purpose registers do: an 8-bit value arrives on 8 wires and is captured by 8 D flip-flops in one clock cycle.
Shift Registers
In a shift register, each flip-flop's D input connects to the Q output of the flip-flop before it. On every clock pulse, each stored bit moves one position down the chain — hence "shift." Shift registers are classified by how data enters and leaves:
SISO (Serial-In, Serial-Out): Data enters one bit at a time and exits one bit at a time, after passing through every stage. Used as a simple time-delay line.
SIPO (Serial-In, Parallel-Out): Data enters one bit at a time, but once all stages are filled, every bit can be read simultaneously from separate output lines. This is exactly how a UART receiver converts an incoming serial data stream into a parallel byte for the CPU to read.
PISO (Parallel-In, Serial-Out): All bits are loaded into the register simultaneously, then shifted out one at a time on subsequent clock pulses. This is how a UART transmitter converts a parallel byte from the CPU into a serial bitstream for transmission.
PIPO (Parallel-In, Parallel-Out): Data is loaded in parallel and read out in parallel — functionally this is just a basic parallel storage register, with the "shift" capability unused or absent.
| Type | Data In | Data Out | Typical Use |
|---|---|---|---|
| SISO | Serial | Serial | Time delay line |
| SIPO | Serial | Parallel | Serial-to-parallel conversion (e.g., UART receive) |
| PISO | Parallel | Serial | Parallel-to-serial conversion (e.g., UART transmit) |
| PIPO | Parallel | Parallel | General-purpose data storage |
Tracing a Shift Register
Consider a 4-bit SIPO register (Q3 Q2 Q1 Q0) with all bits initially 0, and the serial input sequence 1, 0, 1, 1 applied one bit per clock pulse:
| Clock Pulse | Serial In | Q3 Q2 Q1 Q0 |
|---|---|---|
| 0 | — | 0 0 0 0 |
| 1 | 1 | 1 0 0 0 |
| 2 | 0 | 0 1 0 0 |
| 3 | 1 | 1 0 1 0 |
| 4 | 1 | 1 1 0 1 |
After 4 clock pulses, the register holds 1101 — the original serial sequence, now available in parallel across the four outputs.
Registers Inside a CPU
Beyond shift registers, digital electronics registers show up as the CPU's general-purpose registers (holding operands during arithmetic), the program counter (holding the address of the next instruction), and the instruction register (holding the currently executing instruction). All of these are parallel registers built from D flip-flops — the CPU application is simply a specialized use of the same building block described above.
Common Misunderstanding
Students sometimes think a "register" always means the same thing as a CPU register (like RAX in x86 assembly). In digital electronics, "register" is a much more general term for any group of flip-flops storing multiple bits together — CPU registers are just one prominent application of the concept, alongside shift registers used purely for data format conversion, unrelated to any specific processor architecture.
Key Terms
| Term | Definition | Related Concept |
|---|---|---|
| Register | A group of flip-flops clocked together to store a multi-bit value | Flip-flops |
| Parallel register | A register that loads and reads all bits simultaneously | PIPO |
| Shift register | A register that moves stored bits one position per clock pulse | SISO, SIPO, PISO |
| SISO | Serial-In, Serial-Out shift register | Time delay |
| SIPO | Serial-In, Parallel-Out shift register | Serial-to-parallel conversion |
| PISO | Parallel-In, Serial-Out shift register | Parallel-to-serial conversion |
| PIPO | Parallel-In, Parallel-Out register | General storage |
| Program counter | A CPU register holding the address of the next instruction | Register application |
Common Mistakes
Misconception: "Register" in digital electronics always refers to a CPU register like the accumulator. Why it's wrong: CPU registers are just one application; the general concept covers any group of flip-flops storing bits together, including shift registers used purely for serial/parallel data conversion with no processor involved. Correct understanding: Treat "register" as a general term for grouped flip-flop storage, and recognize CPU registers, shift registers, and buffer registers as different applications of the same underlying building block.
Misconception: A shift register loses the original data once it starts shifting. Why it's wrong: Shifting simply moves each bit to the next flip-flop in the chain; unless new data is shifted in to replace it, or the register is cleared, no data is destroyed — it's just relocated one position at a time. Correct understanding: Track each bit's stage-by-stage position; data is only lost when it shifts out the final stage (in SISO/PISO) without being captured elsewhere, or when new bits overwrite existing ones.
Misconception: SIPO and PISO do the same job because they both "convert between serial and parallel." Why it's wrong: They convert in opposite directions — SIPO takes serial input and produces parallel output, while PISO takes parallel input and produces serial output. Using the wrong one for a UART design would connect data the wrong way. Correct understanding: Match the register type to the direction of conversion needed: incoming serial data needing to become parallel (like UART receive) needs SIPO; outgoing parallel data needing to become serial (like UART transmit) needs PISO.
Comparison and Connections
| Register Type | Load Method | Read Method | Common Application |
|---|---|---|---|
| PIPO | Parallel | Parallel | CPU general-purpose registers |
| SISO | Serial | Serial | Delay lines, simple buffering |
| SIPO | Serial | Parallel | UART receiver, serial-to-parallel conversion |
| PISO | Parallel | Serial | UART transmitter, parallel-to-serial conversion |
Practice Questions
Recall
-
How many flip-flops are needed to build an 8-bit register? 8 — one flip-flop per stored bit.
-
What does the "S" and "P" mean in shift register naming like SIPO? S means Serial (one bit at a time on one line); P means Parallel (all bits at once on separate lines).
Understanding
-
Explain why a SIPO register is used at a UART receiver rather than a PIPO register. Because the incoming data physically arrives one bit at a time on a single serial wire; a SIPO register can accept that serial stream and, once fully loaded, present it as a parallel byte for the CPU to read in one operation — a PIPO register has no way to accept a bit-at-a-time serial input.
-
Why do all flip-flops in a parallel register update on the same clock edge rather than one at a time? Because parallel loading is designed to capture an entire multi-bit value as a single atomic unit — if the bits loaded at different times, the register might briefly hold a mixture of old and new data, corrupting the value.
Application
-
You need to send an 8-bit value from a microcontroller out over a single serial wire, one bit at a time. Which shift register type should convert the data, and how is it loaded? A PISO register — load the 8-bit value in parallel in one clock cycle, then shift it out serially, one bit per subsequent clock pulse.
-
A 4-bit SIPO register starts at 0000. Serial input bits 1, 1, 0, 0 arrive over 4 clock pulses (MSB pushed in first, shifting toward Q3). What is the final parallel output? Following the same pattern as the worked example: pulse 1 gives 1000, pulse 2 gives 1100, pulse 3 gives 0110, pulse 4 gives 0011. Final output: Q3 Q2 Q1 Q0 = 0011.
Analysis
-
A student claims a PIPO register isn't really a "shift" register at all. Evaluate this claim. The claim has merit — a PIPO register loads and reads all bits in parallel and doesn't move data between stages internally, so it functions as a plain storage register rather than demonstrating the bit-shifting behavior that defines SISO, SIPO, and PISO registers. It's grouped with shift registers mainly for completeness of the input/output classification.
-
Compare using a shift register versus a parallel register for interfacing a microcontroller to eight separate LEDs that must all update at exactly the same instant. Which is appropriate, and why? A parallel (PIPO) register is appropriate, because all 8 LED states can be loaded simultaneously on one clock edge, guaranteeing every LED updates at the same instant — a shift register would require 8 separate clock pulses to load the same data, causing LEDs to update at different times.
FAQ
Why are shift registers so important for serial communication like UART or SPI? Because these protocols send data one bit at a time over a single wire to save pins and cabling, but the CPU internally works with whole bytes at once. Shift registers (SIPO for receiving, PISO for transmitting) are exactly the hardware needed to bridge between one-bit-at-a-time transmission and multi-bit-at-once processing.
Can a single shift register support both serial and parallel loading? Yes — many practical shift register ICs (like the 74HC595 or 74HC165) include a mode-select input that lets you choose parallel load or serial shift on demand, making them "universal" shift registers useful for many different applications.
What is the difference between a register and general RAM? Registers are a small number of very fast storage locations built directly into or very close to the processing logic (a CPU might have only 16-32 general-purpose registers), while RAM is a much larger but slower memory array addressed by location, used for bulk data storage.
How does a shift register work as a time delay line? Each clock pulse moves the data one stage further down the chain, so a bit takes exactly n clock cycles to travel through an n-stage SISO register before appearing at the output — effectively delaying the signal by a fixed, precise number of clock periods.
Why does the program counter count as a "register" if it behaves like a counter? Because a program counter is built from flip-flops that store the current instruction address (making it a register by structure) while also incorporating increment logic to advance to the next address each cycle — it's really a specialized counter that also serves as a storage register.
Quick Revision
- A register groups multiple flip-flops sharing one clock to store a multi-bit value
- Parallel registers load/read all bits at once; shift registers move bits one stage per clock pulse
- SISO: serial in, serial out — used for time delays
- SIPO: serial in, parallel out — used for serial-to-parallel conversion (UART receive)
- PISO: parallel in, serial out — used for parallel-to-serial conversion (UART transmit)
- PIPO: parallel in, parallel out — general-purpose storage, no real "shifting"
- CPU general-purpose registers, program counter, and instruction register are all parallel registers
- An n-stage SISO shift register delays a signal by exactly n clock cycles
Related Topics
Prerequisites: Flip-flops (especially D type), sequential circuits, counters
Related Topics: UART/SPI serial communication, CPU architecture, memory devices
Next Topics: Memory devices (RAM, ROM) and how they organize many registers into addressable storage