Truth Tables (Edexcel GCSE Computer Science)
Revision Note
Written by: James Woodhouse
Reviewed by: Lucy Kirkham
Truth Tables for AND Gates, OR Gates & NOT Gates
What is a truth table?
A truth table is a tool used in logic and computer science to visualise the results of Boolean expressions
They represent all possible inputs and the associated outputs for a given Boolean expression
AND
Circuit symbol | Truth Table | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
OR
Circuit symbol | Truth Table | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
NOT
Circuit symbol | Truth Table | ||||||
---|---|---|---|---|---|---|---|
|
Worked Example
Describe the purpose of a truth table [2]
Answer
To show all possible inputs (to the logic circuit)
...and the associated/dependant output (for each input)
Guidance
Must be clear that the output is linked to the input values given
"All possible combinations of inputs and outputs" only gets 1 mark
Truth Tables for Logic Circuits
They represent all possible inputs and the associated outputs for a given Boolean expression
To create a truth table for the expression P = (A AND B) AND NOT C
Calculate the numbers of rows needed (2number of inputs)
In this example there are 3 inputs (A, B, C) so a total of 8 rows are needed (23)
To not miss any combination of inputs, start with 000 and count up in 3-bit binary (0-7)
A | B | C |
---|---|---|
0 | 0 | 0 |
0 | 0 | 1 |
0 | 1 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 0 | 1 |
1 | 1 | 0 |
1 | 1 | 1 |
Add a new column to show the results of the brackets first (A AND B)
A | B | C | A AND B |
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
Add a new column to show the results of NOT C
A | B | C | A AND B | NOT C |
---|---|---|---|---|
0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 | 0 |
1 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 0 | 0 |
1 | 1 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 0 |
The last column shows the result of the Boolean expression by comparing (A AND B) AND NOT C
A | B | C | A AND B | NOT C | (A AND B) AND NOT C |
---|---|---|---|---|---|
0 | 0 | 0 | 0 | 1 | 0 |
0 | 0 | 1 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 1 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 0 | 0 |
1 | 1 | 0 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 0 |
Examiner Tips and Tricks
It is possible to create a truth table when combining expressions that show only the inputs and the final outputs.
The inclusion of the extra columns supports the process but can be skipped if you feel able to do those in your head as you go.
Worked Example
Complete the truth table for the following logic diagram [4]
A | B | Q |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
| 0 |
|
1 |
|
|
Answers
A | B | Q |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 1 | 0 |
Last updated:
You've read 0 of your 5 free revision notes this week
Sign up now. It’s free!
Did this page help you?