Code Conversion
8-to-16 Zero Extension — L1 Upgrade
Registered 8-to-16 bit zero extension with enable control and valid handshake.
About this block
Simulate it in the Verilog IDE
8-to-16 Zero Extension — L1 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) implements a registered 8-to-16 bit zero extension module with enable control and a valid handshake signal. It is designed for low-latency data width expansion in synchronous systems, specifically targeting Level 1 (L1) cache or buffer upgrades where data integrity and synchronization are critical.
### Key Features
- Registered Output: Data is latched on the positive clock edge, ensuring synchronous system integration.
- Zero Extension: Automatically pads the upper 8 bits of the 16-bit output with zeros.
- Enable Control: Gates data propagation; output holds its state when
enis low. - Valid Handshake: A
validsignal indicates when the output data is stable and ready for consumption. - Asynchronous Reset: Active-low reset clears both data and valid signals immediately.
- Choose Open in IDE. RTL Studio loads the packaged workspace for 8-to-16 Zero Extension — L1 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: Registered 8-to-16 bit zero extension with enable control and valid handshake.
- 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.
Ports
| Port | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low asynchronous reset |
en | Input | 1 | Enable signal (high to propagate data) |
din | Input | [7:0] | 8-bit data input |
valid | Output | 1 | High when output data is valid |
dout | Output | [15:0] | 16-bit zero-extended data output |
Integration
### Instantiation Example
### Timing Behavior
- Reset: When
rst_nis low,validanddoutare forced to 0. - Enable High: On the next positive clock edge,
validgoes high, anddoutbecomes{8'b0, din}. - Enable Low:
validgoes low, anddoutis cleared to 0 (as per RTL implementation).
Verification
The provided testbench (tb/tb_zero_extend_enable_registered_8to16.v) covers the following scenarios:
- TC1: Reset State: Verifies that
validanddoutare zero after reset deassertion. - TC2: Enable Data (0xAB): Checks propagation of
0xABwith zero extension. - TC3: Enable Data (0xFF): Checks propagation of
0xFFwith zero extension. - TC4: Disable State: Verifies behavior when enable is toggled off.
- TC5: Zero Extension: Confirms upper 8 bits of
doutare always zero.
### Running Simulation
- Compile: Compile the RTL and Testbench using your preferred simulator (e.g.,
iverilog,vcs, ormodelsim). - Run: Execute the simulation.
- Check Results: Look for the following output in the console:
More in Code Conversion
- 16-Bit Priority Encoder — L1 Upgrade — L2 Upgrade
- 4-Bit BCD to Binary Converter — L2 Upgrade
- 4-Bit Binary to BCD Converter (Shift-and-Add-3)
- 4-Bit Thermometer to Binary Encoder
- 8-Bit One-Hot Encoder
- 8-Bit Priority Decoder (One-Hot to Binary) — L1 Upgrade — L2 Upgrade
- 8-Bit Thermometer to Binary Encoder
- 8-Bit to 16-Bit Sign Extender
- Binary to Excess-3 4-bit — L1 Upgrade — L2 Upgrade
- Binary→Thermometer Compare-Gen (8→9)
- Binary→Thermometer LUT (4→15, Case) — L1 Upgrade — L2 Upgrade
- Gray-Code Incrementer 8-Bit
- N-Bit Gray to Binary Decoder
- N-bit Priority Encoder — L1 Upgrade — L2 Upgrade
- One-Hot→Binary Case Decode (4→2) — L1 Upgrade — L2 Upgrade
- One-Hot→Binary MSB-Priority OR Tree (8→3) — L1 Upgrade