Truth tables for logic gates show every possible input combination and the resulting output. For a two-input gate, inputs are usually labeled A and B, while the output is Y. A 0 represents false or low, and a 1 represents true or high.
Read each row from left to right: identify the input values, apply the gate’s Boolean rule, and then check the output column. The complete set of rows makes gate truth tables useful for predicting circuit behavior without inspecting the circuit’s internal design.
How do you read truth tables for logic gates?
A two-input truth table has four rows because two binary inputs produce four combinations: 00, 01, 10, and 11. The order of A and B matters when reading a row, even though several basic gates produce the same result when the inputs are swapped.
- A = 0, B = 0: both inputs are low.
- A = 0, B = 1: A is low and B is high.
- A = 1, B = 0: A is high and B is low.
- A = 1, B = 1: both inputs are high.
The expression beside a gate states its Boolean operation. For example, Y = A · B means “A AND B.” The output column translates that operation into a result for each row.
What does a truth table for an AND gate show?
An AND gate uses the expression Y = A · B. Its plain-language rule is: the output is 1 only when both inputs are 1. Any 0 input makes the output 0.
- A = 0, B = 0 → Y = 0
- A = 0, B = 1 → Y = 0
- A = 1, B = 0 → Y = 0
- A = 1, B = 1 → Y = 1
This truth table for an AND gate is the reference for understanding NAND, which reverses the AND output.
How do OR, NOT, NAND, and NOR gate truth tables work?
An OR gate uses Y = A + B. Its rule is: the output is 1 when at least one input is 1, including when both inputs are 1.
- 0, 0 → 0
- 0, 1 → 1
- 1, 0 → 1
- 1, 1 → 1
A NOT gate has one input and uses Y = ¬A. It inverts its input, so 0 becomes 1 and 1 becomes 0.
- A = 0 → Y = 1
- A = 1 → Y = 0
A NAND gate uses Y = ¬(A · B). It is an AND gate followed by NOT, so its output is the inverse of the AND output: it is 0 only when both inputs are 1.
- 0, 0 → 1
- 0, 1 → 1
- 1, 0 → 1
- 1, 1 → 0
A NOR gate uses Y = ¬(A + B). It is an OR gate followed by NOT, so its output is the inverse of the OR output: it is 1 only when both inputs are 0.
- 0, 0 → 1
- 0, 1 → 0
- 1, 0 → 0
- 1, 1 → 0
How do XOR and XNOR gate truth tables differ?
An XOR gate uses Y = A ⊕ B. Its rule is: the output is 1 when exactly one input is 1. XOR is not the same as inclusive OR because XOR returns 0 when both inputs are true.
- 0, 0 → 0
- 0, 1 → 1
- 1, 0 → 1
- 1, 1 → 0
An XNOR gate uses Y = ¬(A ⊕ B). It is XOR followed by NOT, so it inverts the XOR output. The output is 1 when the inputs match and 0 when they differ.
- 0, 0 → 1
- 0, 1 → 0
- 1, 0 → 0
- 1, 1 → 1
