2-to-1 multiplexer
A multiplexer, or mux, is a combinational circuit that selects one of several data inputs and passes it to a single output, chosen by the binary value on its select lines.
Picks one of two inputs.
Circuit diagram
Toggle the inputs and follow the signals: green wires are high, red are low. The highlighted row of the truth table below is the one you have set.
Truth table
| A | B | S | out |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Boolean expressions
- out
- ¬s ∧ a ∨ s ∧ b s chooses a when 0, b when 1
How it works
A multiplexer is a switch made of gates. The select line enables one of two AND gates, and an OR merges them, so exactly one input reaches the output at a time. Widen the select to n bits and you can choose between 2^n inputs.
Where it is used
- Choosing between two data sources, which is how a processor picks an operand.
- Implementing any boolean function directly, by wiring the truth table into the data inputs.
- Sharing one bus between several senders, one at a time.
Build it
One NOT for the select, two ANDs and one OR. Watch the output follow whichever input the select points at.
Or draw it from the expressions above with the circuit diagram generator, in either symbol standard, and export it as SVG, PNG, Verilog or VHDL.
Reference card
The diagram above as an image, black on white, for notes or a slide.
Click to download: 2-to-1 multiplexer circuit diagramQuestions about the 2-to-1 multiplexer
What is a multiplexer used for?
Choosing between data sources: a processor uses one to pick which register feeds the arithmetic unit, a communications link uses one to share a single wire between several senders, and any boolean function can be built directly from one by wiring its truth table into the data inputs.
What is the boolean expression for a 2-to-1 multiplexer?
Out = (¬S ∧ A) ∨ (S ∧ B). When S is 0 the first term passes A and the second is blocked; when S is 1 the roles swap. A 4-to-1 mux has two select lines and four such terms, one per input.
What is the difference between a multiplexer and a demultiplexer?
They are mirror images. A multiplexer has many inputs and one output, and the select chooses which input gets through. A demultiplexer has one input and many outputs, and the select chooses which output the input goes to. Put one of each on either end of a wire and several signals can share it in turn.