Logic Circuits and Truth Tables
The core exam skill: reading a circuit diagram, tracing each signal through every gate, building the complete truth table and writing the Boolean expression. Systematically, every time.
In the exam, you will be shown a diagram of gates connected together and asked for a truth table. Students who learn the individual gates but never practice tracing compound circuits almost always get this wrong: not because they don't know the gates, but because they don't have a method.
A logic circuit diagram shows inputs on the left, gates in the middle and the final output on the right. Wires carry signals (0 or 1) between gates. The output of one gate feeds into the input of the next.
What to look for:
1. Identify all the inputs (labelled A, B, C, etc.): count them to determine how many rows the truth table needs (2^n rows).
2. Trace the signal from left to right: identify which gates take which inputs.
3. Identify any intermediate signals: the output of one gate becoming the input of another.
4. The final gate's output is the circuit output, labelled Q (or X, Y, or Z in some textbooks).
In a circuit with 2 inputs there are 4 rows. With 3 inputs there are 8 rows. Always start by writing out all input combinations in order (000, 001, 010, 011, 100, 101, 110, 111 for 3 inputs) before filling in any outputs. Missing rows cost marks even when other rows are correct.
Count inputs and draw the table. For n inputs, write 2^n rows. List all input combinations in binary counting order (00, 01, 10, 11 for 2 inputs). Add a column for each intermediate signal and the final output.
Identify the first gate(s) to evaluate. Start with gates that take only the original inputs (A, B, C): not gates that need intermediate signals. These are the "leftmost" gates in the circuit.
Fill in intermediate columns one gate at a time. For each row, apply the gate's rule to the input values and write the result. Label intermediate columns clearly: e.g. "NOT A" or "A AND B": to avoid confusion.
Work right across the table, gate by gate. Once you have the intermediate columns, fill in the final output column using the last gate's rule applied to its inputs (which may be intermediate signals).
Write the Boolean expression. Read the circuit diagram from right to left and write the expression for Q. For example: if the last gate is an OR taking (NOT A) and (A AND B) as inputs, the expression is Q = (NOT A) OR (A AND B).
This circuit has two inputs (A and B). B passes through a NOT gate first, then the output of NOT B and the original A both enter an AND gate. The final output is Q.
Boolean expression:
Circuit diagram:
Truth table: filled in step by step:
| A | B | NOT B | Q = A AND (NOT B) |
|---|---|---|---|
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
Reading this circuit in English: "Output is 1 only when A is 1 and B is 0." Only one row (A=1, B=0) gives output 1. This is a useful pattern: recognise it.
This circuit has three inputs. A and B enter an OR gate. C passes through a NOT gate. Both intermediate outputs then enter an AND gate to produce the final output Q.
Boolean expression:
Circuit diagram:
Truth table (8 rows: all combinations of A, B, C):
| A | B | C | A OR B | NOT C | Q |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Notice that Q is 1 exactly when C=0 and at least one of A or B is 1. The NOT C column halves the rows where output can be 1. Spotting this pattern helps you check your work: the circuit should output 1 exactly when "night mode" (C) is off and the system is activated (A or B). This is the corridor light problem from Lesson 1: now fully traced.
When asked to "write the Boolean expression for the output Q", trace from the final gate backwards through the circuit and build up the expression layer by layer.
Rule: The final gate gives you the outermost operator. Its inputs (which may themselves be gate outputs) become the operands, wrapped in brackets.
Example: If the last gate is an OR, and its left input comes from an AND gate (A, B) and its right input is a NOT gate (C), the expression is: Q = (A AND B) OR (NOT C).
No brackets needed when an input is a single variable: only use brackets around compound sub-expressions.
1. Writing expressions without brackets where they are needed: NOT A AND B is ambiguous (is it "(NOT A) AND B" or "NOT (A AND B)"?). Always bracket sub-expressions. 2. Starting from the left: always read expressions from right to left (final output first). 3. Omitting NOT: the NOT gate is easy to miss when tracing a circuit. Look for the inversion bubble.
Enter a Boolean expression and evaluate it for all input combinations. Use this to check your manually constructed truth tables and to explore more complex expressions.
Try these: (1) Enter A AND (NOT B) and verify it matches the truth table from Worked Example 1. (2) Enter (A OR B) AND (NOT C) and check all 8 rows match Worked Example 2. (3) Try (A NAND B) OR C: predict the truth table before you run it.
Quick quiz: logic circuits and truth tables
Q1. A logic circuit has 3 inputs. How many rows does the truth table have?
Q2. A circuit has the expression Q = A AND (NOT B). What is Q when A=1, B=0?
Q3. Which column should you fill in first when building a truth table from a circuit diagram?
Q4. What is the output of Q = (A OR B) AND (NOT C) when A=0, B=0, C=0?
Q5. A circuit shows an OR gate feeding into a NAND gate along with input C. Which part of the expression do you write first?
Look at the expression Q = (A AND B) OR (NOT A AND NOT B). Without building the full truth table, can you predict when Q will be 1? What gate does this circuit behave like?
Series complete!
You have covered all three lessons in Boolean Logic. Test yourself with the exam questions below: they are structured exactly like the questions you will see in the actual exam.