Boolean Logic 🔌
Six logic gates, and everything you can build from them: truth tables, logic circuits, logic expressions and real safety systems — plus the adder circuit that does the binary sums inside every CPU, in 3D.
🔌 Logic gates 10.1
The electronic circuits in computers, solid-state drives and control systems are built from thousands of logic gates. A gate takes binary inputs (1 = on/true, 0 = off/false) and produces one binary output. Gates combined to do a job form a logic circuit, and its output for every possible input is checked with a truth table.
🧪 The six gates — click the inputs
Each gate's symbol, truth table and the two ways of writing it. Tap A and B to change the inputs; the matching truth-table row lights up.
📝 Writing gates down 10.2
| Gate | Output is 1 when… | Logic notation | Boolean algebra |
|---|---|---|---|
| NOT | the input is 0 (it inverts) | X = NOT A | X = A̅ |
| AND | both inputs are 1 | X = A AND B | X = A . B |
| OR | either input (or both) is 1 | X = A OR B | X = A + B |
| NAND | NOT both inputs 1 — the opposite of AND | X = A NAND B | X = A . B |
| NOR | both inputs are 0 — the opposite of OR | X = A NOR B | X = A + B |
| XOR | the inputs are different (exclusive OR) | X = A XOR B | X = (A . B̅) + (A̅ . B) |
In Boolean algebra, . means AND, + means OR, and a bar over a letter (or letters) means NOT. It's optional at IGCSE — logic notation is fine. A small circle (a "bubble") on a gate symbol's output means NOT: NAND is AND with a bubble, NOR is OR with a bubble.
📋 From a logic circuit to a truth table 10.3
Split the circuit into parts and give each gate's output a letter — P, Q, R … — as an intermediate column. Work out those columns first, row by row, then use them to get X. Three inputs means 8 rows.
⚡ Circuit simulator
Type any logic expression (or pick one) to see its circuit and full truth table with the intermediate columns. Click the inputs, or any truth-table row, to send those values through the circuit — wires carrying a 1 glow.
✍️ From an expression to a circuit 10.3
Start inside the brackets: each bracket is one gate. Draw those gates, then join their outputs with the gate between the brackets. For a long expression, name the parts — P = (A NOR B), Q = (A OR NOT B), R = (P AND C), then X = R NAND Q — and draw them one at a time.
🔎 From a truth table to an expression 10.3
Look only at the rows where X = 1. Each one becomes an AND of all the inputs — a 1 is written as the letter, a 0 as NOT the letter. Join these with OR. This is called the sum of products: for rows 010 and 100, X = (NOT A AND B AND NOT C) OR (A AND NOT B AND NOT C). Sometimes a single gate fits — if X = 1 only when A and B differ, it's simply A XOR B.
🧩 Truth table builder
Choose the number of inputs, then click the X column to set each output. The expression and circuit are built for you, and the page spots it if one gate does the whole job.
🏭 From a problem statement 10.3
Real systems — alarms, safety cut-outs, controllers — are described in words. To turn a description into logic:
- 1️⃣ Use the table to give each condition a letter and a value. Careful: 1 doesn't always mean "high" — read what each binary value means.
- 2️⃣ Write each condition as a small expression: "speed > 1000 rpm and temperature ≤ 80 °C" might be (S AND NOT T).
- 3️⃣ Join the conditions with the linking words — "either … or …" means OR.
- 4️⃣ Draw the circuit and the truth table separately, then check them against each other.
🏭 Safety system simulator
Pick a system and set the conditions with the switches — each one shows what its 0 or 1 means. The logic expression and circuit come straight from the rules.
🧱 Everything from NAND Extension
Real designers think about cost, ease of manufacture and time. One trick is to build everything from one kind of "off-the-shelf" block — and the NAND gate can make any logic circuit on its own:
NOT from NAND
AND from NAND
OR from NAND
➕ Adding binary numbers with gates Extension
Binary addition is one of a computer's most basic operations. A half adder adds two bits and gives two outputs: the sum bit S and the carry bit C. 1 + 1 = 10 in binary: carry 1, sum 0. Look at the truth table — S is exactly XOR and C is exactly AND.
| A | B | C (carry) | S (sum) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
A full adder also adds the carry in from the column to its right, using two half adders and an OR gate. Chain 8 full adders together and you can add two bytes — that's the heart of the ALU.
🧊 3D · Inside the adder
Flip the input switches. Wires carrying a 1 glow and stream pulses; each gate chip shows its output, and the lamps show the sum and carry. Switch to the full adder to add a carry in. Drag to rotate.
✏️ Practice hub 4 activities · every example
Every activity from the coursebook chapter, with fresh circuits, expressions and truth tables every time you hit 🔀 New questions — all marked by the logic engine.
📘 Worked examples
Every type of worked example in the chapter, step by step. Hit 🔀 Another example for a new one.
🃏 Key-term flashcards Tap to flip
🧠 Mini-quiz
📝 Exam-style questions Try, then peek
X = (NOT A AND B) OR (A AND NOT B)
…which is the same as the single gate X = A XOR B:
X = (A NOR B) AND (B XOR C)
F = (T AND NOT W) OR (H AND NOT W)
The X column is 0, 0, 0, 1 — identical to A AND B.