Implement a 4-bit synchronous Left Shift Register using four positive-edge-triggered D Flip-Flops connected in series.
Constraints:
D → Q0, Q0 → Q1, Q1 → Q2, Q2 → Q3.Behaviour reference:
| D | CLK | Q3+ | Q2+ | Q1+ | Q0+ |
|---|---|---|---|---|---|
| X | ↓ | Q3 | Q2 | Q1 | Q0 |
| 1 | ↑ | 0 | 0 | 0 | 1 |
| 0 | ↑ | 0 | 0 | 1 | 0 |
| 1 | ↑ | 0 | 1 | 0 | 1 |
| 1 | ↑ | 1 | 0 | 1 | 1 |
| 0 | ↑ | 0 | 1 | 1 | 0 |
A register is a group of flip-flops used to store a binary value. Each flip-flop stores one bit.
A 2-bit register uses two D flip-flops to store one 2-bit value.

A right shift register moves each stored bit from MSB to LSB at every active clock edge.

Serial In → Q3 → Q2 → Q1 → Q0 → Serial OutA left shift register moves each stored bit from LSB to MSB at every active clock edge.

Serial In → Q0 → Q1 → Q2 → Q3 → Serial OutA bi-directional shift register moves data in either direction.
DIR = 0: selects right shift.DIR = 1: selects left shift.DIR = 0: Right Shift | DIR = 1: Left Shift | Flip-Flop input |
|---|---|---|
SRin | Q2 | D3 |
Q3 | Q1 | D2 |
Q2 | Q0 | D1 |
Q1 | SLin | D0 |
SRin is the right-shift serial input.SLin is the left-shift serial input.
An edge detector is a sequential circuit that activates when the required input transition appears.
Rising-edge active-HIGH = Q0 · Q₁’
Falling-edge active-HIGH = Q₀’· Q1| Rising Edge (0 → 1) | Falling Edge (1 → 0) | |
|---|---|---|
Active-HIGH output pulse Idle: 0 Active: 1 | ![]()
| ![]()
|
Active-LOW output pulse Idle: 1 Active: 0 | ![]()
| ![]()
|
Applications
Shift registers convert and transmit data in serial or parallel form.
| Type | Input method | Output method | Application |
|---|---|---|---|
PIPO | Parallel | Parallel | Data storage or bus buffer |
SISO | Serial | Serial | Digital delay line |
SIPO | Serial | Parallel | Serial data receiver |
PISO | Parallel | Serial | Serial data transmitter |
All input bits are loaded together and appear together at the outputs.

P3_P2_P1_P0 → Q3_Q2_Q1_Q0Bits enter and leave one at a time. A 4-bit SISO delays the first bit by four active clock edges.

Serial In → Q3 → Q2 → Q1 → Q0 → Serial OutBits enter serially. After four active clock edges, the 4-bit word is available at Q3 to Q0.

Serial In → Q3 → Q2 → Q1 → Q0A PISO register loads a complete word and then shifts it out one bit at a time. It uses an additional LOAD input.

LOAD = 1: Parallel input data is loaded.LOAD = 0: Data is shifted toward Serial Out.PISO → Transmission Line → SIPO
LOAD = 1: The PISO register loads the parallel data.LOAD = 0: The PISO register transmits one bit per active clock edge.Applications

Circuit behaviour
IN generates a HIGH pulse, which is loaded into Q3 on the following active clock edge.Functional table
| Clock event | IN | Q3 | Q2 | Q1 | Q0 | LED Glowing |
|---|---|---|---|---|---|---|
↑ | 1 | 0 | 0 | 0 | 0 | NONE |
↑ | 0 | 0 | 0 | 0 | 0 | NONE |
↑ | 0 | 1 | 0 | 0 | 0 | LED3 |
↑ | 0 | 0 | 1 | 0 | 0 | LED2 |
↑ | 0 | 0 | 0 | 1 | 0 | LED1 |
↑ | 0 | 0 | 0 | 0 | 1 | LED0 |
↑ = rising clock edge.

Implementation:
0000. (A + B + C) detects a button press using only a 3-input OR gate. 5, 1, 7. It sets UNLOCK = 1 only for this sequence.R is inverted before reaching the active-LOW CLR inputs. Pressing R clears every PIPO stage.Working
UNLOCK = 1.UNLOCK = 0. Press R to clear the stored sequence.5 → 1 → 7 → UNLOCK = 1