← IGCSE Computer Science Paper 2

Completing a truth table from an expression: three inputs

Fill all 8 rows of A, B and C: work out the bracket (A AND B) in an extra column first, then combine it with C using OR to get output X.

Understanding Completing a truth table from an expression: three inputs in IGCSE Computer Science Paper 2

What it does: Each of the three inputs can be 0 or 1, giving 8 combinations. Every one must appear exactly once. The intermediate column (A AND B) is 1, and OR with 0 still gives 1, so X is 1. Each input has 2 values, so 2 x 2 x 2 = 8 rows. A AND B = 1, and 1 OR 0 = 1, so X = 1. A AND B = 0, and 0 OR 0 = 0, so X = 0. An OR gate outputs 1 if at least one input is 1. C = 1 makes X = 1 in all 4 rows where C is 1.

Common mistakes: Three inputs give 2^3 = 8 rows, not 6. Every combination of A, B and C must appear in the table. AND gives 1 only when both inputs are 1. With A=1 and B=1, A AND B = 1, not 0.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 562–580) and word search (Modules 539–580).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A truth table for the three inputs A, B and C needs how many rows?
6 rows8 rows
Matches
A=0 B=1 C=1: (0 AND 1) = 0, 0 AND 1 = 0, X = 0
↓
The bracket result was combined with C using AND, but the expression uses OR. It should be 0 OR 1 = 1, so X = 1.
Applying
Meanings
Term
X = (A AND B) OR C
Meaning
Fill all 8 rows of A, B and C: work out the bracket (A AND B) in an extra column first, then combine it with C using OR to get output X.
Practice
X = (A AND B) OR C
Testing
Gaps
X = (A B) OR C
Check Answer
Spots
1X = (A AND B) OR C
2Rows needed: 2^3 = 6

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Space Rabbit' badge — Launch Pad, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A truth table for the three inputs A, B and C needs how many rows?
A. 8 rows ✓
B. 6 rows
Each input has 2 values, so 2 x 2 x 2 = 8 rows.
2. In X = (A AND B) OR C, which part do you work out first?
A. The bracket (A AND B), in its own column ✓
B. The OR with C, then the AND
Brackets come first. Work out (A AND B) in an intermediate column, then use it with C in the OR.
3. For X = (A AND B) OR C, what is X when A = 1, B = 1 and C = 0?
A. X = 0
B. X = 1 ✓
A AND B = 1, and 1 OR 0 = 1, so X = 1.
4. For X = (A AND B) OR C, what is X when A = 1, B = 0 and C = 0?
A. X = 1
B. X = 0 ✓
A AND B = 0, and 0 OR 0 = 0, so X = 0.
5. In X = (A AND B) OR C, a row has C = 1. What is X in that row?
A. X = 1, whatever A and B are ✓
B. X = 0 unless A AND B is 1
An OR gate outputs 1 if at least one input is 1. C = 1 makes X = 1 in all 4 rows where C is 1.

Match the Pairs

X = (A AND B) OR C → Work out A AND B first in an extra column, then OR that result with C in all 8 rows.
X = (A XOR B) AND C → Work out A XOR B first in an extra column. X is 1 only when that column is 1 and C is 1.
A three-input truth table has 2 x 2 x 2 = 8 rows, counting from 000 to 111 in A, B, C order. → 000, 001, 010, 011, 100, 101, 110, 111
For X = (A AND B) OR C, the row A=1, B=1, C=0 gives X = 1 because the bracket result is 1. → A=1 B=1 C=0: (1 AND 1) = 1, 1 OR 0 = 1, X = 1
A=0 B=1 C=1: (0 AND 1) = 0, 0 AND 1 = 0, X = 0 → The bracket result was combined with C using AND, but the expression uses OR. It should be 0 OR 1 = 1, so X = 1.
A=1 B=0 C=0: (1 AND 0) = 1, 1 OR 0 = 1, X = 1 → 1 AND 0 is 0, not 1, because AND needs both inputs to be 1. The correct working is 0 OR 0 = 0, so X = 0.

Key Term

X = (A AND B) OR C
Fill all 8 rows of A, B and C: work out the bracket (A AND B) in an extra column first, then combine it with C using OR to get output X.

Fill in the Blanks

1. X = (A AND B) OR C
Hint: Type the gate used inside the bracket, which is worked out first in the extra column.
2. X = (A AND B) OR C
Hint: Type the gate that combines the bracket column with input C to give X.
3. Rows needed: 2 x 2 x 2 = 8
Hint: Type the number of rows in a truth table with three inputs.
4. A=1, B=1, C=0: P = A AND B = 1 X = P OR C = 1
Hint: Type the output value of X for this row, using the intermediate column P and C.
5. X = (A XOR B) AND NOT C
Hint: Type the gate that inverts input C before it is combined with the bracket.

Spot the Error

Question 1
A X = (A AND B) OR C
B Rows needed: 2^3 = 6
C Extra column: D = A AND B
D Output column: X = D OR C
Line B — Three inputs give 2^3 = 8 rows, not 6. Every combination of A, B and C must appear in the table.
Question 2
A X = (A AND B) OR C
B Row: A=1, B=1, C=0
C A AND B = 0
D X = 1 OR 0 = 1
Line C — AND gives 1 only when both inputs are 1. With A=1 and B=1, A AND B = 1, not 0.
Question 3
A X = (A OR B) AND C
B Row: A=1, B=0, C=0
C A OR B = 0
D X = 1 AND 0 = 0
Line C — OR gives 1 when at least one input is 1. With A=1 and B=0, A OR B = 1, not 0.
Question 4
A X = (NOT A) OR (B AND C)
B Row: A=1, B=1, C=0
C NOT A = 1, B AND C = 0
D X = 0 OR 0 = 0
Line C — NOT reverses its input. With A=1, NOT A = 0, not 1. The intermediate values are then 0 and 0, so X = 0.
Question 5
A X = (A XOR B) AND C
B Row: A=1, B=1, C=1
C Intermediate: A XOR B = 0
D X = 0 AND 1 = 1
Line D — AND gives 1 only when both inputs are 1. Here the inputs are 0 and 1, so X = 0, not 1.

Student with a class code? Join your class →