RTL Studio Open IDE

Shift & Bit Manipulation

8-Bit Barrel (Shift/Rotate × Left/Right) — L1 Upgrade — L2 Upgrade

8-bit registered barrel shifter and rotator with support for logical, arithmetic, and serial shift modes.

About this block

Simulate it in the Verilog IDE

Hardverilogsimsyn

8-Bit Barrel (Shift/Rotate × Left/Right) — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Shift & Bit Manipulation catalog. Shifters, rotators, bit masks, and bitwise manipulation blocks. Marked Hard: a larger reference. Simulate the packaged testbench before you change the RTL.

This IP provides a flexible 8-bit shift and rotate unit with registered outputs. It is designed for datapath applications requiring precise timing control via synchronous updates.

### Key Features

  • Registered Output: Outputs update on the clock edge, ensuring timing closure.
  • Multiple Modes: Supports 8 distinct operations including rotation, logical/arithmetic shifts, and serial shifts.
  • Synchronous Load: Allows parallel loading of data into the shift register.
  • Asynchronous Reset: Active-low reset forces output to zero.
  • Sign Preservation: Arithmetic shifts preserve the sign bit (MSB).
  • Fixed Step: Operates as a 1-bit shift per clock cycle. The shift_amt input is present for interface compatibility but is unused in this specific registered implementation.
  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Barrel (Shift/Rotate × Left/Right) — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: 8-bit registered barrel shifter and rotator with support for logical, arithmetic, and serial shift modes.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. 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.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
modeInput3Operation mode selector
shift_amtInput3Unused: Fixed 1-bit step implementation. Kept for interface consistency.
serial_inInput1Serial data input for shift operations
loadInput1Synchronous load enable
data_inInput8Parallel data input
data_outOutput8Shifted or rotated data output

Verification

The testbench verifies all 8 modes plus load and reset functionality. Simulation uses Icarus Verilog. All 10 test cases pass successfully.

Test CaseDescriptionExpected ResultStatus
TC1Rotate Left 10x55PASS
TC2Rotate Right 10xAAPASS
TC3Shift Left Logical 10x54PASS
TC4Shift Right Logical 10x2APASS
TC5Shift Left Arithmetic 10xC0PASS
TC6Shift Right Arithmetic 10xC0PASS
TC7Serial Shift Left0x01PASS
TC8Serial Shift Right0x80PASS
TC9Load Operation0xFFPASS
TC10Reset Operation0x00PASS

More in Shift & Bit Manipulation

All Shift & Bit Manipulation blocks