← IGCSE Computer Science Paper 2

OR versus XOR: the row where both inputs are 1

Exclusive OR: outputs 1 when exactly one input is 1. When A and B are both 1 it outputs 0, but OR outputs 1 in that row. XOR means one or the other, but not both.

Understanding OR versus XOR: the row where both inputs are 1 in IGCSE Computer Science Paper 2

What it does: This row shows OR giving 1 and XOR giving 0, while all other rows have the same outputs. The phrase 'but not both' excludes the both-1 row, so the gate is XOR rather than OR. OR outputs 1 when at least one input is 1, so the row 1 and 1 gives 1. XOR means one or the other but not both. With both inputs 1, the output is 0. The OR and XOR columns match in every row except A = 1, B = 1. OR gives 1 and XOR gives 0. 'At least one' describes OR (inclusive). XOR is exclusive: exactly one input must be 1.

Common mistakes: The results show X=0 when both inputs are 1, which is XOR behaviour. OR would output 1 in that row. The line should be X = A XOR B. When A and B are both 1, OR outputs 1 but XOR outputs 0, because XOR means one or the other but not both. The row should be 1 1 | 1 | 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 552–561) 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 = 1 and B = 1. What does an OR gate output?
10
Matches
A B | XOR 1 1 | 1
↓
XOR is shown outputting 1 when both inputs are 1. XOR must output 0 in this row because it needs exactly one input to be 1.
Applying
Meanings
Term
XOR
Meaning
Exclusive OR: outputs 1 when exactly one input is 1. When A and B are both 1 it outputs 0, but OR outputs 1 in that row. XOR means one or the other, but not both.
Practice
A B OR XOR
Testing
Gaps
X = A B
Check Answer
Spots
1X = A OR B
2A=1, B=1 -> X=0

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

The 'Desert Jerboa' badge — High Jumper, 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 = 1 and B = 1. What does an OR gate output?
A. 1 ✓
B. 0
OR outputs 1 when at least one input is 1, so the row 1 and 1 gives 1.
2. A = 1 and B = 1. What does an XOR gate output?
A. 1
B. 0 ✓
XOR means one or the other but not both. With both inputs 1, the output is 0.
3. Which gate gives a different output from OR only in the row where A = 1 and B = 1?
A. XOR ✓
B. AND
The OR and XOR columns match in every row except A = 1, B = 1. OR gives 1 and XOR gives 0.
4. Which statement describes XOR correctly?
A. Outputs 1 when exactly one input is 1 ✓
B. Outputs 1 when at least one input is 1
'At least one' describes OR (inclusive). XOR is exclusive: exactly one input must be 1.
5. A shop sign says 'You may have a free drink or a free snack, but not both.' Which gate matches this wording?
A. OR
B. XOR ✓
'Either...or, but not both' is exclusive, so it matches XOR. OR would also allow both.

Match the Pairs

A = 1, B = 1, A OR B → Outputs 1, because OR is inclusive and accepts one input or both inputs being 1
A = 1, B = 1, A XOR B → Outputs 0, because XOR is exclusive and needs exactly one input to be 1
The only row where the OR and XOR output columns differ is the row where both inputs are 1 → A B | OR XOR 1 1 | 1 0
Everyday 'either...or but not both' wording describes XOR, for example you can have tea or coffee but not both → X = A XOR B
A B | XOR 1 1 | 1 → XOR is shown outputting 1 when both inputs are 1. XOR must output 0 in this row because it needs exactly one input to be 1.
A B | OR 1 1 | 0 → OR is shown outputting 0 when both inputs are 1. OR is inclusive, so it must output 1 whenever at least one input is 1, including both.

Key Term

XOR
Exclusive OR: outputs 1 when exactly one input is 1. When A and B are both 1 it outputs 0, but OR outputs 1 in that row. XOR means one or the other, but not both.

Fill in the Blanks

1. X = A XOR B
Hint: Type the gate name that means one or the other, but not both.
2. X = A OR B A = 1, B = 1 X = 1
Hint: Type the output of an OR gate when both inputs are 1.
3. A = 1, B = 1 X = A XOR B X = 0
Hint: Type the output of an XOR gate when both inputs are 1.
4. A B OR XOR 1 1 1 0
Hint: Type the OR output in the row where both inputs are 1.
5. Tea or coffee, or both: X = A OR B
Hint: Type the gate that matches an inclusive 'or both' meaning.

Spot the Error

Question 1
A X = A OR B
B A=1, B=1 -> X=0
C A=1, B=0 -> X=1
D A=0, B=0 -> X=0
Line A — The results show X=0 when both inputs are 1, which is XOR behaviour. OR would output 1 in that row. The line should be X = A XOR B.
Question 2
A A B | OR | XOR
B 0 0 | 0 | 0
C 1 1 | 1 | 1
D 1 0 | 1 | 1
Line C — When A and B are both 1, OR outputs 1 but XOR outputs 0, because XOR means one or the other but not both. The row should be 1 1 | 1 | 0.
Question 3
A A <- 1
B B <- 1
C X <- A OR B
D OUTPUT X // prints 0
Line C — With A and B both 1, OR would give 1, but the program expects 0. It should use XOR: X <- A XOR B.
Question 4
A Either tea or coffee, not both
B Gate needed: XOR
C Tea and coffee both 1: X = 1
D Only tea is 1: X = 1
Line C — 'Either...or, not both' describes XOR. When both inputs are 1, XOR outputs 0, so the line should say X = 0.
Question 5
A OR gate, inputs A and B
B A=1, B=1 gives X=0
C A=1, B=0 gives X=1
D A=0, B=0 gives X=0
Line B — OR is inclusive, so it outputs 1 when both inputs are 1. The line should be A=1, B=1 gives X=1.

Student with a class code? Join your class →