2.4.1

Boolean logic

Logic diagrams, truth tables and combining AND OR and NOT to solve problems.

Learning Objectives

  • 1Recognise the symbol for each of the AND, OR and NOT logic gates
  • 2Know the truth table for each logic gate
  • 3Create, complete or edit logic diagrams and truth tables for a given scenario
  • 4Work with more than one gate in a logic diagram

What is Boolean logic?

Boolean logic works with only two values: 1 (True) and 0 (False). Computers use it constantly to make decisions, built from tiny electronic components called logic gates. You need to know three gates: AND, OR, and NOT.
Boolean logic is a system where every value is either 1 (True) or 0 (False), with no in-between. A logic gate is a component that takes one or more Boolean inputs and produces a single Boolean output, based on a fixed rule. Combinations of logic gates, called logic circuits, are the building blocks a computer's processor uses to make decisions and perform calculations.
You are permitted to use alternative valid notation in the exam, for example T/F or Yes/No instead of 1/0, provided the meaning is clear and consistent. Whichever notation you choose, you must recognise the correct gate symbols and be able to both create and complete truth tables and logic diagrams for a given scenario.

The AND gate

The AND gate only outputs 1 (True) if both of its inputs are 1. If either input is 0, the output is 0.
AND (also called conjunction) outputs 1 only when every input is 1. Its symbol has a flat back and a rounded front, with no bubble.
ABA AND B
000
010
100
111
Only one row of the AND truth table outputs 1, the row where every input is 1. This makes AND useful for checking that multiple conditions must all be true at once, e.g. checking a user is both old enough AND has entered the correct password.
The three gates you must recogniseANDABQFlat back, rounded front, no bubbleABQ0000101001111 only when BOTH inputs are 1ORABQCurved back, pointed front, no bubbleABQ0000111011111 when EITHER input is 1NOTAQTriangle with a small bubbleAQ0110It inverts the inputNo bubble means a buffer, not NOT

The OR gate

The OR gate outputs 1 (True) if at least one of its inputs is 1. It only outputs 0 if both inputs are 0.
OR (also called disjunction) outputs 1 when at least one input is 1. Its symbol has a curved back and a pointed front, with no bubble.
ABA OR B
000
011
101
111
Only one row of the OR truth table outputs 0, the row where every input is 0. This makes OR useful for checking whether at least one of several conditions is true, e.g. granting access if a user has EITHER an admin account OR a manager account.

The NOT gate

The NOT gate has only one input. It simply reverses (inverts) it: 1 becomes 0, and 0 becomes 1.
NOT (also called negation) reverses its single input. Its symbol is a triangle followed by a small circle (a "bubble") on the output.
ANOT A
01
10
The small bubble on the output is what makes a gate a NOT gate, examiners specifically flag missing this bubble as a common mistake, since a triangle with no bubble is a different component (a buffer), not a logic gate at all. Examiners are instructed to mark the shape of each gate and ignore any text labelling, so drawing the correct shape matters more than labelling it.

Combining gates

Gates can be wired together to build more complex logic. For example, the output of a NOT gate could feed into an OR gate, so the whole circuit calculates something like NOT A OR B.
You are required to work with circuits containing more than one gate. Work through a combined circuit gate by gate, in the order signals actually flow: calculate the output of the first gate, then use that result as an input to the next gate. When applying operators without a diagram, NOT is evaluated before AND, which is evaluated before OR, similar to the order of operations in maths.
In the expression B OR NOT C AND A, the correct order of evaluation is B OR ((NOT C) AND A), since NOT is applied first, then AND, then OR. Brackets always override this order and should be evaluated first, exactly as in standard algebra.
Q = NOT A OR BANOTBORQWork out NOT A first, then feed it into the OR.ABNOT AQ0011011110001101Q is 0 only when A is 1 and B is 0.

Completing truth tables for combined circuits

When filling in a truth table for a circuit with 2 or more inputs, list every possible combination of 0s and 1s so nothing gets missed, then work out the output row by row.
To make sure every input combination is included, list rows in binary counting order: for two inputs A and B, that's 00, 01, 10, then 11. For a circuit with more than one gate, add extra columns for the output of each intermediate gate, working left to right, before filling in the final output column.
Starting from 00 and counting up in binary (00, 01, 10, 11, and continuing this pattern for 3+ inputs) guarantees no combination is missed, this matters most with three or four inputs, where it becomes easy to accidentally skip or repeat a row if you don't follow a systematic order.
Python· Truth table for Q = NOT A OR B
# A B  NOT A  Q (NOT A OR B)
# 0 0    1     1
# 0 1    1     1
# 1 0    0     0
# 1 1    0     1
OCR ERL· Truth table for Q = NOT A OR B
// A B  NOT A  Q (NOT A OR B)
// 0 0    1     1
// 0 1    1     1
// 1 0    0     0
// 1 1    0     1

Exam Phrasing: Use These Exact Phrases

  • ✓AND outputs 1 only when both/all inputs are 1
  • ✓OR outputs 1 when at least one input is 1
  • ✓NOT reverses its single input
  • ✓A NOT gate must be drawn with a bubble on the output, otherwise it is just a buffer
  • ✓List truth table rows in binary counting order (00, 01, 10, 11) so no combination is missed
  • 💡Always include the bubble on a NOT gate, without it the shape represents a buffer, not a logic gate.
  • 💡AND and OR gates must not have a bubble, adding one would turn them into NAND or NOR, which are not required by this specification.
  • 💡Examiners mark the shape of a gate, not any label you add, focus on drawing the correct outline.
  • 💡List truth table input rows in binary counting order (00, 01, 10, 11) to make sure you don't miss or repeat a combination.
  • 💡For a circuit with more than one gate, work through it step by step: calculate the first gate's output, then use it as an input to the next gate.

Wrong:

Drawing a NOT gate as a plain triangle with no circle

Right:

Drawing a NOT gate as a triangle with a small bubble/circle on the output

Why it matters: A triangle with no bubble represents a buffer, a different component, not a NOT gate, examiners have specifically flagged this recurring mistake.

Wrong:

Adding a bubble to an AND or OR gate

Right:

AND and OR gates are drawn with no bubble

Why it matters: Adding a bubble to AND or OR would represent NAND or NOR gates instead, which are not part of this specification.

Wrong:

Listing truth table rows in a random or inconsistent order

Right:

Listing rows in binary counting order: 00, 01, 10, 11

Why it matters: A systematic order guarantees every input combination is included, especially important with three or more inputs.

Question:

Complete a truth table for the logic circuit where output Q = A AND B AND C. [4]

💡 Attempt this before revealing the answer, practice makes perfect!

Model Answer:

With three inputs, there are 8 possible combinations, listed in binary counting order from 000 to 111. Since Q uses AND across all three inputs, Q is only 1 when A, B and C are all 1 (the final row, 1 1 1). Every other row outputs 0.

Mark Scheme:

  • 1All 8 rows of input combinations correctly listed (binary counting order or equivalent complete set)
  • 2Correctly identifies that only the row where A=1, B=1, C=1 outputs Q=1
  • 3All other 7 rows correctly output Q=0
  • 4Table is clearly and completely filled in

Work out the output of a Boolean expression.

Loading a question…

Questions are generated fresh every time, so you can keep practising as long as you want.

Tap a card to flip it. Use the arrow keys to move and space to flip.

Known 0 Still learning 0
1 / 12

Exam-style questions. Have a go, then reveal the mark scheme to check your answer.

1.State the output of an OR gate when A = 0 and B = 1.

[1]

2.Draw the symbol for a NOT gate and explain why the bubble on the output is important.

[2]

3.A security system grants access if the correct PIN is entered AND the door sensor shows the door is closed. Write this as a Boolean expression, and explain what type of gate this represents.

[2]

4.Complete a truth table for Q = A AND B, listing all input combinations in binary counting order.

[4]

5.A circuit has the expression Q = NOT A OR B. Complete a truth table for this circuit, showing an intermediate column for NOT A.

[5]
Python· Check your answer
# A B  NOT A  Q (NOT A OR B)
# 0 0    1     1
# 0 1    1     1
# 1 0    0     0
# 1 1    0     1
OCR ERL· Check your answer
// A B  NOT A  Q (NOT A OR B)
// 0 0    1     1
// 0 1    1     1
// 1 0    0     0
// 1 1    0     1

6.A security alarm sounds when a door sensor is triggered AND the alarm is armed, or when the panic button is pressed. Describe how this could be built from logic gates and explain how you would check your design.

[6]

The examiners' reports are the most useful and least read of the three: they say what candidates actually got wrong each year. All files are hosted by OCR.

Past-paper questions grouped by topic

The same OCR questions, sorted by topic rather than by year (via Physics & Maths Tutor).

2025
Paper 2

Constructing logic gate diagrams from a real-world scenario was answered extremely well by most candidates. Where mistakes occurred, they were mainly about gate shapes: candidates need to remember that the circle on a NOT gate is essential (without it, the shape is a buffer, not a logic gate), and that AND/OR gates must not have circles, since adding one would represent NAND/NOR instead.

Paper 2

When completing a truth table, most candidates correctly filled in every possible input combination. Examiners noted that although inputs don't strictly have to be in a particular order, best practice is to start at 00 and count up in binary (01, 10, 11), especially important for larger systems with 3 or 4 inputs, so that no combination is accidentally missed. 1/0, True/False and Yes/No were all accepted as valid notation.

2024
Paper 2

Drawing logic circuits is a commonly asked question type. The most common issues were a missing circle on a NOT gate (turning it into a buffer) and including an incorrect number of inputs on a gate. Examiners are instructed to mark the shape of each gate and ignore any text labelling, so candidates should focus on drawing accurate shapes rather than relying on labels.