Topic 10 Β· Boolean Logic Β· 10.7

The XOR Logic Gate

The XOR gate outputs 1 when exactly one input is active β€” but not both.

Invitation

When should the warning light turn on?

Imagine a warning light connected to two sensors.

β€œThe light turns on when exactly one sensor is active.”

If Sensor A is active and Sensor B is inactive, the light turns on. If both sensors are active, the light stays off.

That is XOR behaviour: one input may be active, but not both.
Warning-light rule
Sensor A active?
Sensor B active?
XOR ↓
Exactly one active?
Big Idea

XOR means one, but not both

An XOR gate has two inputs and one output.

It checks whether the two inputs are different. If exactly one input is 1, the output is 1.

A = 1Sensor active
XOR
B = 0Sensor inactive
β†’
X = 1Light on
The inputs are different, so exactly one sensor is active and the output is 1.
Visual Guide

The XOR gate symbol

The XOR symbol looks like an OR gate with an extra curved line on the input side.

That extra line helps distinguish XOR from OR.

OR shape + extra input curve = XOR.
XOR gate
ABX
Bridge

Two combinations produce 1

0 + 0
Output 0
0 + 1
Output 1
1 + 0
Output 1
1 + 1
Output 0
An XOR gate outputs 1 only when the two inputs are different.
Truth Table

The inputs must be different

Look at the middle two rows. XOR gives 1 when exactly one input is 1.

ABX
000
011
101
110
Think: are the two inputs different?
Logic Expression

Writing the XOR rule

The inputs are labelled A and B. The output is labelled X.

X = A XOR B

This means X is 1 when A and B are different.

Read it aloud as: β€œX equals A XOR B.”
Worked Example

Find the output

Question

A warning light uses XOR. Sensor A is active (1) and Sensor B is inactive (0). What happens?

β€œX = 1, so the warning light turns on because exactly one sensor is active.”
Exam Explainer

Three facts worth remembering

Two InputsXOR compares A and B.
Different InputsOne must be 1 and the other 0.
Exactly OneNot neither and not both.
Exam answer: β€œAn XOR gate outputs 1 when exactly one input is 1.”
Common Mistake

Do not confuse XOR with OR

βœ— Incorrect

A = 1 and B = 1 gives X = 1 because OR would give 1.

βœ“ Correct

X = 0 because XOR requires exactly one input to be 1.

Remember: OR allows both. XOR does not.
Summary

XOR means exactly one

Step 1Check both inputs.
Step 2Ask if they are different.
Output1 for 0,1 or 1,0.
Final rule: XOR outputs 1 when exactly one input is 1.