Logic Gates and Truth Tables: A Step-by-Step Exam Method
Logic circuits look intimidating because students try to read the whole diagram at once. A circuit with three gates feels like one enormous problem, and it is easy to freeze.
Every circuit, however busy it looks, is just gates connected in sequence. Work out one gate, write its output down, then feed that into the next. This lesson gives you a method that turns any circuit into a series of small, easy steps.
By the end of this lesson, you will be able to:
The six gates
You need the essential behaviour of six gates. Here they are in one place.
| Gate | Output is 1 when… |
|---|---|
| NOT | the single input is 0 (it inverts the input) |
| AND | both inputs are 1 |
| OR | at least one input is 1 |
| NAND | the AND result is 0 (AND then NOT) |
| NOR | both inputs are 0 (OR then NOT) |
| XOR | exactly one input is 1 |
Give XOR extra attention. Its output is 1 when the inputs are different, and 0 when they are the same. That “exactly one” rule is what separates it from OR, and it is the gate students most often get wrong.
How many rows does a truth table need?
The number of rows depends only on the number of inputs. For n independent binary inputs:
| Inputs | Rows |
|---|---|
| 1 input | 2 rows |
| 2 inputs | 4 rows |
| 3 inputs | 8 rows |
Work this out first, before you fill anything in. If you know a three-input circuit needs eight rows, you will not accidentally stop at six.
The circuit method
Here is the whole technique in one line:
Worked example 1
Take the expression:
Do not try to reach R in one jump. Create an intermediate column for the part in brackets:
Now the truth table has three inputs, so eight rows, plus the intermediate column X:
| A | B | C | X = A AND B | R = X OR C |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Notice how easy each column is on its own. X is simply “are A and B both 1?” Then R is simply “is X or C a 1?” The intermediate column did the hard work.
Worked example 2: adding NOT
Now try:
Here the placement of the NOT matters. It applies to A only, before the AND. Make an intermediate column for NOT A first:
| A | B | NOT A | R = (NOT A) AND B |
|---|---|---|---|
| 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 |
Brackets and inversion placement change the answer completely. Reading NOT A as a separate column keeps you from applying the NOT to the wrong value.
Exam Tip: always use intermediate columns
For any multi-gate circuit, create an intermediate column for each gate’s output. Do not try to calculate the final output in your head straight from the diagram. Intermediate columns make each stage visible, help you check your working, and reduce the chance of carrying an unnoticed error through the circuit.
- Reading OR as “one or the other but not both” — OR is 1 when at least one input is 1.
- Confusing XOR with OR — XOR needs exactly one input to be 1.
- Treating NAND / NOR as mysterious rather than AND / OR followed by NOT.
- Applying NOT to the wrong value.
- Using the wrong number of rows.
- Not recording intermediate outputs.
Check Your Understanding
- How many rows does a truth table with three inputs need?
- When is an XOR gate’s output 1?
- What is the quickest way to work out a NOR gate?
Check the answers
1. 2³ = 8 rows. 2. When exactly one input is 1 (the inputs differ). 3. Work out OR first, then invert the result with NOT.
Final Summary
Gates
NOT, AND, OR, NAND, NOR, XOR — know each one’s behaviour.
Rows
n inputs need 2ⁿ rows. Work this out first.
Method
Solve one gate at a time using intermediate columns.
XOR
Output 1 only when exactly one input is 1.