An XOR truth table shows the output of an exclusive OR gate for every possible input combination. The output is true, or 1, when exactly one input is true, or 1. It is false, or 0, when both inputs match: both are 0 or both are 1.
For two inputs named A and B, the rule is “one but not both.” This rule connects directly to the Boolean expression, the circuit symbol, and practical bit comparisons.
What does an XOR truth table show about one input but not both?
An XOR gate has two inputs and one output, commonly written as Y = A ⊕ B. The circled plus sign, ⊕, is the standard Boolean symbol for exclusive OR.
Use these checks to evaluate the output:
- If A is 0 and B is 0, neither input is true, so Y is 0.
- If A is 0 and B is 1, exactly one input is true, so Y is 1.
- If A is 1 and B is 0, exactly one input is true, so Y is 1.
- If A is 1 and B is 1, both inputs are true, so Y is 0.
The last case distinguishes XOR from inclusive OR. An inclusive OR gate produces 1 when both inputs are 1; an XOR gate produces 0 because the inputs are not different.
How does an XOR logic table list all four input pairs?
An XOR logic table lists each possible pair once. With two binary inputs, there are 2², or four, combinations. The output column records whether the inputs differ.
- A = 0, B = 0 → Y = 0: the inputs are equal.
- A = 0, B = 1 → Y = 1: the inputs are different.
- A = 1, B = 0 → Y = 1: the inputs are different.
- A = 1, B = 1 → Y = 0: the inputs are equal.
This makes XOR useful for detecting disagreement. The output is high only for the two mixed rows, 01 and 10. It is low for the matching rows, 00 and 11. Reading the rows in this order prevents the common error of assigning a true output to the 11 case.
What Boolean expressions are equivalent to XOR?
The compact expression is:
Y = A ⊕ B
An equivalent AND-OR-NOT expression expands the one-but-not-both rule into two valid paths:
Y = (A AND NOT B) OR (NOT A AND B)
The first term is true when A is 1 and B is 0. The second term is true when A is 0 and B is 1. Since either term can produce the output, the two terms are joined with OR.
In common Boolean algebra notation, the same expression is written:
Y = A′B + AB′
Here, the apostrophe means NOT, adjacent variables mean AND, and the plus sign means OR. Some programming and digital-logic contexts use the caret, ^, for XOR, especially in bitwise operations. The surrounding language or circuit notation determines whether that symbol means XOR.
How do you recognize an XOR gate diagram?
An XOR gate diagram uses the familiar curved outline of an OR gate, with one important addition: a second curved line appears on the input side, in front of the main gate outline. That extra curve identifies the exclusive function.
A labeled two-input diagram can be read like this:
A (input 1) + B (input 2) → XOR gate → Y (output)
- A and B: the two incoming binary signals.
- ⊕: the XOR operation between those signals.
- Y: the output, equal to 1 only when A and B differ.
For example, compare the bit strings 1011 and 1001 position by position with XOR:
1011 ⊕ 1001 = 0010
The 1 in the result marks the position where the input bits differ. Matching bit pairs produce 0, while differing pairs produce 1. The same behavior can toggle a control bit: XOR with 1 changes a bit, while XOR with 0 leaves it unchanged.









