Level 9: Crossroads
Open the level →Where it fits in the machine →
Task
Goal: build a multiplexer (MUX): selects one of two input bits.
A multiplexer (MUX) is a 2-to-1 digital switch. Three inputs: A, B (data) and Sel (selector). Rule: Sel=0 → output=A; Sel=1 → output=B.
The main idea: one selector bit steers the data flow: a MUX is a digital switch with no moving parts, only logic. Choosing a source by address is the basis of routing inside a processor.
Path to this level
The competencies this level develops and their formation levels.
Related Materials
- MUX (2→1) — digital switch
- How it is built from NAND — the multiplexer circuit
Solution for self-check
Try building the circuit yourself first. The solution below is a way to check yourself if you're stuck or have already solved it.
What you should get: with Sel=0 the output is A, with Sel=1 — B.
Formula: Q = (A AND NOT Sel) OR (B AND Sel). When Sel=0, line A is "open" (A AND 1 = A) and line B is "closed" (B AND 0 = 0). When Sel=1 — the other way around.
- Invert Sel through NOT — you get ~Sel.
- Feed A and ~Sel into the first AND.
- Feed B and Sel into the second AND.
- Combine the outputs of both ANDs through an OR. The OR result is Q.
Unlike an if-else in software, both MUX inputs are always "alive": A and B continuously drive their signals, and the MUX only passes the already-computed result of the selected input.
Check yourself
What happens if you remove the NOT from the Sel input?
Both AND lines would open at the same time, turning the MUX into OR(A,B): the choice between A and B disappears.