Lesson 1 of 3
Boolean Logic: Lesson 1

AND, OR and NOT Gates

The three fundamental logic gates that everything else is built from. By the end of this lesson you can write and evaluate Boolean expressions and construct truth tables from scratch.

~35 minutes GCSE Logic Gate Builder

Every calculation, every comparison, every decision a computer makes ultimately comes down to a question with only two possible answers: 0 or 1. But how does a machine built from electrical switches make complex decisions?

Consider: When you type the letter A, how does a computer decide what to display? At the lowest level, it comes down to combinations of gates asking: is this input 1? Is that input 0? Boolean logic is the language the hardware speaks.
The vocabulary of Boolean logic
Boolean logic
A system where all values are either TRUE (1) or FALSE (0). Named after mathematician George Boole.
Logic gate
An electronic component that takes one or more binary inputs and produces a single binary output based on a rule.
Truth table
A table listing every possible combination of inputs and the corresponding output for a logic gate or circuit.
Boolean expression
A written representation of logic using operators like AND, OR, NOT. Example: A AND B, NOT A.
Input / Output
The binary values (0 or 1) going into and coming out of a gate. Inputs are labelled A, B; output is typically Q.
Complement
The opposite of a Boolean value. The complement of 1 is 0; the complement of 0 is 1. Used by NOT gates.
AND, OR and NOT: click each gate to expand

Each gate has a precise rule, a standard symbol and a truth table. Learn all three and you can already express the logic behind most simple decisions a CPU makes.

AND Gate
Output is 1 only when ALL inputs are 1
Gate symbol (ANSI)
A B Q
Notation
Q = A AND B
All GCSE boards accept AND written in full. The dot (A.B) appears at A-level.

The AND gate requires both A and B to be 1 before it outputs 1. If either input is 0, the output is 0. Think of it as a series circuit: both switches must be closed for current to flow.

Q = A AND B
ABQ (A AND B)
000
010
100
111

Memory tip: AND is strict: everything must be 1. One 0 ruins it. Only one row in the truth table has output 1.

Exam angle

In a 2-mark question asking you to "complete the truth table for an AND gate", make sure all four rows are shown in the correct order (00, 01, 10, 11). Missing a row loses marks even if the values are correct.

OR Gate
Output is 1 when AT LEAST ONE input is 1
Gate symbol (ANSI)
A B Q
Notation
Q = A OR B
All GCSE boards accept OR written in full. The plus symbol (A+B) appears at A-level.

The OR gate outputs 1 if any input is 1. It only outputs 0 when all inputs are 0. Think of it as a parallel circuit: either switch being closed lets current flow.

Q = A OR B
ABQ (A OR B)
000
011
101
111

Memory tip: OR is generous: any 1 is enough. Only one row outputs 0: when both inputs are 0.

Exam angle

Students often confuse OR with XOR. In GCSE, OR means inclusive OR: A=1, B=1 gives output 1. XOR (exclusive OR) is covered in Lesson 2.

¬
NOT Gate (Inverter)
Output is the opposite of the input: one input only
Gate symbol (ANSI)
A Q
Notation
Q = NOT A
All boards accept NOT in full. The overline notation is A-level only. NOT is the only gate with a single input.

The NOT gate takes a single input and inverts it. If A=1, output is 0. If A=0, output is 1. It is the only gate with just one input. Also called an inverter.

Q = NOT A
AQ (NOT A)
01
10

Memory tip: NOT has just two rows: it can only have one input. The output is always the opposite of the input.

Exam angle

A circle on the output of a gate symbol indicates inversion (NOT). You will see this in circuit diagrams: a circle at the output of AND makes it NAND (covered in Lesson 2).

Writing logic in shorthand

Instead of drawing a gate diagram every time, we can write the logic as a Boolean expression. These follow strict rules and can be combined to describe complex circuits.

ExpressionMeaningExample (A=1, B=0)
A AND BBoth must be 11 AND 0 = 0
A OR BAt least one is 11 OR 0 = 1
NOT AOpposite of ANOT 1 = 0
NOT (A AND B)Opposite of (A AND B)NOT (0) = 1
A OR (NOT B)A is 1, or B is 01 OR 1 = 1
Order of evaluation

NOT is applied first (like a minus sign in maths), then AND, then OR. Brackets override this: always evaluate brackets first. This matters in the exam when you have compound expressions like NOT A AND B vs NOT (A AND B).

Try the Logic Gate Builder

Drag AND, OR and NOT gates from the panel, connect them with wires and toggle inputs from 0 to 1. Watch the output change in real time as you build your circuit.

Logic Gate Builder
Build AND, OR and NOT circuits. Toggle inputs and trace outputs live. Opens in a new tab.

Try these tasks: (1) Build an AND gate. Test all four input combinations. (2) Add a NOT gate to the output: what does this produce? (3) Build the expression A OR (NOT B): predict the output for A=0, B=1 before you check.

Quick quiz: AND, OR and NOT

Q1. What is the output of an AND gate when A = 1 and B = 0?

1
0
AND requires both inputs to be 1. Since B = 0, the output is 0. Only when A = 1 AND B = 1 does an AND gate output 1.

Q2. An OR gate has inputs A = 0 and B = 0. What is the output?

1
0
OR outputs 1 when at least one input is 1. When both inputs are 0, there are no 1s to pass through, so the output is 0. This is the only combination that gives output 0 for an OR gate.

Q3. What is the output of NOT A when A = 0?

1
0
The NOT gate inverts its input. NOT 0 = 1. If A were 1, the output would be 0. The NOT gate always flips the value.

Q4. How many rows are needed in a truth table for a gate with two inputs?

2
4
8
With 2 inputs each having 2 possible values (0 or 1), there are 2² = 4 combinations: 00, 01, 10, 11. For 3 inputs it would be 2³ = 8 rows. The formula is 2^n where n is the number of inputs.

Q5. Which gate has only ONE input?

AND
OR
NOT
NOT is the only gate with a single input. It takes one value and inverts it. AND and OR both require two inputs (though in real hardware they can have more).
Think deeper

A light in a corridor turns on when either a motion sensor detects movement OR a manual override switch is pressed. BUT if a "night mode" switch is enabled, the light must stay off regardless. How would you describe this in Boolean logic, and which gates would you need?

Let M = motion sensor, S = manual switch, N = night mode. The light should turn on when (M OR S) AND (NOT N). So you need an OR gate for the motion and manual inputs, a NOT gate to invert the night mode signal, and an AND gate combining both. This is exactly the kind of compound Boolean expression you will need to trace in exam questions.
Lesson 1: Boolean Logic
AND, OR and NOT Gates
Starter activity
Write on the board: "A light turns on only when the main switch AND the safety switch are both ON." Ask students to predict what happens if just one switch is on. Then: "A second light turns on when switch A OR switch B is pressed." Draw the distinction. Students often get OR and AND backwards: this physical analogy fixes it before gates are introduced.
Lesson objectives
1
State the rule for AND, OR and NOT gates in plain English.
2
Construct a full truth table for a two-input gate from memory.
3
Write a Boolean expression to represent a simple logic rule.
4
Evaluate a Boolean expression for given input values, showing working.
Key vocabulary
Boolean logic
A mathematical system where all values are TRUE (1) or FALSE (0). Named after George Boole, 19th-century mathematician.
AND gate
Output is 1 only when all inputs are 1. Equivalent to logical multiplication.
OR gate
Output is 1 when at least one input is 1. Equivalent to logical addition.
NOT gate
Inverts a single input. Output is always the complement of the input.
Truth table
A systematic table showing all input combinations and their outputs. For n inputs, there are 2^n rows.
Discussion questions
Can you think of a real-world situation that works like an AND gate? What about OR?
If NOT simply inverts the input, why would you ever need it in a circuit: can you give a practical example?
Why are truth tables written in the order 00, 01, 10, 11 rather than any other order?
Exit tickets
State the output of an AND gate when A = 1 and B = 0. [1 mark]
Complete the truth table for an OR gate with inputs A and B. [2 marks]
Write a Boolean expression for a gate that outputs 1 only when A is 1 and B is 0. Hint: you will need two gates. [2 marks]
Homework suggestion
Find three real-world examples of AND logic and three of OR logic (not from the lesson). For each, write the Boolean expression and explain what the inputs and output represent. Bonus: can you find a real example of NOT logic?