Worked example: and, or and not
What is NOT A when A = 1?
- Put in the values: A = 1.
- NOT A = NOT 1 = 0 (NOT flips 1 to 0).
- So the output is 0 (FALSE).
Answer 0 (FALSE)
GCSE Computer ScienceEvery exam board
A logic gate takes inputs that are each 1 (TRUE) or 0 (FALSE) and gives one output. Learn what each gate does and you can work out any circuit, one gate at a time.
What is NOT A when A = 1?
Answer 0 (FALSE)
01 / The gatesTruth tables
The output is 1 only when both inputs are 1. Drawn as a D shape.
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
The output is 1 when at least one input is 1. Drawn with a curved back and a pointed front.
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
One input, and it flips it: 1 becomes 0 and 0 becomes 1. Drawn as a triangle with a small circle at its tip.
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
Exclusive OR. The output is 1 when the two inputs are different. Drawn like OR with an extra curved line behind it.
| A | B | A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
02 / The rulesLearn these
With n inputs there are 2n rows: 4 rows for two inputs, 8 rows for three. Fill the inputs in by counting up in binary, 000 to 111, so you never miss one.
Work out anything in brackets first. NOT applies to the input or bracket straight after it, so NOT A AND B means (NOT A) AND B.
Start at the inputs and work towards the output. Write the 0 or 1 coming out of each gate on the diagram as you go.
Name each gate from the inputs outwards. A and B into an AND gate, then into a NOT gate, is NOT (A AND B).
For a long expression, give the truth table an extra column for each part, such as A AND B, then combine the columns for the final output.
Read the question for the words AND and OR in real situations. "The alarm sounds if the door is open and the system is on" is an AND gate. "The light comes on if either switch is pressed" is an OR gate.
03 / Quiz yourselfTry it, then tap to check
Work each one out on paper first, then open the answer and compare your working with ours. Every question here was made and checked by the Show Working app.
01 / AND, OR and NOTEvery board
Answer 0 (FALSE)
02 / AND, OR and NOTEvery board
Answer 1 (TRUE)
03 / Boolean expressionsEvery board
Answer 1 (TRUE)
04 / Boolean expressionsEvery board
Answer 0 (FALSE)
05 / Logic circuitsOCR, AQA, Eduqas
Answer 0 (FALSE)
06 / Logic circuitsOCR, AQA, Eduqas
Answer 0 (FALSE)
07 / XOR in expressionsAQA, Eduqas
Answer 1 (TRUE)
08 / XOR in expressionsAQA, Eduqas
Answer 1 (TRUE)
09 / Truth tables: count the 1sEvery board
Answer 5
10 / Truth tables: count the 1sEvery board
Answer 3
04 / By exam boardNot affiliated with any board
Show Working is not affiliated with AQA, Edexcel (Pearson), OCR or WJEC Eduqas. Check your own board's specification for the exact wording.
05 / QuestionsGCSE Computer Science
AND, OR and NOT. AND gives 1 only when both inputs are 1, OR gives 1 when at least one input is 1, and NOT flips its one input. AQA and Eduqas also teach XOR.
AND needs both inputs to be 1 to give 1. OR needs only one of them. So inputs of 1 and 0 give 0 through an AND gate but 1 through an OR gate.
Two to the power of the number of inputs. Two inputs give 4 rows and three inputs give 8 rows. List the inputs by counting up in binary so none is missed.
XOR is exclusive OR. It gives 1 when the two inputs are different and 0 when they are the same. It is on the AQA and Eduqas specifications.
From the inputs on the left to the output on the right. Work out each gate in turn and write its output on the diagram before moving to the next gate.
06 / Practise itiPhone, iPad and the web
The app makes fresh logic gates questions every time, so they never run out. Get one wrong and you see every step of the working.
On a computer? Use it free in your browser
