Shift & Bit Manipulation
8-Bit Uni-Dir Shift Register (Load + SI) — L1 Upgrade — L2 Upgrade
8-Bit unidirectional shift register with parallel load and serial input support for logical and arithmetic shift-right operations.
About this block
Simulate it in the Verilog IDE
8-Bit Uni-Dir Shift Register (Load + SI) — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Shift & Bit Manipulation catalog. Shifters, rotators, bit masks, and bitwise manipulation blocks. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.
This IP core implements an 8-bit unidirectional shift register with parallel load capability.
It supports both logical and arithmetic shift-right operations, controlled by a mode select signal.
The design is fully synthesizable, latch-free, and compliant with Verilog-2001 standards.
- Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Uni-Dir Shift Register (Load + SI) — L1 Upgrade — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: 8-Bit unidirectional shift register with parallel load and serial input support for logical and arithmetic shift-right operations.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.
RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.
Features
- Data Width: 8 bits.
- Operations:
- Parallel Load (High Priority). - Shift Right (Logical or Arithmetic).
- Control Signals:
- load: Parallel load enable. - shift_en: Shift enable. - arith_mode: Selects between Logical (0) and Arithmetic (1) shift.
- Reset: Asynchronous active-low reset.
- Clock: Synchronous positive-edge triggered.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low asynchronous reset |
load | Input | 1 | Parallel load enable (High Priority) |
shift_en | Input | 1 | Shift enable (Active when load is low) |
arith_mode | Input | 1 | Shift mode select (1=Arithmetic, 0=Logical) |
serial_in | Input | 1 | Serial data input for Logical Shift MSB |
parallel_in | Input | [7:0] | Parallel data input for Load operation |
q | Output | [7:0] | Shift register output |
Architecture
The module utilizes a single always block triggered on the positive edge of clk or the negative edge of rst_n.
- Reset: When
rst_nis low, the outputqis forced to zero. - Load: If
loadis high,parallel_inis latched intoq, overriding any shift operation. - Shift: If
loadis low andshift_enis high, the register shifts right:
- Arithmetic Mode: The MSB (q[7]) is replicated into the new MSB position. - Logical Mode: The serial_in signal is injected into the new MSB position.
- Hold: If neither
loadnorshift_enis active, the current value is held.
### Block Diagram
Verification
The provided testbench covers the following scenarios:
- Asynchronous Reset
- Parallel Load
- Logical Shift Right (with
serial_in= 1 and 0) - Arithmetic Shift Right (Positive and Negative MSB)
- Hold State
All test cases are designed to pass successfully in simulation. To run the verification:
- Open your preferred HDL simulator.
- Compile the RTL file:
rtl/shift_register_8bit_unidir_load_si_arithmetic_mode_serial_in_arith.v - Compile the testbench:
tb/tb_shift_register_8bit_unidir_load_si_arithmetic_mode_serial_in_arith.v - Run the simulation and check the log for
INFO: PASS.
More in Shift & Bit Manipulation
- 16-Bit Bidirectional Shift Register (L/R + Load)
- 32-Bit Barrel (Nop / LSL / LSR / ROL)
- 32-Bit Funnel Shifter
- 32-bit Synthesizable Barrel Shifter — L2 Upgrade
- 8-Bit Barrel (Shift/Rotate × Left/Right) — L1 Upgrade — L2 Upgrade
- 8-Bit Bit Reversal (Endianness Independent) — L1 Upgrade
- 8-Bit Bit Reversal (Endianness Swap) — L1 Upgrade — L2 Upgrade
- 8-Bit Byte-Swap (Endianness Converter) — L1 Upgrade
- 8-Bit Parallel-to-Serial Converter
- Arithmetic Right Shift 8-Bit — L1 Upgrade
- Bit-Field Extract 16→8
- Bitfield Pack Insert 32-bit
- Byte Rotate 32-bit
- Circular Shift Param 8-bit
- Funnel Shift Merge 16-bit — L2 Upgrade
- Nibble Interleave / Deinterleave 16-bit — L2 Upgrade