RTL Studio Open IDE

Shift & Bit Manipulation

Arithmetic Right Shift 8-Bit — L1 Upgrade

Arithmetic right shift module with Valid/Ready handshake for 8-bit signed data.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

Arithmetic Right Shift 8-Bit — L1 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 implements a synchronous 8-bit arithmetic right shift operation. It accepts signed 8-bit data via a Valid/Ready handshake interface and shifts the data right by 1 bit, replicating the most significant bit (sign bit) to preserve the signed value.

The design is classified as an L1 Upgrade difficulty level, suitable for basic digital logic integration.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Arithmetic Right Shift 8-Bit — L1 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Arithmetic right shift module with Valid/Ready handshake for 8-bit signed data.
  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.

Interface

The module uses a synchronous interface with active-high clock and active-low reset. It supports a simplified Valid/Ready handshake where the ready_in signal is always asserted (hardwired to 1), indicating the module is always ready to accept new data on the next clock cycle.

Signal NameDirectionWidthDescription
clkInput1Clock signal
rst_nInput1Active-low reset
valid_inInput1Input data valid
ready_inOutput1Input ready (Always 1)
data_inInput8Input data [7:0]
valid_outOutput1Output data valid
data_outOutput8Output data [7:0]

Architecture

The design consists of a sequential register block that captures input data when valid_in is high. On the rising edge of the clock, the input data is shifted right arithmetically. The sign bit (data_in[7]) is replicated into the new MSB position (data_out[7]), while bits [7:1] are shifted into [6:0]. The output valid_out is asserted when valid data is present in the output register.

Verification

The testbench verifies six specific test cases covering positive numbers, negative numbers, zero, and signal behavior. All tests passed successfully in simulation.

Test CaseInput HexExpected OutputResult
TC1: Positive Shift0x150x0APASS
TC2: Negative Shift0xFB0xFDPASS
TC3: Zero Shift0x000x00PASS
TC4: Positive Max0x3F0x1FPASS
TC5: Negative Min0xC00xE0PASS
TC6: Ready SignalN/A1'b1PASS

More in Shift & Bit Manipulation

All Shift & Bit Manipulation blocks