RTL Studio Open IDE

Code Conversion

Binary to Excess-3 4-bit — L1 Upgrade — L2 Upgrade

Glitch-free 4-bit Binary to Excess-3 converter with Valid/Ready skid buffer for backpressure handling.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Binary to Excess-3 4-bit — L1 Upgrade — L2 Upgrade is a Verilog reference block in the Code Conversion catalog. Encoders, decoders, priority encoders, and binary/gray converters. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This Intellectual Property (IP) converts a 4-bit binary input to its 4-bit Excess-3 equivalent. It implements a glitch-free conversion with a Valid/Ready skid buffer for backpressure handling.

The design ensures data integrity during backpressure events by storing incoming data in a skid register, ensuring no data is lost when the downstream consumer is not ready.

This IP provides a robust, glitch-free conversion from 4-bit binary to Excess-3 code. It integrates a registered skid buffer to handle backpressure gracefully, ensuring no data loss when the downstream system is busy. The design is fully verified through simulation, covering basic conversion, backpressure holding, and skid buffer draining scenarios. It is suitable for integration into systems requiring reliable data transfer with flow control.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Binary to Excess-3 4-bit — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Glitch-free 4-bit Binary to Excess-3 converter with Valid/Ready skid buffer for backpressure handling.
  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.

Architecture

The module consists of two main components:

  1. Combinational Converter: Adds 3 to the input binary value to produce the Excess-3 code.
  2. Registered Skid Buffer: Manages flow control when the downstream ready signal is low. It holds the current output stable while storing the new converted data in an internal register.

Interface

Signal NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low reset
data_inInput4Binary input data
valid_inInput1Input valid signal
ready_outInput1Ready signal from downstream
data_outOutput4Excess-3 output data
valid_outOutput1Output valid signal

Verification

The testbench verifies basic conversion, backpressure handling, and skid buffer draining. All test cases passed successfully in the simulation log.

Test CaseDescriptionResult
TC1Basic conversion with valid/readyPASS
TC2Backpressure with ready=0PASS
TC3Skid buffer drainPASS
TC4Intermittent backpressurePASS

More in Code Conversion

All Code Conversion blocks