GCSE · Computer Science · AQA · Spec 8525

Truth tables for logic circuits

Wire two gates together and the circuit might just copy one input. Staring at the diagram won't show you that. A truth table will, every time.

Computer Science · Logic circuits

One circuit, eight rows, one column at a time

A and B go into an AND gate. Its output meets C at an OR gate, and out comes Q. Step through and watch every row get worked the same way: inputs, then the middle column, then Q.

The whole table is on show, so cover the last two columns with your hand. Predict them for the highlighted row, then press Next and check.

AND → ORQ = (A AND B) OR Cgate
ABCA AND BQ
00000
00101
01000
01101
10000
10101
11011
11111
A=0, B=0, C=0, A AND B=0 → Q = 0

Output

Columns: A | B | C | A AND B | Q

Step 1: Before any numbers, label the gates. The AND gate's output is A AND B. The OR gate's output is Q = (A AND B) OR C. Those labels become your column headings, with Q as the last column.

1 / 9

Every row goes the same way: inputs → A AND B → Q. Q has to wait for the AND gate's answer.

Step 1 of 9: Before any numbers, label the gates. The AND gate's output is A AND B. The OR gate's output is Q = (A AND B) OR C. Those labels become your column headings, with Q as the last column..

Watch out: Leaping straight to Q is the classic slip. The OR gate is fed by the AND gate, so you need A AND B before you can say anything about Q.

Computer Science · Listing every row

Why three inputs make eight rows

Walk down the tree: choose A, then B, then C. Then try a different path and see where it lands.

Input A → Input B → Input C

2 × 2 × 2 = 8 rows of the table, and the tree ends 8 times.

On Start. 2 branches to choose from.

Each input can only be 0 or 1. Pick a value for A, then B, then C. The path you walk is one row of the table.

Watch out: Read the ends from top to bottom: 000, 001, 010, 011 and so on. That's just counting in binary, and it's the easiest way to make sure no row goes missing.

Computer Science · Order of working

What gets worked out first?

the order you work out the parts of NOT (A OR B) AND C

1 · Worked out first3 · Worked out last
  1. NOT ( … ), the NOT gate

  2. (A OR B), the bracket

  3. … AND C

Watch out: Reading left to right feels natural. Here it's the trap. Put the three parts in the order you'd really work them out, then lock it in.

Computer Science · Your turn

Build a table from an expression

No circuit diagram this time, just the expression NOT A OR B. Finish its truth table by choosing the missing steps.

  1. Two inputs, so four rows. Counting in binary, the (A, B) rows are 00, 01, 10, 11.
  2. NOT comes before OR, so NOT A gets a column of its own before the output column.
  3. missing step
Which line is step 3?

Predict, then check

Two gates, one tiny circuit. Commit to a guess before you work anything out.

In the circuit A OR (A AND B), A goes straight into the OR gate and also into an AND gate with B. What do you reckon this circuit does?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Every input combination, every gate in its own column, and what the circuit really does at the end.

What you need to know

  • A truth table shows the output for every possible combination of inputs, one combination per row.
  • Wire two or more gates together and you've got a logic circuit; a truth table is how you check what it does.
  • Each input is 0 or 1, so every extra input doubles the rows: two inputs give 4, three give 8.
  • Have a goA circuit has four inputs. How many rows does its truth table need?

    16

    Each extra input doubles the rows, so three inputs' 8 becomes 16. Adding two rows per input would give 8, which misses half of them.

  • Count in binary, 000, 001, 010, 011 and on, until the place values run out, and no row goes missing.
  • Have a goYour mate lists a three-input table as 000, 001, 010, 100, 101, 110, 111 and says "Done, all eight." Are they right?

    No. That's only seven rows: 011 is missing.

    Counting in binary goes 010, 011, 100. Jumping about instead of counting is exactly how a row slips through, and it's easy to miscount and not notice.

  • Starting from a circuit diagram? Label each gate's output first; those labels become columns, with the final output last.
  • Intermediate columns hold part of the expression, like A AND B, which makes the final output easier to work out.
  • Starting from an expression? Work brackets first, then NOT, then AND, then OR.
  • Have a goIn A OR B AND C, which gate do you work out first?

    The AND: B AND C.

    AND comes before OR, even though the OR is written first. Working left to right would give a different table.

  • Chain the same gate, like A OR B OR C, and the order doesn't matter.
  • AND needs both inputs at 1. OR needs either or both. XOR needs either but not both. NOT flips 0 and 1.
  • Finally, read the output column against the inputs: it tells you whether the circuit does what was intended.

The big picture

A truth table shows a circuit's output for every possible combination of inputs. Count in binary to list the rows, label each gate's output and give it a column, work brackets, NOT, AND, then OR, and put the final output last. Then read what the circuit really does.

Key points

1A truth table shows the output for every possible input combination, so it summarises and checks a circuit's logic.
2Count in binary (00, 01, 10, 11 …) to list every row without missing one; each extra input doubles the number of rows.
3Label each gate's output with the expression it represents; those labels become columns, and the final output column goes last.
4Expressions go brackets, NOT, AND, then OR. A chain of the same gate, such as A OR B OR C, can be worked in any order.
5Fill each column from the gate rules, then read the finished table: a circuit can turn out simpler than its diagram looks.

Worked example

Problem

Build the truth table for Q = A XOR (B AND C).

⚠ Watch out

Jumping straight to the final output, or working an expression left to right. Both look quicker and both go wrong. List every combination by counting in binary, give each gate its own column, and follow brackets, NOT, AND, OR.

🧠

Memory hook

Think spreadsheet: one row for every possible set of inputs, one column for every gate's output. For the order of working, Be Neat And Orderly: Brackets, NOT, AND, OR.

✓

Check yourself

Grab any three-input circuit. Before you write a single output, can you say how many rows you need, what order they go in, and which column you'll fill in first?

Flashcards

(14)
What does a truth table show?
The output for every possible combination of inputs. It's how you summarise and check a circuit's logic.
What is a logic circuit?
Two or more logic gates connected together to carry out more complex logic.
How many rows for two inputs? For three?
4 for two inputs and 8 for three. Each extra input doubles the number of rows.
Why list the rows by counting in binary?
Counting 000, 001, 010, 011 and so on hits every combination exactly once, so no row is missed.
AND gate rule
The output is 1 only when both inputs are 1. Otherwise it's 0.
OR gate rule
The output is 1 when either or both inputs are 1. It's 0 only when both inputs are 0.
XOR gate rule
The output is 1 when either input is 1 but not both. So 1 and 1 gives 0.
NOT gate rule
It flips its one input: 0 becomes 1 and 1 becomes 0.
What is an intermediate column, and why bother with one?
A column for part of the expression, such as one gate's output. A later gate uses it as an input, so working it out first makes the final output easier.
Truth table from a circuit diagram: what's the very first job?
Label each gate's output with the expression it represents. Those labels become the columns, with the final output last.
In which order is an expression evaluated?
Brackets, then NOT, then AND, then OR.
Q = NOT (A AND B). For which inputs is Q 0?
Only when A and B are both 1. The bracket gives 1 there, and the NOT flips it to 0; every other row gives 1.
Does the order matter in A OR B OR C?
No. A chain of the same gate can be worked in any order and gives the same result.
What does a finished truth table tell you about a circuit?
Whether it really does the logic intended. A two-gate circuit can turn out to simply copy one input.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 26 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.