4-input multiplexer

Design a 4-input multiplexer. It has four input signals (in0-in3) and
two selection signals (sel[1:0]). The output must be assigned the input
signal corresponding to the selection.

Specification

    module mux4(in0, in1, in2, in3, sel, out);
        input in0, in1, in2, in3;
        input [1:0] sel;
        output out;

Hint

Use 2-input multiplexers.

Input

- in0, in1, in2 and in3 are the inputs of the multiplexer.

- sel encodes the two selection signals.

Output

- out is the output of the multiplexer.

Problem information

Author: Jordi Cortadella

Generation: 2026-02-03T12:17:23.898Z

© Jutge.org, 2006–2026.
https://jutge.org
