What Is Boolean Logic? Clear Examples & Exam Tips for 2026

Boolean logic is a branch of algebra where every expression ends up as true or false, or 1 and 0, and it uses AND, OR, and NOT to make decisions. That's why it shows up in both programming conditions and digital circuits.
If you've stared at a GCSE or A-Level pseudocode question and felt your brain lock up, you're in the right place. Boolean logic looks tiny at first, but one missing NOT or one badly placed bracket can flip the whole answer.
What Boolean Logic Really Means
You're revising a pseudocode question, and the program only prints "Allowed" if a condition is met. The line looks messy, with AND and OR packed together, and the panic starts because it feels like the code is hiding the answer from you.

Boolean logic is just a way of making decisions with two outcomes, true or false, which computing often writes as 1 and 0. In UK computer-science teaching, that's the standard definition, and the core operators are AND, OR, and NOT (BBC Bitesize). The same idea is useful whether you're checking a login rule in code or reasoning about a circuit state.
The everyday version of the idea
A light switch helps here. A switch is either on or off, not a bit on and a bit off. Boolean logic works the same way, because a condition is either satisfied or it isn't.
That is why exam questions use it for decision-making. A student can pass the gate, get into a system, or trigger an alert only when the right combination of conditions is met. BBC Bitesize's GCSE material links this to computer states too, with 1 = on (TRUE) and 0 = off (FALSE) (BBC Bitesize).
Practical rule: if a question asks whether something is allowed, blocked, on, off, open, closed, or valid, you're probably looking at Boolean logic.
The name matters less than the pattern. Once you spot that a condition is asking for a yes or no result, you can start treating it like a small truth test instead of a long line of scary syntax. That's the shift that makes revision feel manageable.
For extra GCSE support, MasteryMind for GCSE computer science can help you practise the same kind of decision logic in exam-style questions.
Why the topic keeps coming back
George Boole created the foundation in the UK, with the first major formal treatment in 1847 and a bigger expansion in 1854 (St Andrews maths history). Those milestones are why Boolean algebra is tied to mathematical logic and later computer science. That history is useful, but for your exam, the point is simpler: code and circuits both need reliable true or false decisions.
The Three Core Operators Explained
Boolean logic gets much easier once you stop treating AND, OR, and NOT as symbols to memorise and start reading them as plain English. The trick is to ask, “What has to be true for this result to happen?”

AND means both conditions must be true
Think of a school bus rule. If you need both your bus pass and your school ID to board, missing either one means no entry. That's what AND does, it only gives true when both sides are true.
| A | B | A AND B |
|---|---|---|
| true | true | true |
| true | false | false |
| false | true | false |
| false | false | false |
In exam pseudocode, AND is written as a word, not as a symbol like &&. That's because exam boards want you reading the logic clearly, not worrying about language-specific syntax.
OR means at least one condition must be true
A cafe that takes card or cash is using inclusive OR. You don't need both. If either option works, the condition is true, and if both work, it's still true.
| A | B | A OR B |
|---|---|---|
| true | true | true |
| true | false | true |
| false | true | true |
| false | false | false |
Students often think OR means “one or the other, but not both”. In Boolean logic, that's not right. OR is inclusive, so both being true still counts.
NOT flips the result
A No Mobile Phones sign is a clean example. If phones were allowed, NOT allowed means they aren't. It flips the meaning of the condition.
| A | NOT A |
|---|---|
| true | false |
| false | true |
Reading them together
Once you can read each operator, a simple line like A AND NOT B becomes manageable. You look at B, flip it with NOT, then check whether A and that flipped result are both true.
Exam habit: read a Boolean expression from left to right, but apply the operator meaning carefully, not just the order you see the words.
If you can explain these three operators in your own words, you're already past the first major hurdle. The next challenge is spotting the one operator that trips up even confident students.
Where XOR Fits In
XOR means exclusive OR, and that word “exclusive” is the whole point. It returns true only when exactly one input is true, not when both are true.
A simple two-switch light is a good mental picture. If either switch can turn the light on, then one switch on gives light, the other switch on gives light, but both switches on can cancel the effect depending on the setup. That's the kind of “one or the other, but not both” thinking XOR represents.
| A | B | A OR B | A XOR B |
|---|---|---|---|
| true | true | true | false |
| true | false | true | true |
| false | true | true | true |
| false | false | false | false |
The table shows the difference cleanly. OR is broad, XOR is picky. That difference matters because students often read XOR like a fancy version of OR and then lose marks on the first row.
A-Level computing uses XOR in places like binary addition and the half adder, where a carry and a sum need different logic. It also appears in some search and comparison problems where “different” matters more than “either”.
Memory hook: if both inputs match, XOR says false. If they differ, XOR says true.
That's the fastest way to avoid the trap. If the question says “exactly one” or “one but not both”, think XOR immediately. If it says “one, the other, or both”, think OR.
Boolean Algebra Laws You Actually Need
Boolean algebra starts feeling like a proper exam topic when you can simplify expressions instead of just reading them. That matters because a shorter expression usually means fewer checks in code and fewer places for a logic mistake to hide.
The laws that show up again and again
Here are the ones worth knowing well:
- Identity: A AND 1 = A, A OR 0 = A
- Complement: A AND NOT A = 0, A OR NOT A = 1
- Double negation: NOT NOT A = A
- Commutative: A AND B = B AND A, A OR B = B OR A
- Associative: grouping doesn't change the result
- Distributive: A AND (B OR C) = (A AND B) OR (A AND C)
The distributive law is the one that helps with real simplification questions. It lets you pull a shared part outside or expand a bracketed expression into smaller pieces.
A worked simplification
Take this expression:
(A AND B) OR (A AND NOT B)
Both parts contain A, so factor it out using distributive logic:
A AND (B OR NOT B)
Now use the complement law. B OR NOT B = 1.
So the expression becomes:
A AND 1
Using the identity law:
A
That's the whole simplification. The original expression looked complicated, but it always reduces to A.
Why precedence can wreck a good answer
UK learners also need to watch operator precedence. NOT is evaluated before AND, and AND before OR (Ada Computer Science). That means the same inputs can give different answers if brackets are missing.
For example, A OR B AND NOT C is not the same as (A OR B) AND NOT C. A single bracket change can switch the branch outcome in a program, which is exactly why exam questions love to hide that mistake in pseudocode.
A truth table tells you what the logic does. Brackets tell the computer what to do first.
That line is worth remembering because it explains a lot of “I swear my answer should work” moments. The logic may be correct, but the order of evaluation can still change the result.
From Truth Tables to Logic Gates
Boolean logic stops being abstract the moment you link it to a circuit. In digital electronics, AND, OR, NOT, and XOR map directly to logic gates, and those gates are the building blocks of real hardware.

A circuit's wires don't carry little words like “true” and “false”. They carry electrical states that behave like 1 and 0, which is why Boolean logic fits digital systems so neatly. The same idea that helps you read a pseudocode condition also helps you understand a gate diagram.
A simple alarm example
Suppose an alarm triggers only when the door is open AND it is after midnight. That becomes a Boolean expression:
DoorOpen AND AfterMidnight
You can turn that into a truth table:
| DoorOpen | AfterMidnight | Alarm |
|---|---|---|
| false | false | false |
| false | true | false |
| true | false | false |
| true | true | true |
Only one row activates the alarm. That's the kind of result exam questions expect you to predict before you ever draw the gate.
If you want more revision support with curriculum-matched tasks, you can also browse curriculum-aligned study guides.
What to sketch in an exam
If the expression is A AND B, draw an AND gate. If it's A OR B, draw an OR gate. If it's NOT A, draw a NOT gate. For A XOR B, use the XOR symbol and remember it means the inputs differ.
You don't need to overcomplicate it. Start with the expression, build the truth table, then match the gate shape. That order keeps you from guessing when a circuit question looks unfamiliar.
Why this matters in GCSE and A-Level papers
Examiners like switching between representations. They might give you a truth table and ask for a circuit, or give you a circuit and ask for the output condition. The students who do well are the ones who can move between the algebra and the hardware without freezing.
If the question feels visual, redraw it as logic.
If the question feels symbolic, rewrite it as a truth table.
That habit makes the whole topic less intimidating. It also keeps you from treating logic gates as decoration, because they're just the physical version of the same true or false rules.
Worked Practice Questions for Exam Prep
Revision gets real when you stop reading and start answering. These practice questions are the kind of thing that can appear in GCSE or A-Level papers, and the best way to handle them is to slow down and show your working clearly.
Question 1, complete a truth table
Suppose the expression is A OR B.
| A | B | A OR B |
|---|---|---|
| false | false | ? |
| false | true | ? |
| true | false | ? |
| true | true | ? |
The first row is false, because both inputs are false. The next three rows are true, because OR only needs one true input.
So the completed table is:
| A | B | A OR B |
|---|---|---|
| false | false | false |
| false | true | true |
| true | false | true |
| true | true | true |
Common mistake: treating OR as if both inputs must be true. That would turn it into AND, which changes the answer completely.
Question 2, simplify a Boolean expression
Find the simplest form of:
(A AND B) OR (A AND NOT B)
First, factor out A:
A AND (B OR NOT B)
Then apply the complement law:
B OR NOT B = 1
So:
A AND 1 = A
The final answer is A. That is the kind of clean, full-mark simplification examiners like because it shows the rule you used, not just the final line.
Question 3, predict the program output
A program prints "Allowed" if:
Age >= 16 AND HasID = true OR IsParent = true
A lot of students read that too fast and get the wrong branch. Because AND happens before OR, the actual grouping is:
(Age >= 16 AND HasID = true) OR IsParent = true
So the output is "Allowed" if the person is 16 or over and has ID, or if IsParent is true.
If a learner ignores precedence and reads it left to right, they can end up with the wrong answer even when their Boolean idea is otherwise fine.
For more exam-style drilling, GCSE Past Papers are useful because they force you to practise the exact wording and command style you'll see in real assessment questions.
Exam Tips and Where Boolean Logic Leads Next
Boolean logic questions get much easier when you slow the process down. Write the truth table first if you're unsure, check NOT before anything else, and always test whether the question is using AND or inclusive OR.
A quick exam-room checklist
- Write the brackets first: they show the evaluation order and stop precedence mistakes.
- Trace one row at a time: don't try to “see” the whole table in your head.
- Watch for hidden NOTs: a single negation can reverse the whole result.
- Use exam pseudocode wording: AND, OR, and NOT usually matter more than symbol habits from another language.
Boolean logic also links into trace tables, binary and hex conversion, and logic gate design, so the marks don't stop here. Once you can read conditions confidently, a lot of other computing topics become easier because they all rely on the same true or false thinking.
If you're aiming higher, this is the sort of topic that rewards repeated practice rather than cramming. A few worked examples, a few circuit questions, and a few pseudocode conditionals will do far more than rereading notes in a panic.
For structured revision and timed practice, Exam Practice for A-Level is worth using alongside your notes. Boolean logic feels awkward at first, but once you get the pattern, it becomes one of the most reliable marks in the paper.
If you want exam-style Boolean logic practice that matches UK specifications, visit MasteryMind and use it to drill truth tables, pseudocode conditions, and logic-gate questions until they feel routine. You'll get more confident with the exact question styles that come up in GCSE and A-Level computer science, and that's the fastest way to turn a shaky topic into easy marks.
Ready to master this topic?
Practise with quizzes, blurt exercises and exam questions on MasteryMind.
7 days Premium · Then free forever · No card, no charge