Components / Plexers
Multiplexer (MUX) in Logisim
Routes one of 2^S data inputs (D0..D(2^S-1)) to output Y based on the binary Select input S on the bottom edge.
| Library | Plexers |
|---|---|
| Type name | Multiplexer |
| Pins and defaults | in0..in(2^S-1) D0..Dn (-40, y), sel S (-20, bottom), out0 Y (0, 0), width 1..32, selectBits 1..4 |
How the MUX Works in Logisim
A Multiplexer (MUX) acts as a digitally controlled rotary switch. It has 2^S data inputs on its left edge (D0, D1, ...), a Select input (S) of width S bits on its bottom slanted edge, and a single output (Y) on the right.
The binary integer value on Select pin S chooses which data input is routed to Y: when S = 0, Y = D0; when S = 1, Y = D1, and so on. For a 2-to-1 MUX (selectBits = 1), the Boolean equation is Y = (~S · D0) + (S · D1).
Both the data bus width (width, 1 to 32 bits) and the number of Select Bits (selectBits, 1 to 4, giving 2, 4, 8, or 16 data inputs) are configurable. If the Select input S is floating (Z) or contains an Error (E), the MUX cannot determine which channel to route and outputs E.
Tip: In our 4-Bit ALU circuit, a 4-to-1 Multiplexer (selectBits = 2) selects between ADD, SUB, AND, and OR results using a 2-bit opcode on S.
MUX Pins & Pinout
| Pin | Direction | Width | Location & Role |
|---|---|---|---|
| in0 .. in(2^S-1) (D0..Dn) | Input (Left edge) | 1–32 bits | Located at x = -40 from top to bottom. D0 is the top-most input (selected when S = 0). |
| sel (S) | Input (Bottom edge) | 1–4 bits (selectBits) | Located at x = -20 on the bottom edge. Binary index of the data input to route to Y. |
| out0 (Y) | Output (Right edge) | 1–32 bits | Located at (0, 0). Outputs the value of data input D[S], or E if S is floating or invalid. |
MUX Truth Table & Behavior
| Select (S) | Selected Input | Output (Y) |
|---|---|---|
| 0 | D0 (top input) | D0 |
| 1 | D1 (bottom input) | D1 |
| Z or E | None (ambiguous) | E |