You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Boolean logic is one of the most important topics in GCSE Computer Science. It underpins how every computer processor makes decisions, and you will be expected to understand, apply and evaluate Boolean logic across several areas of your exam.
Boolean logic is a form of algebra in which all values are reduced to one of two states: TRUE or FALSE. In computing, these two states are represented by the binary digits 1 (true) and 0 (false).
Boolean logic is named after the English mathematician George Boole (1815–1864), who first described this system of logic in his 1854 book The Laws of Thought. Boole showed that logical reasoning could be expressed using mathematical symbols and operations — an idea that would eventually become the foundation of all digital computing.
| Boolean Value | Binary | Meaning |
|---|---|---|
| TRUE | 1 | On / Yes / High |
| FALSE | 0 | Off / No / Low |
Computers are built from billions of tiny electronic switches called transistors. Each transistor can be in one of two states — on or off — which maps directly to the Boolean values 1 and 0.
All operations a computer performs — from adding numbers to displaying images — are ultimately carried out by combining these simple on/off switches using Boolean logic.
Key reasons Boolean logic matters:
IF statement in a program relies on Boolean conditions evaluating to true or false.There are three basic Boolean operations from which all other operations can be built:
These three operations are sometimes called the primary logic gates because every other logic gate (such as XOR, NAND and NOR) can be constructed from combinations of NOT, AND and OR.
| Operation | Symbol | Description |
|---|---|---|
| NOT | ¬ or overline (A̅) | Inverts the input |
| AND | ∧ or · | True only if both inputs are true |
| OR | ∨ or + | True if at least one input is true |
A logic gate takes one or more inputs and produces a single output. Inputs and outputs are always either 0 or 1.
The diagram below shows the general flow of binary inputs through a logic gate to produce a single output:
graph LR
A((A = 0 or 1)) --> Gate["Logic gate<br/>(NOT, AND, OR, ...)"]
B((B = 0 or 1)) --> Gate
Gate --> Q((Q = 0 or 1))
We can represent the behaviour of a logic gate using a truth table — a table that lists every possible combination of inputs along with the resulting output. You will study truth tables in detail in a later lesson.
In programming languages, Boolean logic appears everywhere:
True or False in Python, true or false in Java and JavaScript).if statements, while loops and for loops are Boolean expressions.and, or and not combine conditions.For example, in Python:
age = 16
has_ticket = True
if age >= 16 and has_ticket:
print("You may enter.")
Here, the condition age >= 16 and has_ticket is a Boolean expression that evaluates to True or False.
At the hardware level, Boolean operations are performed by logic gates — electronic circuits built from transistors.
Logic gates are drawn using standard symbols in circuit diagrams.
You will learn the specific symbols for each gate in later lessons.
Logic gates are combined to build increasingly complex circuits:
| Term | Definition |
|---|---|
| Boolean | A data type or value that can only be TRUE (1) or FALSE (0) |
| Logic gate | An electronic circuit that performs a Boolean operation |
| Truth table | A table showing all possible input combinations and their outputs |
| Input | A value fed into a logic gate (0 or 1) |
| Output | The result produced by a logic gate (0 or 1) |
| Boolean expression | An algebraic expression using Boolean operators (NOT, AND, OR, etc.) |
For your GCSE Computer Science exam (AQA / OCR), you need to be able to:
Exam Tip: When answering questions about Boolean logic, always show your working by drawing a truth table. Even if the question does not explicitly ask for one, truth tables help you verify your answer and can earn method marks.
Although later lessons cover each gate in detail, it is useful to see the three fundamental operations in action right at the start. Each example below shows a complete truth table — a structured tabulation of every possible combination of inputs and the resulting output.
The Boolean expression A AND B (written A ∧ B) outputs 1 only when both inputs are 1. This is the strictest of the basic gates.
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Notice that out of four possible input combinations, only one row produces a 1. We say the proposition "A AND B is true" is satisfied in exactly one configuration.
The Boolean expression A OR B (written A ∨ B) outputs 1 whenever at least one input is 1.
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
The OR gate is the inverse picture of AND in terms of zeros — it produces 0 in only one row, when both inputs are 0.
The NOT gate has a single input. Its truth table has only two rows:
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
For three inputs there are 2^3 = 8 rows. The output of A ∧ B ∧ C is 1 only when all three inputs equal 1.
| A | B | C | A AND B AND C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
The OR pattern flips: only when all three inputs are 0 does the output equal 0.
| A | B | C | A OR B OR C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Even at this introductory stage, it helps to meet the laws that you will use throughout this course. Each law has a name examiners may refer to.
Simplify the Boolean expression (A ∧ B) ∨ (A ∧ ¬B).
The result is A. A circuit built directly from the original expression would need three gates (two ANDs, one OR, one NOT); after simplification it needs no gates at all.
Consider the sum-of-products expression Q = (A ∧ B) ∨ (¬A ∧ C).
Truth table with intermediate columns:
| A | B | C | A AND B | NOT A | (NOT A) AND C | Q |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 1 |
This style of expression — a series of AND terms joined by OR — is called sum-of-products and is the standard form used to read a Boolean expression directly off a truth table.
Common mistake: Students often write a 4-row table for a 3-input expression. Always check that your table has 2^n rows for n inputs.
Exam-style question: State what is meant by Boolean logic and give one example of where it is used in computing. (3 marks)
Grades 3–4 answer: Boolean logic is logic that uses true and false. It is used in computers.
Why this is limited: The answer is correct but uses imprecise language and gives a vague example.
Grades 5–6 answer: Boolean logic is a system that uses two values, TRUE (1) and FALSE (0). It is used inside the CPU, where logic gates combine binary inputs to produce binary outputs.
Why this earns more: The answer uses correct technical terms (TRUE/FALSE, CPU, logic gates) and links Boolean values to binary.
Grades 7–9 answer: Boolean logic is a branch of algebra in which every proposition evaluates to one of two values, TRUE (1) or FALSE (0). The fundamental operators are NOT, AND and OR, which can be represented as logic gates in hardware. For example, the arithmetic logic unit (ALU) of a CPU uses combinations of AND, OR and NOT gates to perform binary addition; the sum bit of a half-adder is produced by an XOR gate while the carry is produced by an AND gate. Boolean logic also underpins conditional statements in programming, where each Boolean expression is evaluated to true or false to decide which branch of code executes.
Why this earns top marks: The answer uses precise terminology (proposition, ALU, half-adder, Boolean expression), names specific operators and applies them to a concrete computing example.
AQA alignment: This content is aligned with AQA GCSE Computer Science (8525) specification — specifically section 3.4.2 Boolean logic (AND, OR, NOT gates; truth tables; Boolean expressions and their simplification). Assessed on Paper 2.