You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
A truth table is a structured way of showing all possible input combinations for a logic gate or circuit and the resulting outputs. Truth tables are a fundamental tool in GCSE Computer Science — you must be able to read, complete and construct them.
A truth table is a table that lists:
Truth tables allow us to see the complete behaviour of a logic system at a glance.
The number of rows in a truth table depends on the number of inputs. For n inputs, there are 2^n (2 to the power of n) possible combinations:
| Number of Inputs | Number of Rows (2^n) |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 8 |
| 4 | 16 |
Exam Tip: If a question asks you to draw a truth table for a circuit with 3 inputs, your table MUST have 8 rows of data (plus a header row). Missing rows will lose marks. Use the formula 2^n to check.
There is a systematic way to fill in the input columns so you never miss a combination. For each column, alternate the values in a pattern:
| A | B | C |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| 1 | 1 | 1 |
This is equivalent to counting in binary from 000 to 111 (0 to 7 in decimal).
Here are the truth tables for all six gates you need to know:
| A | ¬A |
|---|---|
| 0 | 1 |
| 1 | 0 |
| A | B | A ∧ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | A ∨ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
| A | B | A ⊕ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| A | B | ¬(A ∧ B) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| A | B | ¬(A ∨ B) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
In exam questions, you will often need to complete truth tables for circuits or expressions that combine multiple gates. The approach is to add intermediate columns for each gate's output, working from the inputs towards the final output.
Step 1: List all input combinations for A and B. Step 2: Add an intermediate column for ¬B (NOT B). Step 3: Add the final output column for A ∧ ¬B.
| A | B | ¬B | A ∧ ¬B |
|---|---|---|---|
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
This expression has three inputs, so the truth table has 2^3 = 8 rows.
| A | B | C | A ∨ B | ¬C | (A ∨ B) ∧ ¬C |
|---|---|---|---|---|---|
| 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 |
Exam Tip: Always use intermediate columns in your truth table. Even if the question only asks for the final output, showing your working in intermediate columns demonstrates your method and can earn partial marks if you make an error in the final column.
Sometimes an exam question gives you a completed truth table and asks you to identify the gate or write the Boolean expression. To do this:
The process from a truth table to a Boolean expression can be drawn as a flow:
graph LR
TT["Completed truth table"] --> R["Find rows where<br/>output = 1"]
R --> P["Write a product term<br/>(AND of inputs) per row"]
P --> S["Sum the product terms<br/>with OR"]
S --> EXP["Sum-of-products<br/>Boolean expression"]
| Output pattern (for 2 inputs) | Gate |
|---|---|
| 0, 0, 0, 1 | AND |
| 0, 1, 1, 1 | OR |
| 0, 1, 1, 0 | XOR |
| 1, 1, 1, 0 | NAND |
| 1, 0, 0, 0 | NOR |
Suppose you are asked to construct a truth table for the Boolean expression Q = (A ∧ B) ∨ (¬A ∧ C). Step-by-step procedure:
Step 1 — count inputs. There are three inputs (A, B, C) so the table needs 2^3 = 8 rows.
Step 2 — list inputs in binary order. Use the alternating pattern: C alternates every row, B every two rows, A every four rows.
Step 3 — add intermediate columns. Identify each operator: NOT A, A AND B, (NOT A) AND C, then the final OR.
Step 4 — fill row by row.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.