In
digital circuit design, the selector wires are of digital value. In the case of a 2-to-1 multiplexer, a logic value of 0 would connect I_0 to the output, while a logic value of 1 would connect I_1 to the output. In larger multiplexers, the number of selector pins is equal to \left \lceil \log_2(n) \right \rceil where n is the number of inputs. For example, 9 to 16 inputs would require no fewer than 4 selector pins and 17 to 32 inputs would require no fewer than 5 selector pins. The binary value expressed on these selector pins determines the selected input pin. A 2-to-1 multiplexer has a
Boolean equation where A and B are the two inputs, S_0 is the selector input, and Z is the output: : Z = ( A \wedge \neg S_0) \vee (B \wedge S_0) or : Z = ( A \cdot \overline{S_0}) + (B \cdot S_0) Which can be expressed as a
truth table: Or, in simpler notation: These tables show that when S_0 = 0 then Z = A but when S_0 = 1 then Z = B. A straightforward realization of this 2-to-1 multiplexer would need 2 AND gates, an OR gate, and a NOT gate. While this is mathematically correct, a direct physical implementation would be prone to
race conditions that require additional gates to suppress. Larger multiplexers are also common and, as stated above, require \left \lceil \log_2(n) \right \rceil selector pins for n inputs. Other common sizes are 4-to-1, 8-to-1, and 16-to-1. Since digital logic uses binary values, powers of 2 are used (4, 8, 16) to maximally control several inputs for the given number of selector inputs. File:Multiplexer 4-to-1.svg|4-to-1 mux File:Multiplexer 8-to-1.svg|8-to-1 mux File:Multiplexer 16-to-1.svg|16-to-1 mux The Boolean equation for a 4-to-1 multiplexer is: :Z = (A \wedge \neg {S_1} \wedge \neg S_0) \vee (B \wedge \neg S_1 \wedge S_0) \vee (C \wedge S_1 \wedge \neg S_0) \vee (D \wedge S_1 \wedge S_0) or :Z = (A \cdot \overline{S_1} \cdot \overline{S_0}) + (B \cdot \overline{S_1}. S_0) + (C \cdot S_1 \cdot \overline{S_0}) + (D \cdot S_1 \cdot S_0) Which can be expressed as a
truth table: The following 4-to-1 multiplexer is constructed from
3-state buffers and AND gates (the AND gates are acting as the decoder): The subscripts on the I_n inputs indicate the decimal value of the binary control inputs at which that input is let through.
Chaining multiplexers and mux trees Larger multiplexers can be constructed by using smaller multiplexers by chaining them together in what are called "mux trees". For example, an 8:1 multiplexer can be made with two 4:1 multiplexers and one 2:1 multiplexer. The two 4:1 multiplexer outputs are fed into the 2:1 with the selector pins on the 4:1's put in parallel, giving a total number of selector inputs to 3, which is equivalent to an 8:1.
List of ICs which provide multiplexing S54S157 quad 2:1 mux For
7400 series part numbers in the following table, "x" is the logic family. ==Digital demultiplexers==