Topic 10 of 13
Registers
Groups of flip-flops that store and move data: parallel load, shift registers and register transfer.
← → move between slides · F full screen · M slide list
Before we start
Why this matters
How do those scrolling LED signs, or a string of slightly-too-enthusiastic Christmas lights, shuffle their pattern one step over, forever?
A shift register: a conga line of flip-flops, each one passing its bit to the next on every beat, with no one allowed to skip ahead. It's also, quite literally, how your CPU shuffles a byte of data from one corner of the chip to another. Let's get the conga line moving.
Outline
Topics in this chapter
Select a topic to jump to the slide that explains it.
Concept 1 of 4
Register structure and control
An n-bit register is n flip-flops sharing a clock, each storing one bit. Common controls: clear (force 0), load (accept new data), enable (allow change). With load = 1 the register accepts data on the next clock edge, and with load = 0 it holds. Operations: load, clear, hold, shift, transfer. In parallel load all bits enter in the same clock cycle.
Concept 2 of 4
Shift registers
A shift register moves its bits one place per clock. Shift left moves bits toward the MSB and a new bit enters at the right. Shift right moves toward the LSB and a new bit enters at the left. The four styles:
| Type | In | Out | Use |
|---|---|---|---|
| SISO | Serial | Serial | Delay lines |
| SIPO | Serial | Parallel | Serial to parallel conversion |
| PISO | Parallel | Serial | Parallel to serial conversion |
| PIPO | Parallel | Parallel | Storage, buffering |
A bidirectional register shifts either way under a direction control. A universal shift register supports hold, shift left, shift right and parallel load, usually with a 4-to-1 MUX at each flip-flop input.
Concept 2 of 4
Shift registers (cont.)
Interactive circuit
4-bit shift register (serial in, parallel out)
Click the switches to change the inputs and watch the LEDs. Use “Show truth table” when it appears.
Interactive circuit
4-bit shift register (serial in, parallel out) (cont.)
Concept 3 of 4
Register transfer language
RTL describes data movement between registers. R2 ← R1 copies R1 into R2. R1 ← R1 + 1 increments. R3 ← R1 AND R2 stores a logic result. A control condition can guard a transfer: P: R2 ← R1 happens only when P = 1.
Concept 4 of 4
Registers in CPUs
CPUs use registers for operands, addresses, instructions and status: general-purpose registers, the program counter, the instruction register and the status register. A register file holds several registers, and selected ones feed the ALU. Registers are very fast and small. Main memory has more capacity and is slower.
Truth tables
Truth tables
4-bit shift right, serial in 1 0 1 1
| Clock | 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 |
Register operations
| Clear | Load | Shift | Operation |
|---|---|---|---|
| 1 | X | X | Clear to 0 |
| 0 | 1 | X | Parallel load |
| 0 | 0 | 1 | Shift |
| 0 | 0 | 0 | Hold |
Four shift-register types
| Type | Data in | Data out |
|---|---|---|
| SISO | serial | serial |
| SIPO | serial | parallel |
| PISO | parallel | serial |
| PIPO | parallel | parallel |
Interactive
Demo: shift registers and register transfer
Worked example 1 of 2
Worked example 1
Show the solution
- Shift in 1: 1000
- Shift in 0: 0100
- Shift in 1: 1010
- Shift in 1: 1101
Worked example 2 of 2
Worked example 2
Show the solution
Practice
Practice (1 of 2)
Try each one on paper first, then check your answer.
Show the answer
Show the answer
Show the answer
Practice
Practice (2 of 2)
Try each one on paper first, then check your answer.
Show the answer
Show the answer
Chain D flip-flops into a 4-bit shift register driven by one Clock.
Gate ForgeA free circuit simulator — place and wire gates, generate truth tables and timing diagrams, and work through 90+ guided problems.Check yourself
Quiz
Summary
Summary
- A register is n flip-flops with a shared clock.
- Controls: clear, load, enable. Load = 0 means hold.
- SISO, SIPO, PISO, PIPO describe serial or parallel in and out.
- RTL: R2 ← R1 copies a register.
- Registers are fast and small compared with memory.