GCSE · Computer Science · AQA · Spec 8525
XOR logic gate
'Tea or coffee?' usually means pick one. Ask for both and you've broken the deal. There's a logic gate that takes that 'not both' completely seriously. It's called XOR.
Computer Science · Logic gates
Four input pairs, one XOR gate
A logic gate is an electronic component that carries out a logical operation. Every input and output is True or False, written 1 (high voltage) or 0 (low voltage). XOR has two inputs, A and B, and one output, Q.
At every row, ask one question: are A and B different? Press Next to move the highlight down the table.
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Output
Step 1: Both inputs are 0. They match, so Q = 0.
Look at the two rows where Q = 1. What do their inputs have in common?
Computer Science · Logic gates
Is it OR, or is it XOR?
Which gate does each description or expression belong to?
Still to sort
OR gate (0)
The plain OR shape, or the word OR.
Where the line is: No extra line on the input side. Add one and it becomes XOR.
XOR gate (0)
Exclusive OR: the OR shape with something extra.
Where the line is: An extra curved line across the input side, or the XOR / ⊕ notation.
Each gate has its own symbol for circuit diagrams. These two are near-twins, so the detail matters.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Two inputs, one output, one question: are the inputs different? By the end you'll know the single row that separates XOR from OR.
What you need to know
- A logic gate is an electronic component that carries out a logical operation.
- Its inputs and outputs are True or False, written 1 (high voltage) or 0 (low voltage).
- Each gate has its own symbol for circuit diagrams and its own truth table.
- XOR, short for exclusive OR, has two inputs and one output.
- The output is 1 when exactly one input is 1, and 0 when both inputs are the same.
- So there's one test to run: are the inputs different? Yes gives 1. No gives 0.
Have a goRun the test twice. A = 1, B = 0. Then A = 0, B = 0. What does XOR output each time?
1, then 0.
1 and 0 are different, so the output is 1. Two 0s match, so the output is 0: no input at 1 means nothing to switch it on either.
- Its truth table: 0 0 gives 0, 0 1 gives 1, 1 0 gives 1, 1 1 gives 0.
- OR and XOR disagree only when both inputs are 1: OR gives 1, XOR gives 0.
Have a goYour mate writes XOR's bottom row as 1 1 → 1 and says, 'Relax, XOR is basically OR.' Which gate's table did that row actually come from?
OR's. XOR gives 0 there.
Both inputs are 1, so they match and XOR outputs 0. Only OR counts the both-1 case as a yes, and that's the one row where 'basically OR' falls apart.
- XOR's symbol: the OR symbol plus an extra curved line across the input side. Written A XOR B or A ⊕ B.
- Inside a bigger circuit, XOR's output can feed another gate: work out the XOR column first.
Have a goP = A XOR B, and then P goes into a second XOR gate with a new input C. If A = 1, B = 0 and C = 1, what comes out of the second gate?
0.
First gate: 1 and 0 differ, so P = 1. Second gate: P = 1 and C = 1 match, so the output is 0. The slip to avoid is forgetting to feed P on.
The big picture
A logic gate is an electronic component that carries out a logical operation on inputs and outputs that are True or False, written 1 (high voltage) or 0 (low voltage). XOR, short for exclusive OR, has two inputs and one output: it outputs 1 when exactly one input is 1 and 0 when the inputs are the same. It differs from OR only when both inputs are 1, where OR gives 1 and XOR gives 0. Its symbol is the OR symbol with an extra curved line across the input side, it is written A XOR B or A ⊕ B, and its output can feed further gates.
Key points
Worked example
Problem
Q = A XOR B. You're told Q = 1 and A = 1. What is B? Then: what would B be if you'd been told Q = 0 and A = 1 instead?
⚠ Watch out
Treating XOR as if it were OR and writing a 1 in the A = 1, B = 1 row. Both inputs are the same there, so XOR outputs 0.
Memory hook
XOR asks one question: 'Are you two different?' Different means 1. Matching means 0, even when both are 1.
Check yourself
Cover the page. Write XOR's four-row truth table from memory. Then circle the one row where an OR gate would give a different output, and say what OR gives there.
Flashcards
(10)What is a logic gate?
In logic, what do 1 and 0 stand for?
What does XOR stand for?
How many inputs and outputs does an XOR gate have?
When does an XOR gate output 1?
What does XOR output when both inputs are 0?
Which input pair do OR and XOR give different outputs for?
How does the XOR symbol differ from the OR symbol?
Give two common ways to write XOR in a Boolean expression.
XOR's output feeds another gate. What do you work out first in the truth table?
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 postedMore AQA GCSE Computer Science topics
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 4 November 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.