What is Multiplexer?

A circuit that selects one of several inputs according to select signals and passes it to the output. The reverse, routing one input to one of several outputs, is a demultiplexer.

Field: Logic circuits

Japanese name: マルチプレクサ

How a multiplexer selects

A 2:1 multiplexer (mux) outputs Y = S'·A + S·B: input A when the select signal S is 0 and input B when S is 1. With n select bits a mux chooses among 2ⁿ inputs, so an 8:1 mux needs three select lines. In CMOS, muxes are built from AND-OR or NAND-NAND logic, from transmission gates, or as trees of 2:1 muxes for wide inputs. A mux is also a universal logic element: tying its data inputs to the constants of a truth table makes a 2ⁿ:1 mux implement any n-input Boolean function.

Where multiplexers appear

Processor datapaths are full of muxes: they select ALU operands from registers or immediates, forward results through bypass paths to avoid pipeline stalls, choose the next program counter and switch shared buses. FPGA logic blocks implement arbitrary functions with lookup tables (LUTs), which are small memories read out through a mux tree. In design for testability, scan flip-flops add a mux at the data input so the flip-flops can be chained into shift registers in test mode. On boards, analog multiplexers share one ADC among several sensors, and I2C multiplexers separate devices with identical addresses.

Multiplexers in HDL and synthesis

In Verilog or VHDL, a conditional assignment, if statement or case statement usually synthesizes to a multiplexer. A long if/else-if chain implies priority, giving a series of 2:1 muxes with long delay, while a case statement on mutually exclusive values tends to become a single wide parallel mux, although synthesis tools often optimize either form. A common pitfall is leaving some branch without an assignment in combinational logic, which infers a latch to hold the old value instead of a pure mux.

Multiplexer versus demultiplexer and decoder

A demultiplexer does the reverse of a multiplexer: it routes one input to one of 2ⁿ outputs chosen by the select bits. A decoder converts an n-bit code into 2ⁿ one-hot lines and is in effect a demultiplexer with its data input held at 1; decoders drive the select logic of large muxes and memory word lines. In communications, multiplexing more generally means sharing one channel among several signals by time, frequency or code.

Try it: questions about Multiplexer

Which correctly describes the function of a multiplexer?

  1. AIt stores the input value for one clock cycle
  2. BIt inverts the logic of the input signal
  3. CIt selects one of several inputs according to select signals and outputs it
Show answer and explanation

Answer: C. It selects one of several inputs according to select signals and outputs it

A multiplexer (selector) routes one of several inputs to its output according to a select signal; n select bits choose among 2ⁿ inputs. CPUs use them to pick register values and switch buses, and FPGA logic blocks (LUTs) implement arbitrary logic with memory plus multiplexers. A circuit that routes one input to one of several outputs is a demultiplexer.

FAQ

How many select lines does an 8-to-1 multiplexer need?

Three, because 2³ = 8. In general a mux with 2ⁿ data inputs needs n select lines.

What is the difference between a multiplexer and a demultiplexer?

A multiplexer selects one of several inputs and passes it to a single output. A demultiplexer takes a single input and steers it to one of several outputs.

How can a multiplexer implement any logic function?

Connect the select lines to the function's input variables and tie each data input to 0 or 1 according to the truth table. The mux then outputs the correct table entry for every input combination, which is how FPGA lookup tables work.

Questions that mention Multiplexer (3)

Multiplexer appears in 4 practice questions across 4 topics, including Logic circuits, Testing and inspection, Embedded Systems & Firmware.

  1. Which correctly describes scan design, a form of design for testability (DFT)?
  2. You want to connect two identical I2C temperature sensors to the same I2C bus, but both have the same address. Which is a correct solution?
  3. In combinational logic, how does a long if/else-if chain compare with a case statement whose conditions are mutually exclusive?

Books on Logic circuits Ad

Learn hands-on: parts and kits

Building real circuits is a good way to check what you learned in the questions.

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary