CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

8-to-1 Multiplexer via Case Statement

EasyVerilog / SystemVerilogBuild

Data routing networks in digital processors rely heavily on wide parallel multiplexers to select operands for the ALU or to route data onto shared buses. When synthesizing these data paths, engineers use case statements to cleanly infer parallel multiplexers without the priority routing logic that cascaded conditional statements generate.

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 sel must be explicitly handled.
  • The output y must reflect the selected input without any clock delay.

Topics

CombinationalMultiplexerCase Statement

Solve this problem

Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against a real testbench — you get the waveform back, not a stored answer.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

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.

Related problems

  • Single Continuous AssignmentEasy
  • Basic Vector ConcatenationEasy
  • Ternary Operator MuxEasy
  • Underscores for ReadabilityEasy
  • Left Hand Side ConcatenationEasy
  • Inout Port MechanicsEasy
  • Explicit Binary LiteralsEasy
  • Vector Port EndiannessEasy

Browse all problems · Learning tracks