Boolean Logic & Logic Gates

💻 Computer Science Years 10–11 Foundation

The AND, OR and NOT logic gates, their symbols, and how to build and read truth tables.

Open this lesson, with practice and a printable worksheet →

Strip a computer right down and every clever thing it does rests on one tiny decision, made billions of times over: is this on or off, 1 or 0, true or false? The circuits that make those decisions are logic gates, and the rules they follow are Boolean logic — just three basic operations: AND, OR and NOT.

Why this matters: Every processor, every memory cell, every calculation is built from these three gates wired together. Boolean logic is the bedrock the whole of computing stands on — and it's simpler than it looks.
AND OR NOT inputs on the left → output on the right NOT has one input; the small circle means "invert"
The three basic logic gate symbols.

AND — both must be true

ABQANDABQ000010100111
The D-shaped AND gate: output Q is 1 only on the last row, where A and B are both 1.

An AND gate outputs 1 only when both inputs are 1. Analogy: a microwave runs only if the door is shut AND the start button is pressed — both, or nothing. In Boolean writing this is A & B.

OR — at least one must be true

ABQORABQ000011101111
The curved-back OR gate: Q is 1 whenever at least one input is 1.

An OR gate outputs 1 if either input (or both) is 1. Analogy: a hallway lamp on two switches — flick the top switch OR the bottom one and the light comes on. Written A | B.

NOT — flip it

AQNOTAQ0110
The triangle-and-bubble NOT gate has one input and flips it; only two rows.

A NOT gate has just one input and reverses it: 1 becomes 0, 0 becomes 1. It's the "opposite" switch — think of a game where pressing a button turns the light off, and releasing it turns the light back on. Written ¬A (or NOT A). Because it has a single input, its truth table has only two rows instead of four.

Truth tables — every possibility

A truth table lists every combination of inputs and the output for each. Here are all three gates in one:

ABA AND BA OR BNOT A
00001
01011
10010
11110
Worked example: What is the output of (A AND B) when A = 1 and B = 0? — AND needs both inputs to be 1. Here B is 0, so the output is 0. (Only the last row, where both are 1, gives an AND output of 1.)
Common mistake: Don't confuse AND with OR. AND needs both inputs true; OR needs at least one. Row 0,1 shows the difference: AND gives 0, but OR gives 1.
A=0B=1AND → 0OR → 1
Same inputs (0 and 1): AND gives 0, but OR gives 1 — that's the difference.

Tip: to fill any truth table, list the inputs counting up in binary (00, 01, 10, 11) so you never miss a row — then apply the gate's rule to each line. AND = all, OR = any, NOT = flip.

Get the printable worksheet →
← System Software → Networks & Topologies
← Sasta Basta home All subjects