RTL Studio Open IDE

Multiplexers

Combinational 8:1 MUX (32-Bit Datapath, Enable)

Combinational 8:1 mux selecting one of eight 32-bit words when enabled.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

Combinational 8:1 MUX (32-Bit Datapath, Enable) is a Verilog reference block in the Multiplexers catalog. Multiplexers, demultiplexers, and data-path selectors. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This IP core implements a fully synthesizable, latch-free 8-to-1 multiplexer with a 32-bit data path. It selects one of eight input words based on a 3-bit select signal (sel) when the active-high enable signal (en) is asserted. When disabled, the output is forced to zero. The design is purely combinational, though it includes clock and reset ports for interface consistency with other IP cores in the system.

The mux_8to1 module provides a simple, efficient mechanism for routing 32-bit data. It is designed to be:

  • Synthesizable: Uses Verilog-2001 compliant syntax.
  • Latch-Free: Ensures predictable timing and avoids unintended latches.
  • Safe Default: Outputs zero when disabled.
  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Combinational 8:1 MUX (32-Bit Datapath, Enable).
  2. Read the Verilog module in the editor. The catalog line for this block: Combinational 8:1 mux selecting one of eight 32-bit words when enabled.
  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

PortDirectionWidthDescription
clkInput1Clock input (not used for logic, kept for consistency)
rst_nInput1Active-low reset (not used for logic, kept for consistency)
enInput1Active-high enable signal. Output is valid only when high.
selInput3Select signal for input channel (0-7).
d0Input32Data input 0
d1Input32Data input 1
d2Input32Data input 2
d3Input32Data input 3
d4Input32Data input 4
d5Input32Data input 5
d6Input32Data input 6
d7Input32Data input 7

Integration

### Instantiation Example

Verification

The provided testbench tb_mux_8to1.v verifies the following behaviors:

  1. Disable Check: Verifies output is zero when en is low.
  2. Select Check: Verifies output matches specific inputs (d0, d7, d4) based on sel.
  3. Cycle Check: Cycles through all 8 inputs to ensure correct routing.

### Running Simulation

To run the simulation using Icarus Verilog:

Expected output includes:

  • TC1 PASS - Output is 0 when disabled
  • TC2 PASS - Output matches d0
  • TC3 PASS - Output matches d7
  • TC4 PASS - Output matches d4
  • TC5 PASS - All inputs cycled correctly
  • Simulation ends with INFO: PASS

More in Multiplexers

All Multiplexers blocks