Skip to main content
EnglandComputer ScienceSyllabus dot point

How do the logic operators AND, OR and NOT work, and how do you build a truth table?

Boolean logic: the operators AND, OR and NOT, applying them to expressions, and constructing truth tables for simple logic statements including combinations of operators.

An OCR J277 2.4.1 answer on Boolean logic: the operators AND, OR and NOT, applying them to expressions, and constructing truth tables for simple logic statements and combinations of operators.

Generated by Claude Opus 4.810 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 operators
  3. Truth tables for single operators
  4. Combining operators
  5. Try this

What this dot point is asking

OCR wants you to use the three Boolean logic operators, AND, OR and NOT, apply them to expressions, and construct truth tables for simple statements, including expressions that combine operators. Boolean logic underpins both program conditions and the logic circuits inside a computer. This is examined in Paper 2, usually as "complete the truth table".

The three operators

Truth tables for single operators

The three basic 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
A NOT A
0 1
1 0

Combining operators

Try this

Q1. State when the expression A OR BA \text{ OR } B is false. [1 mark]

  • Cue. Only when both A and B are false (0).

Q2. How many rows does a truth table with three inputs have? [1 mark]

  • Cue. Eight (2 to the power 3).

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

  • Cue. 1 AND 01 \text{ AND } 0 is 0, and NOT 0 is 1, so the output is 1.

Exam-style practice questions

Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

OCR 20214 marksComplete a truth table for the expression Q=A AND BQ = A \text{ AND } B, and state in words when Q is true.
Show worked answer →

AND gives true only when both inputs are true. With two inputs there are four rows.

A=0,B=0A = 0, B = 0: Q=0Q = 0. A=0,B=1A = 0, B = 1: Q=0Q = 0. A=1,B=0A = 1, B = 0: Q=0Q = 0. A=1,B=1A = 1, B = 1: Q=1Q = 1.

In words: Q is true only when both A and B are true (1).

Markers reward all four output rows correct and a clear statement that AND is true only when both inputs are true. Using 1 for true and 0 for false is expected; one slipped row loses the table mark.

OCR 20225 marksConstruct a truth table for the expression Q=(A OR B) AND (NOT C)Q = (A \text{ OR } B) \text{ AND } (\text{NOT } C). There are three inputs.
Show worked answer →

Three inputs give eight rows. Work out (A OR B) and (NOT C) first, then AND them.

When C = 1, NOT C = 0, so Q = 0 on all four of those rows regardless of A and B. When C = 0, NOT C = 1, so Q equals (A OR B): Q = 0 only when A = 0 and B = 0, and Q = 1 otherwise.

So Q = 1 on exactly these rows: (A=0,B=1,C=0), (A=1,B=0,C=0), (A=1,B=1,C=0). Q = 0 on the other five rows.

Markers reward a correct eight-row table with intermediate columns for (A OR B) and (NOT C), and the correct final Q column. Building the intermediate columns is the method that earns the working marks.

Related dot points

Sources & how we know this