Skip to main content
EnglandComputer ScienceSyllabus dot point

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.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The three logical operators
  3. Counting the rows
  4. Building a three-input table in stages
  5. Using truth tables to solve problems
  6. Try this

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: NOT 0=1\text{NOT } 0 = 1 and NOT 1=0\text{NOT } 1 = 0.

Counting the rows

Writing the inputs as if counting up in binary is the reliable way to list all 2n2^n 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 23=82^3 = 8.

Q2. Give the output of 1 AND (NOT 0)1 \text{ AND } (\text{NOT } 0). [1 mark]

  • Cue. 1, because NOT 0=1\text{NOT } 0 = 1 and 1 AND 1=11 \text{ AND } 1 = 1.

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 A AND BA \text{ AND } B, then NOT C\text{NOT } C, then OR the two together.

With three inputs there are 23=82^3 = 8 rows. A AND BA \text{ AND } B is 1 only when both A and B are 1. NOT C\text{NOT } C 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 1 AND 0=01 \text{ AND } 0 = 0, 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

Sources & how we know this