If number systems are how a computer stores data, Boolean logic is how it thinks. Named after mathematician George Boole, it deals with just two values — true (1) and false (0) — combined by simple rules called logic gates. Stack millions of these tiny gates together and you get a CPU. Flip the switches in the simulator below and you'll understand them faster than any table can teach you.
1True, false and the basic gates
A logic gate takes one or two inputs (each 0 or 1) and produces one output (0 or 1). A truth table lists the output for every possible combination of inputs. The three you build everything from:
- NOT (inverter) — one input; it flips it. NOT 0 = 1, NOT 1 = 0. Written
A'or̄A. - AND — output is 1 only if both inputs are 1. Written
A . B. Think "both". - OR — output is 1 if at least one input is 1. Written
A + B. Think "either".
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
- NOT flips its single input; AND outputs 1 only when both inputs are 1; OR outputs 1 if any input is 1.
- AND is written A.B (like multiply); OR is written A+B (like add).
- A truth table lists the output for every input combination.
2The derived gates: NAND, NOR, XOR, XNOR
Four more gates are built from the basic three:
- NAND = NOT AND — the opposite of AND (1 unless both inputs are 1).
- NOR = NOT OR — the opposite of OR (1 only when both inputs are 0).
- XOR (exclusive OR) — 1 when the inputs are different. Think "one or the other, but not both".
- XNOR — the opposite of XOR — 1 when the inputs are the same.
Don't memorise all seven tables cold — use the simulator in the next section. Flip A and B, switch the gate, and the table teaches itself.
- NAND = NOT AND; NOR = NOT OR (the inverted basic gates).
- XOR outputs 1 when inputs differ; XNOR outputs 1 when they're the same.
- NAND and NOR are 'universal' — any gate can be built from them alone.
3Flip the switches — the Logic Gate Simulator
Pick a gate, then toggle inputs A and B. The output lights up and the current row of the truth table is highlighted. Work through all seven gates — by the time you've flipped every switch, you'll know the tables without trying.
- Toggle the inputs and the output updates instantly — the truth table builds itself.
- Compare AND vs NAND, and OR vs NOR, to see how NOT simply flips the output.
- XOR and XNOR are mirror images: 'different' vs 'same'.
4Circuits and De Morgan's laws
You'll need to move between three forms: a Boolean expression, a logic circuit diagram, and a truth table. Reading an expression like (A . B) + C', you build the circuit gate by gate; reading a circuit, you write the expression.
De Morgan's Laws
Two rules let you simplify and rearrange expressions. They're a CBSE favourite:
(A . B)' = A' + B' (A + B)' = A' . B'
In words: break the bar, change the sign. When you split a NOT over a bracket, AND becomes OR and OR becomes AND, and each variable gets its own NOT.
Toggle the inputs below and switch between the two laws — the proof line and truth table show both sides are always equal.
- Convert freely between expression, circuit diagram and truth table.
- De Morgan: (A.B)' = A'+B' and (A+B)' = A'.B' — 'break the bar, change the sign'.
- Prove a Boolean law by matching the output columns of a truth table for all input combinations.
★ Practical: be the chip
Using the simulator to check yourself:
- Write the truth table for NAND from memory, then verify it on the simulator.
- For A=1, B=0, work out the output of XOR, then NOR, then NAND.
- Apply De Morgan's law to simplify (A + B)' and confirm with a truth table.
- Describe the circuit for the expression (A . B) + C in words (which gates feed which).
Ready for the chapter test?
Answer 5 questions. Score 60% or more to mark this chapter complete.
Start the test →💡 Log in to save your progress and earn the certificate.