Logic gates and truth tables
At the lowest level, computers make decisions with logic gates. Three gates are the building blocks.
AND, OR, NOT
OR: output is 1 if at least one input is 1.
NOT: has one input and flips it: 1 becomes 0, 0 becomes 1.
Truth tables
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Combining gates
NOT (A AND B) with A = 1, B = 1: A AND B = 1, so NOT 1 = 0.
Find (A OR B) AND C when A = 0, B = 1, C = 1.
- Brackets first: A OR B = 0 OR 1 = 1.
- Then 1 AND C = 1 AND 1 = 1.
Answer: 1
AND needs both inputs to be 1. OR needs at least one. NOT flips the input. Work out combined expressions bracket by bracket.
Try two quick questions
See if it has sunk in. Answers are marked straight away.
2 more questions
Try each one, then tap to check.
What is the output of an AND gate when A = 1 and B = 1?
Show the answer
Answer: 1
AND needs both inputs to be 1. So the output is 1.
What is the output of an OR gate when A = 1 and B = 0?
Show the answer
Answer: 1
OR outputs 1 if at least one input is 1. So the output is 1.
Check you have got it
Answer 6 quick questions with instant marking. If you get one wrong, GCSE-ready shows you why and gives you another go. It is free, and you do not need an account.
- Pearson Edexcel GCSE Computer Science (1CP2) specification, topic 1.3.1
- Pearson Edexcel International GCSE Computer Science (4CP0) specification, topic 4.3.1
Facts checked against the sources below, 17 October 2026. Last updated 2 October 2026. Spotted a mistake? Tell us and we will fix it.
What do exam command words like explain and evaluate mean? โ