Choosing between two inputs

A multiplexer (MUX) is a selector switch built from gates. The 2-to-1 MUX is the smallest one:
- Two data inputs,
aandb. - One select line,
s. - One output,
y.
The rule: when s = 0 the output copies a, and when s = 1 it copies b. Selection shows up everywhere in a processor, choosing which value flows next, so this block is worth knowing cold.
