Shift Register (SIPO)
intermediate · sequential · 125 XP
Sign in to write your solution, run it in the simulator and submit it for grading.
Sign in or create a free account →Problem
Shift Register — SIPO (Serial-In Parallel-Out)
A 4-bit SIPO shift register. Data is clocked in serially via `si`, and after 4 clock cycles all 4 bits are available simultaneously on `po[3:0]`.
On every `posedge clk`: shift right and insert `si` at bit 3, so bits arrive LSB-first and the first bit received ends up in bit 0.
**Interface**
| Port | Direction | Description |
|-----------|-----------|---------------------------|
| `clk` | input | Clock |
| `rst` | input | Synchronous reset |
| `si` | input | Serial input |
| `po[3:0]`| output | Parallel output (all bits)|
**Use case:** SPI receiver — the master sends 8 bits serially and the slave accumulates them into a parallel byte. UART receivers use this pattern.
After clocking in `si = 1,0,1,1` (bit 0 first): `po = 4'b1101` (bit 0 holds the first bit received, bit 3 the last).
Constraints
- 4-bit internal shift register exposed as parallel output.
- si enters at bit 0; po[3] holds the oldest bit.
- Use non-blocking assignments (<=).
Examples
Input: si sequence: 1,0,1,1
Output: po=4'b1101 after 4 cycles
Common questions
- What does the Shift Register (SIPO) problem ask you to build?
- Shift Register — SIPO (Serial-In Parallel-Out) A 4-bit SIPO shift register. Data is clocked in serially via `si`, and after 4 clock cycles all 4 bits are available simultaneously on `po[3:0]`.
- What constraints does Shift Register (SIPO) have?
- 4-bit internal shift register exposed as parallel output.; si enters at bit 0; po[3] holds the oldest bit.; Use non-blocking assignments (<=).
- What is an example input and output for Shift Register (SIPO)?
- Input si sequence: 1,0,1,1 gives output po=4'b1101 after 4 cycles.
- Which Verilog concepts does Shift Register (SIPO) practise?
- sequential, shift-register, SIPO, serial-to-parallel.