Boolean Logic: AND, OR and NOT (KS3 Computing)

Boolean logic is a system of reasoning that uses only two values — True and False (or 1 and 0) — combined through three fundamental operations: AND, OR and NOT. Every decision a computer makes, from checking a password to routing network traffic, reduces to Boolean logic at the hardware level.

What is a Boolean value?

The word "Boolean" honours George Boole, a 19th-century British mathematician who showed that logical reasoning could be written as algebra. In computing, a Boolean value is simply True or False — represented in hardware as 1 (on) or 0 (off).

The DfE national curriculum for computing explicitly names "simple Boolean logic" as a KS3 requirement. At the programming level, you already use Boolean values every time you write an if statement — the condition evaluates to either True or False, and the computer branches accordingly.

What does AND mean in Boolean logic?

The AND operation returns True only if both inputs are True. If either input is False, the result is False.

AND truth table:

Input A | Input B | A AND B
False (0) | False (0) | False (0)
False (0) | True (1) | False (0)
True (1) | False (0) | False (0)
True (1) | True (1) | True (1)

Real-world example: A bank vault requires two separate key-holders to turn their keys simultaneously. The door opens only if Person A turns their key AND Person B turns their key. Either key alone is insufficient.

In Python:

age = 15
has_permission = True

if age >= 13 and has_permission:
print("Access granted")

Both conditions must be True for the message to appear.

What does OR mean in Boolean logic?

The OR operation returns True if at least one input is True. It only returns False if both inputs are False.

OR truth table:

Input A | Input B | A OR B
False (0) | False (0) | False (0)
False (0) | True (1) | True (1)
True (1) | False (0) | True (1)
True (1) | True (1) | True (1)

Real-world example: A school canteen accepts payment by cash OR card. You only need one of the two — having both is also fine, but the requirement is satisfied by either.

In Python:

username = "admin"
is_teacher = True

if username == "admin" or is_teacher:
print("Welcome to the dashboard")

The dashboard opens if either condition holds.

What does NOT mean in Boolean logic?

The NOT operation takes a single input and inverts it. True becomes False; False becomes True.

NOT truth table:

Input A | NOT A
False (0) | True (1)
True (1) | False (0)

Real-world example: A "do not disturb" sign on a hotel door means the opposite of "available" — it inverts the normal meaning of the room's status.

In Python:

logged_in = False

if not logged_in:
print("Please log in first")

not logged_in is not False, which evaluates to True, so the message prints.

How do AND, OR and NOT combine?

Boolean operations can be chained and combined, just like arithmetic operations. Use brackets to make precedence clear — NOT is evaluated first, then AND, then OR (similar to multiplication before addition in arithmetic).

Worked example:

A = True, B = False, C = True

Expression: (A AND NOT B) OR C

Step by step:

NOT B → NOT False → True

A AND True → True AND True → True

True OR C → True OR True → True

Result: True

Building a trace table like this — working through each sub-expression in order — is the standard method for evaluating Boolean expressions at KS3 and GCSE.

How do logic gates relate to Boolean logic?

In hardware, Boolean operations are implemented by logic gates — electronic circuits built from transistors:

Gate | Symbol shape | Boolean operation
AND gate | D-shape | A AND B
OR gate | Curved shield | A OR B
NOT gate | Triangle with bubble | NOT A
NAND gate | AND + bubble | NOT (A AND B)
NOR gate | OR + bubble | NOT (A OR B)

Every component in a CPU — the ALU, the memory controller, the registers — is built from combinations of these gates. Understanding Boolean logic at KS3 connects directly to understanding why computers are built from transistors arranged in these patterns.

Frequently asked questions

What is Boolean logic in KS3 computing?

Boolean logic is a system of rules for combining True/False values using three operations: AND (both must be true), OR (at least one must be true) and NOT (inverts the value). Every decision a computer makes is ultimately a Boolean expression evaluated by logic gates in the CPU.

What is a truth table and how do you fill one in?

A truth table lists every possible combination of input values and shows the output for each combination. For two inputs there are 4 rows (00, 01, 10, 11); for three inputs there are 8 rows. Fill in the output column by applying the Boolean operation to each row in turn.

How does Boolean logic appear in Python programming?

Python uses the keywords and, or and not (all lowercase) directly in if statements and other conditional expressions. Comparison operators (==, !=, >, <) produce Boolean values, and you can chain them with and/or/not to build complex conditions.

Why is Boolean logic important for GCSE computer science?

Boolean logic underpins two major GCSE topics: logic gates and circuits (drawing and evaluating gate diagrams) and programming (writing conditions in if statements and loops). Strong KS3 Boolean foundations make both topics significantly easier, and GCSE exam papers regularly include truth-table completion questions worth several marks.

For Socratic computing tutoring — from Boolean logic to full programs — see aitutors.me.