Boolean Logic and Logic Gates

GCSE Computer Science · Computer Systems

What Boolean logic is

Inside a computer, every decision comes down to true (1) or false (0). Boolean logic describes how these values combine using logic gates. At GCSE you build truth tables and simple logic circuits from the gates below.

(Which gates you need depends on your board: AQA uses NOT, AND, OR, XOR; OCR and Edexcel use NOT, AND, OR.)

The logic gates

NOT gate

  • One input, one output. It inverts (flips) the input.
  • Output is 1 when the input is 0, and 0 when the input is 1.
ANOT A
01
10

AND gate

  • Two inputs. Output is 1 only when both inputs are 1.
ABA AND B
000
010
100
111

OR gate

  • Two inputs. Output is 1 when at least one input is 1.
ABA OR B
000
011
101
111

XOR gate (exclusive OR)

  • Two inputs. Output is 1 only when the inputs are different.
ABA XOR B
000
011
101
110

Truth tables

A truth table lists every possible combination of inputs and the resulting output.

  • With n inputs there are 2ⁿ rows (2 inputs → 4 rows; 3 inputs → 8 rows).
  • Fill the input columns with all combinations in binary counting order (00, 01, 10, 11).

Logic circuits and expressions

Gates can be combined into circuits. Work through them one gate at a time, using a column in your truth table for each intermediate output.

Example expression: (A AND B) OR (NOT C)

1. Make columns for A, B, C.

2. Add a column for A AND B.

3. Add a column for NOT C.

4. Combine those two with OR for the final output.

Worked example

Complete the output for A AND (NOT B) when A = 1, B = 0.

1. NOT B = NOT 0 = 1.

2. A AND 1 = 1 AND 1 = 1. Output = 1.

Common mistakes

  • Mixing up AND (needs both 1) with OR (needs at least one 1).
  • Forgetting a truth table with n inputs needs 2ⁿ rows.
  • Using XOR on a board that doesn't require it (check your spec), or forgetting XOR = "different inputs give 1".

Exam tips

  • Always add intermediate columns for each gate in a circuit — you earn method marks and avoid slips.
  • List input combinations in binary counting order so you don't miss a row.
  • State clearly which gate gives a 1: AND = both, OR = either, XOR = different, NOT = opposite.

Key facts to remember

  • NOT flips the input; AND = 1 only if both inputs are 1; OR = 1 if either is 1; XOR = 1 if inputs differ.
  • A truth table with n inputs has 2ⁿ rows.
  • Solve circuits gate by gate using intermediate columns.
Don't understand a part?

Sign in and ask our AI tutor to explain any passage in plain English.

Try AI explanations →

More on Computer Systems

The CPU and Fetch–Execute Cycle Memory and Storage

← All GCSE Computer Science notes