Cambridge IGCSE · Topic 10 (3)
IGCSE Computer Science 0478 / Topic 10 / IGCSE

Every row, checked.

A truth table proves what a circuit does for every possible input. With three inputs there are eight rows, and one slip in one row loses a mark. Learn a reliable method: count in binary, add a working column for each gate, then fill in the output.

The key idea

A truth table shows the output for every combination of inputs. With n inputs there are 2n rows: 4 rows for two inputs, 8 rows for three. List the inputs in binary counting order (000, 001 ... 111) so no row is missed. Then add a working column for the output of each gate, working from the inputs towards the output, and use those columns to find the final output X.

working columns: one for each gate, then the output A B C A AND B NOT C X 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
Fig. 1: the truth table for X = (A AND B) OR NOT C, with a working column for each gate
Section 01

Count in binary.

Each row of inputs is a binary number. Writing the rows in counting order is the quickest way to be sure all eight are there and none is repeated.

RowABC
0000
1001
2010
3011
4100
5101
6110
7111
Examiner trap

Check the input columns before you start. If you write your own and repeat a row (or miss one), every output after it can be marked wrong.

Section 02

Working columns.

In the lab, pick a circuit and switch on the working columns. Fill in the output of each gate for all eight rows before you try the final output, then check your answers.

ABCA XOR BB OR CX
000000
001010
010111
011111
100100
101111
110010
111010
Worked example Two working columns
Complete the truth table for X = (A XOR B) AND (B OR C).
  1. Working column A XOR B: 1 only where A and B differ, rows 2 to 5: 0, 0, 1, 1, 1, 1, 0, 0.
  2. Working column B OR C: 0 only where B = 0 and C = 0, rows 0 and 4: 0, 1, 1, 1, 0, 1, 1, 1.
  3. X = 1 only where both working columns are 1: rows 2, 3 and 5.
  4. Check row 4 (A = 1, B = 0, C = 0): A XOR B = 1 but B OR C = 0, so X = 0.
Answer: X = 0, 0, 1, 1, 0, 1, 0, 0
Your turn
Complete the output column for X = (NOT (A OR B)) AND C.
Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

How many rows does a truth table for a circuit with three inputs need?

Quick check+10 XP

Inputs are listed in binary counting order. What are A, B and C in the sixth row (row 5, counting from row 0)?

Quick check+10 XP

In the lab, what is a working column for?

Quick check+10 XP

For X = (A AND B) OR NOT C, what is X when A = 0, B = 1 and C = 0?

Section 03

From a circuit or a statement.

With a circuit, label the output of every gate with a letter or its expression, and make each label a working column. With a statement, write the logic expression first. The lab's problem statements reveal the truth table as the last step.

GPQP OR QM
00000
00110
01010
01110
10000
10111
11011
11111
Worked example From a statement
A machine M starts (M = 1) when the safety guard is closed (G = 1) and either start button P or start button Q is pressed (= 1). Complete the truth table.
  1. Write the expression: M = G AND (P OR Q).
  2. Working column P OR Q: 0 only where P = 0 and Q = 0: 0, 1, 1, 1, 0, 1, 1, 1.
  3. M = 1 where G = 1 and P OR Q = 1: the last three rows.
Answer: M = 0, 0, 0, 0, 0, 1, 1, 1
Your turn
Using Fig. 1, give X for A = 1, B = 0, C = 0.
Examiner trap

Read the meaning of 0 and 1 for each input. "The door is closed (D = 0)" means the condition is NOT D, not D.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

What is the output column of X = (A OR B) AND NOT C, for rows 000 to 111 in order?

Exam style+20 XP

For X = (A NAND B) XOR C, what is X when A = 1, B = 1 and C = 1?

Exam style+20 XP

In the truth table for X = (A AND B) OR (B AND C), how many rows have X = 1?

Exam style+20 XP

A drink is released (R = 1) when a coin is accepted (C = 1) and the drink is in stock (S = 1) and the machine is not faulty (F = 0). For which inputs is R = 1?

Skill unlocked

Completing truth tables, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Completing truth tables from logic expressions, circuits and problem statements, with working columns.