How do you build and use a truth table for AND, OR and NOT with up to three inputs?
Apply logical operators (AND, OR, NOT) in truth tables with up to three inputs to solve problems.
A focused answer to Edexcel GCSE Computer Science 1.3.1, covering the AND, OR and NOT logical operators, how to build a truth table with up to three inputs, and how to use truth tables to solve problems.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
Edexcel wants you to apply the logical operators AND, OR and NOT, and to build and complete truth tables with up to three inputs, then use them to work out the output of a logical expression and to solve simple logic problems.
The three logical operators
These match everyday logic: a security door that opens on a valid card AND a correct PIN needs both, so it is an AND. A fire alarm that sounds if the smoke OR the heat sensor triggers needs only one, so it is an OR. A "no entry" light that is on when the room is NOT free reverses the input, so it is a NOT.
The single-operator truth tables are:
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
and NOT, with one input: and .
Counting the rows
Writing the inputs as if counting up in binary is the reliable way to list all combinations exactly once. For three inputs A, B, C, the rows run 000, 001, 010, 011, 100, 101, 110, 111. This habit stops you dropping a row, which is the most common lost mark on a three-input table.
Building a three-input table in stages
Using truth tables to solve problems
A frequent exam style gives a real situation ("the machine starts only if the guard is closed AND either the green button OR the reset button is pressed") and asks you to identify the operators, write the logical expression and complete the table. The method is: assign a letter to each input, translate "and"/"or"/"not" into the operators, build the expression, then complete the truth table in stages. The completed table tells you exactly which input combinations make the output 1, which is how you check the design does what the scenario requires.
Try this
Q1. State how many rows a truth table with three inputs has. [1 mark]
- Cue. 8, because .
Q2. Give the output of . [1 mark]
- Cue. 1, because and .
Exam-style practice questions
Practice questions written in the style of Pearson Edexcel exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Edexcel 20224 marksComplete the truth table for the logical expression Q = (A AND B) OR NOT C, for all combinations of the three inputs A, B and C.Show worked answer →
Work out each combination in stages: first , then , then OR the two together.
With three inputs there are rows. is 1 only when both A and B are 1. is 1 whenever C is 0. The final Q is 1 when either of those is 1.
Q is 1 for: any row where C = 0 (because NOT C is 1), plus the row A = 1, B = 1, C = 1 (because A AND B is 1). Q is 0 only when C = 1 and not both A and B are 1.
Markers reward all 8 input combinations listed once each, correct intermediate columns, and the correct final Q column. Showing the intermediate columns earns method marks even if one final value slips.
Edexcel 20212 marksA door unlocks only when a valid card is presented AND the correct PIN is entered. State the type of logic gate this describes, and complete the output for a valid card with an incorrect PIN.Show worked answer →
Both conditions must be true for the door to unlock, so this is an AND gate (logical AND).
With a valid card (input 1) but an incorrect PIN (input 0), AND gives , so the output is 0 and the door stays locked.
Markers reward identifying AND and giving the correct output 0 (locked) for the stated inputs. The key point is that AND requires both inputs to be 1.
Related dot points
- Follow and write algorithms that use arithmetic operators (addition, subtraction, division, multiplication, modulus, integer division, exponentiation), relational operators (equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to) and logical operators (AND, OR, NOT).
A focused answer to Edexcel GCSE Computer Science 1.2.3, covering the arithmetic operators including modulus and integer division, the relational operators, and the logical operators AND, OR and NOT in algorithms.
- Follow and write algorithms (flowcharts, pseudocode, program code) that use sequence, selection, repetition (count-controlled, condition-controlled) and iteration with input, processing and output, and that use variables, constants and one- and two-dimensional data structures (strings, records, arrays).
A focused answer to Edexcel GCSE Computer Science 1.2.1 and 1.2.2, covering writing and following algorithms with sequence, selection and repetition, input-process-output, and variables, constants, strings, records and arrays.
- Understand the von Neumann stored program concept and the role of main memory (RAM), the CPU (control unit, arithmetic logic unit, registers), the clock and the address, data and control buses in the fetch-decode-execute cycle.
A focused answer to Edexcel GCSE Computer Science 3.1.1, covering the von Neumann stored program concept, the roles of RAM, the CPU (control unit, ALU, registers), the clock and the three buses in the fetch-decode-execute cycle.
- Understand syntax, logic and runtime errors and correct logic errors in algorithms; understand how the standard algorithms (bubble sort, merge sort, linear search, binary search) work; and use logical reasoning and test data to evaluate an algorithm's fitness for purpose and efficiency.
A focused answer to Edexcel GCSE Computer Science 1.2.5, 1.2.6 and 1.2.7, covering syntax, logic and runtime errors, the bubble sort, merge sort, linear search and binary search, and evaluating an algorithm's efficiency.
- Understand the benefit of using decomposition and abstraction to model aspects of the real world and to analyse, understand and solve problems, and understand the benefits of using subprograms.
A focused answer to Edexcel GCSE Computer Science 1.1.1 and 1.1.2, covering how decomposition and abstraction model the real world and help solve problems, and the benefits of using subprograms.
Sources & how we know this
- Pearson Edexcel GCSE (9-1) Computer Science (1CP2) specification — Pearson (2020)