Home / Learn Verilog / 4-to-1 Multiplexer

4-to-1 Multiplexer

Two select bits choose among four inputs.

The short versionTwo select bits choose among four inputs.

Theory in plain words

4:1 muxI0I1I2I3YSELy = d[sel]
4:1 mux

The basic idea

A 4:1 mux has four data inputs and a 2-bit select.

Why this comes up

Bigger selections for register files and ALU result choice.

The mechanics

Use case or an indexed vector: y = d[sel].

Where it is used

  • Everyday RTL design
  • FPGA and ASIC projects
  • Testbenches and debugging

Try it

mux4 with indexVerilog: edit and run

d[sel] picks bit number sel.

Quick check

1. 4:1 mux select width?