8-to-1 Multiplexer via Case Statement
A case statement on the select lines describes a mux with no implied priority, unlike a chain of if/else.
The module routes one of eight 8-bit input buses to a single 8-bit output bus. A 3-bit select signal determines which input is passed through to the output.
This circuit is purely combinational. The output updates immediately whenever the select signal or any of the input buses change. There is no clock and no reset.
| Signal | Direction | Width | Description |
|---|---|---|---|
sel |
input | 3 | Select signal determining which input bus is routed to the output |
d0 |
input | 8 | Data input selected when sel is 3'b000 |
d1 |
input | 8 | Data input selected when sel is 3'b001 |
d2 |
input | 8 | Data input selected when sel is 3'b010 |
d3 |
input | 8 | Data input selected when sel is 3'b011 |
d4 |
input | 8 | Data input selected when sel is 3'b100 |
d5 |
input | 8 | Data input selected when sel is 3'b101 |
d6 |
input | 8 | Data input selected when sel is 3'b110 |
d7 |
input | 8 | Data input selected when sel is 3'b111 |
y |
output | 8 | Selected data output |
Constraints
- The circuit must be purely combinational.
- No latches may be inferred.
- All possible values of
selmust be explicitly handled. - The output
ymust reflect the selected input without any clock delay.
Topics
Solve this problem
Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against the problem's testbench. You get the waveform back, not a stored answer.
This problem is part of Codiode Pro. The statement above is free to read.
The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.
Part of Combinational RTL
Problem 13 of 15 in the Combinational RTL track.
Related problems
Browse all problems · Verilog practice problems · Learning tracks