← Back to subjects
0
OCR GCSE Computer Science (J277) · Boolean logic
Mini-Lesson

Boolean logic

This mini-lesson covers OCR J277 · 2.4 Boolean logic: the three logic gates AND, OR & NOT, their truth tables, combining gates, and writing/reading simple Boolean expressions. Every truth-table value here has been double-checked.

AND gate OR gate NOT gate logic gates output 1 (true) or 0 (false) from their inputs

Answer the questions as you go and collect ⭐ stars. Press Start when you're ready.

Gates · AND

The AND gate

An AND gate outputs 1 only when BOTH inputs are 1. Written A AND B (or A·B).

ABA AND B000010100111
AND: output is 1 only for the 1 AND 1 row.

Think: "both must be true". 1 AND 1 = 1; every other combination = 0.

Quick check

AND output

?For an AND gate, what is the output when A = 1 and B = 0?
Gates · OR

The OR gate

An OR gate outputs 1 when AT LEAST ONE input is 1. Written A OR B (or A+B).

ABA OR B000011101111
OR: output is 0 only for the 0 OR 0 row.

Think: "one or the other (or both)". Only 0 OR 0 = 0; everything else = 1.

Quick check

OR output

?For an OR gate, what is the output when A = 1 and B = 0?
Gates · NOT

The NOT gate

A NOT gate has one input and inverts it: it outputs the opposite. Written NOT A (or Ā).

ANOT A0110
NOT flips the input: 0 becomes 1, and 1 becomes 0.

Think: NOT reverses the input. NOT 0 = 1; NOT 1 = 0.

Quick check

NOT output

?A NOT gate has a single input A = 0. What does it output?
Sort it

Output for A = 1, B = 0

For inputs A = 1 and B = 0, tap each expression, then tap the output it gives.

1️⃣ Gives 1

0️⃣ Gives 0

🔁 Gives 1 for any input

Combining gates

Combining gates

Gates can be combined to make bigger expressions. Work from the inside out, doing NOT first, then AND, then OR (brackets first if shown).

Worked example — (A AND B) OR (NOT A)

If A = 0, B = 1: A AND B = 0 AND 1 = 0; NOT A = NOT 0 = 1; then 0 OR 1 = 1.

ABA AND BNOT A(A AND B) OR (NOT A)00011010111000011101
Build extra columns for each part, then combine. Every value double-checked.

Order: do NOT first, then AND, then OR — unless brackets tell you otherwise.

Combine

Work out the output

?What is the output of (A AND B) when A = 1 and B = 1, then ORed with 0? i.e. (1 AND 1) OR 0.
Boolean expressions

Writing Boolean expressions

A Boolean expression describes an output using AND, OR and NOT. You should be able to read one and complete its truth table.

  • Q = A AND B → Q is 1 only when A and B are both 1.
  • Q = A OR NOT B → Q is 1 when A is 1, or when B is 0.

Tip: to fill a truth table, add a column for each operation and evaluate step by step (NOT, then AND, then OR).

Match it

Match gate to its rule

Tap a gate on the left, then its output rule on the right.

Gate
Output rule
Recap

The big ideas to know

AND: output 1 only when BOTH inputs are 1

OR: output 1 when AT LEAST ONE input is 1 (only 0 OR 0 = 0)

NOT: one input, inverts it (0→1, 1→0)

Combining: evaluate NOT, then AND, then OR (brackets first)

Boolean expressions: read the expression and fill the truth table step by step

You've covered the whole topic. Press Finish to see your score.

🏆

Mini-lesson complete!

⭐⭐⭐

You've worked through Boolean logic for OCR GCSE Computer Science (J277). 🎉

Your stars: 0 / 0

Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.

📣 Smashed it? Share your score

Challenge a mate to beat your stars, or show a parent how you got on.

→ Back to all subjects