Boolean logic
Logic circuits and expressions
Combine gates into circuits, write logic expressions, complete truth tables, and turn a problem statement into a circuit.
Examples use Cambridge pseudocode for the 2026–2028 syllabus.
Combining gates
The output of one gate can be the input to another. A logic circuit is drawn from left (inputs) to right (output) and can be written as a logic expression, using brackets to show which gates come first.
Toggle A, B, and C below and follow the 1s through the circuit.
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Completing a truth table
For a circuit with several gates, add a working column for each gate's output. Fill the input columns by counting up in binary from 000 to 111, then work out each column from left to right.
| A | B | C | A AND B | NOT C | X |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
Exam tip. Working columns earn marks and catch mistakes. In the exam you only need to fill the final column, but you can add your own.
From a problem statement
Exam questions often describe a situation in words. Turn each condition into an input, then join them with the gates that match the words and, or, and not.
Problem: a security light (X) turns on when it is dark (A = 1) and either movement is detected (B = 1) or the test button is pressed (C = 1).
That gives X = A AND (B OR C).
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
One more: a XOR circuit
Problem: a hallway light (X) has a switch at each end (A and B). Flipping either switch changes the light, so it is on when exactly one switch is up, unless the master switch C is off (C = 0).
That gives X = (A XOR B) AND C.
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 |
Check yourself
For X = (A AND B) OR NOT C, what is X when A = 0, B = 1, C = 1?Show answer
A AND B = 0, NOT C = 0, so X = 0 OR 0 = 0.
Write an expression: a fan (X) turns on if it is hot (A) and the window is not open (B).Show answer
X = A AND NOT B.
In the security light circuit, why does the light stay off in daylight even if movement is detected?Show answer
The final gate is AND with A. In daylight A = 0, so the output is 0 whatever B or C are.
References used to build these lessons
We used these official documents as references when building this course's lessons. They are the sources for the syllabus structure and course requirements.
Cambridge International · 2210 · Exams 2026–2028