[10.3b] Truth Tables
Truth Tables
To build a truth table for a logic circuit or Boolean expression:
- Identify the number of unique inputs.
- Generate all possible combinations of 0s and 1s for these inputs.
- Apply the logical operations row by row to determine outputs.
Truth Table for Basic Logic Gates
| Input A | Input B | A AND B | A OR B | A XOR B | A NAND B | A NOR B | A XNOR B |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Single Input Gate: NOT
The NOT gate, also known as an inverter, takes a single input and outputs the opposite value.
| Input | NOT |
|---|---|
| 0 | 1 |
| 1 | 0 |
Worked examples by starting point
Use the tabs to see how the process differs depending on whether you start from a statement, an expression, or a circuit drawing. All examples use at most three inputs and a single output.
Scenario: Safety lamp
Statement: The safety lamp turns on when the power is available AND either the door is closed OR the override is active.
- Let inputs be:
A= power available,B= door closed,C= override active. - Translate to structure:
Q = A AND (B OR C).
How to complete the table: List all combinations of A,B,C. For each row, first evaluate the bracket (B OR C), then AND with A.
| A | B | C | B OR C | Q = A AND (B OR C) |
|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 1 | 0 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 1 | 1 |
1 | 1 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 1 |
Truth Table from Expression
Expression: F = (A AND B) OR NOT C
| A | B | C | A AND B | NOT C | F = (A AND B) OR NOT C |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
From a drawn circuit
Imagine a circuit where A and B feed an AND gate; C goes through a NOT gate; the outputs of AND and NOT feed an OR gate to produce Q. This corresponds to Q = (A AND B) OR (¬C).
Method: Add columns for each gate in the order signals flow: first A AND B, then ¬C, finally OR them to get Q.
| A | B | C | A AND B | ¬C | Q |
|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 1 | 1 |
0 | 0 | 1 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 1 | 1 |
0 | 1 | 1 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 1 |
1 | 0 | 1 | 0 | 0 | 0 |
1 | 1 | 0 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 1 |
General method: completing any truth table
- Name inputs clearly: Use
A,B,Cand decide what each represents. - Set the order of evaluation: Brackets first, then NOTs on named signals, then AND/OR as written or as gates are arranged.
- Create helper columns: For every sub-part (e.g.
A AND B,¬C), add a column to avoid mistakes. - Fill systematically: Work row by row. For three inputs list rows from
000to111. - Check a few rows: Pick edge rows such as all
0s and all1s to see if the output makes sense.
Deep Dive: Generating rows and spotting patterns
For two inputs you have four rows: 00, 01, 10, 11. For three inputs you have eight rows: 000 to 111. Increase the rightmost input every row; when it wraps, toggle the next input to the left. This keeps rows ordered and reduces omissions. With practice you will also recognise common patterns, such as XOR producing 0110 down its Q column for two inputs, or AND producing 0001. These patterns are useful checks but should not replace careful evaluation, especially when brackets or NOTs are involved.
Terminology recap
- Boolean: a value that is either
0or1. - Truth table: a table listing outputs for all input combinations.
- Logic expression: a symbolic statement using operators such as AND, OR, NOT.
- Logic circuit: a diagram built from gate symbols representing the same operations in hardware.
Key Takeaways
- Translate statements into a bracketed structure before evaluating rows.
- Add helper columns for each sub-expression or gate output to avoid losing track.
- Follow the circuit from left to right, writing one column per gate in that order.
- For three inputs, complete exactly eight rows from
000to111. - Do not simplify: compute the output exactly as the statement, expression, or circuit is given.