Components / Gates
XOR Logic Gate (Exclusive OR) in Logisim
Exclusive OR gate (Y = A ⊕ B = A·~B + ~A·B) in Logisim: 2-input truth table, multi-input odd-parity behavior, and binary adder design.
| Library | Gates |
|---|---|
| Type name | XOR Gate |
| Pins and defaults | in0..inN (-50, ±10), out0 (0, 0), width 1..32, inputs 2..8 |
How the XOR Works in Logisim
The XOR Gate (Exclusive OR, written A ⊕ B) outputs High (1) when its two inputs differ (one is 0 and the other is 1) and outputs Low (0) when both inputs are equal (both 0 or both 1). Its Boolean algebra expression in Sum-of-Products form is Y = A·~B + ~A·B.
Multi-input behavior in Logisim: When you increase the Inputs attribute above 2 (from 3 up to 8 inputs), the XOR Gate operates as an odd-parity detector (A ⊕ B ⊕ C ...), outputting 1 whenever an odd number of active inputs are 1, and 0 when an even number of inputs are 1.
4-state propagation (E and Z): Unlike AND or OR gates, an XOR gate has no single controlling input value because flipping any input always flips the output. Consequently, if any connected input is Error (E), the XOR output is E. Unconnected input pins (floating Z) are ignored so long as at least one input is driven to 0 or 1; if all inputs are Z, the gate outputs E.
In digital arithmetic, the XOR gate is the heart of binary addition and subtraction: it computes the modulo-2 Sum bit in both the Half Adder (Sum = A ⊕ B) and the Full Adder (Sum = A ⊕ B ⊕ Cin), and acts as a programmable inverter when one input is used as a control line (X ⊕ 0 = X, while X ⊕ 1 = ~X).
Tip: Use an XOR gate as a controlled inverter: wire your signal to one input and an Invert control line to the other (when Control=0 the signal passes unchanged; when Control=1 it is inverted).
XOR Pins & Pinout
| Pin | Direction | Width | Location & Role |
|---|---|---|---|
| in0 .. in(N-1) | Input (Left edge) | 1–32 bits | Located at x = -50 (default 2 inputs at y = -10 and y = +10). Configurable from 2 to 8 inputs. |
| out0 (out) | Output (Right tip) | 1–32 bits | Located at (0, 0). Outputs 1 when an odd number of active inputs are 1 (A ⊕ B). |
XOR Truth Table & Behavior
| A | B | Y = A ⊕ B | Meaning |
|---|---|---|---|
| 0 | 0 | 0 | Inputs are equal → 0 |
| 0 | 1 | 1 | Inputs differ → 1 |
| 1 | 0 | 1 | Inputs differ → 1 |
| 1 | 1 | 0 | Inputs are equal → 0 |
| 0 or 1 | E | E | Any E input propagates to E |