Logic gates Cambridge IGCSE Computer Science (9–1) revision
Not started
Learn it
In plain words
A logic gate is a tiny electronic circuit that takes one or two binary inputs and gives one binary output, following a fixed rule. Everything a processor does is built from millions of them.
There are six to learn. Three are basic, and the other three are those with their outputs flipped or tweaked.
7 things to know
- NOT has one input. Its output is the opposite of its input: 0 gives 1 and 1 gives 0.
- AND: the output is 1 only if both inputs are 1.
- OR: the output is 1 if either input is 1, or both.
- NAND (not AND): the opposite of AND. The output is 0 only if both inputs are 1.
- NOR (not OR): the opposite of OR. The output is 1 only if both inputs are 0.
- XOR (exclusive OR): the output is 1 if the two inputs are different.
- A truth table lists every possible combination of inputs with the output for each. Two inputs give four rows: 00, 01, 10, 11.
Worked example
Complete the output column of the truth table for a NAND gate with inputs A and B.
- Work out AND first, then flip it. A AND B is 1 only when both are 1.
- Inputs 0, 0: AND is 0, so NAND is 1. Inputs 0, 1: AND is 0, so NAND is 1.
- Inputs 1, 0: AND is 0, so NAND is 1. Inputs 1, 1: AND is 1, so NAND is 0.
- The output column reads 1, 1, 1, 0.
Tips and tricks
- For NAND and NOR, work out AND or OR first and then swap every 0 and 1.
- XOR and OR differ in one row only: when both inputs are 1, OR gives 1 and XOR gives 0.
It lands in your notebook with its questions as flashcards.
Logic gates: 6 questions and answers
These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.
When is the output of an AND gate 1?
Both, and only both.
When is the output of an OR gate 0?
Any 1 on the inputs gives 1.
What is the output of a NAND gate when both inputs are 1?
AND would give 1, and NAND is the opposite.
What is the output of a NOR gate when both inputs are 0?
OR would give 0, and NOR is the opposite.
What is the output of an XOR gate when both inputs are 1?
XOR gives 1 only when the inputs are different.
How many inputs does a NOT gate have?
Its output is the opposite of its single input.
Quiz
6 questions
Tap an answer and you’ll see straight away whether it’s right, and why.
Worksheet
2 questions, 4 marks. Write your answers on paper, then check them.
Logic gates
Cambridge IGCSE Computer Science (9–1) 0984 · 4 marks · papermunch.org
Name ______________________________ Date ______________
Describe the difference between an OR gate and an XOR gate.[2]
Show answerHide answer
An OR gate outputs 1 when either or both inputs are 1. An XOR gate outputs 1 only when the two inputs are different, so it outputs 0 when both are 1.
State the output of a NOR gate for each of the input pairs 0, 0 and 0, 1 and 1, 0 and 1, 1.[2]
Show answerHide answer
1, 0, 0, 0.
Answers: Logic gates
- 1. An OR gate outputs 1 when either or both inputs are 1. An XOR gate outputs 1 only when the two inputs are different, so it outputs 0 when both are 1.
- 2. 1, 0, 0, 0.



