GCSE Computer Science · Computational thinking, algorithms and programming

Boolean logic

AND, OR, NOT and XOR gates, truth tables, logic circuits and the Boolean expressions that describe them.

133 GCSE-style practice questions

Watch the lesson

Every point below, worked through in one video, and each point links straight to its own part.

8 minutes. Plays from YouTube.

More lessons like this one on our YouTube channel

Learn

Boolean logic, explained point by point

Everything the GCSE specification expects you to be able to do, and how to actually do it - the same lesson a signed-in student studies from.

  1. Complete truth tables for AND, OR and NOT

    A truth table lists every possible combination of inputs and the output for each. AND gives 1 only when both inputs are 1. OR gives 1 when at least one input is 1. NOT has a single input and reverses it. Two inputs need four rows and three inputs need eight, because each input doubles the number of combinations. Write the rows in counting order, 00, 01, 10, 11, so that none is missed.

  2. Recognise the logic gate symbols and draw logic diagramsOCR and AQA only

    Each operator has a gate symbol. The AND gate has a flat back and a rounded front. The OR gate has a curved back and a pointed front. The NOT gate is a triangle with a small circle on its point. A logic diagram joins gates so that the output of one becomes the input of the next. OCR and AQA ask you to draw and read these diagrams. Edexcel examines truth tables without gate symbols.

  3. Work out the truth table for a combination of gates

    For an expression such as (A AND B) OR NOT C, work in stages. Add a column for each part: one for A AND B, one for NOT C, then the final column, which combines those two. Fill in one column at a time, down the whole table, before starting the next. Brackets are done first, as in maths. The same method reads a logic diagram: label the output of each gate and give it a column.

  4. Use the XOR gateAQA and Eduqas only

    XOR, exclusive OR, gives 1 when exactly one of its two inputs is 1. It differs from OR in a single row: when both inputs are 1, OR gives 1 and XOR gives 0. Think of a hallway light with a switch at each end. AQA and Eduqas examine XOR. OCR and Edexcel do not.

  5. Write Boolean expressions in symbolsAQA only

    AQA writes logic in symbols. A dot between two letters means AND, a plus sign means OR, a bar drawn over a letter or a bracket means NOT, and a plus sign inside a circle means XOR. You need to turn an expression into a logic diagram and a diagram into an expression. Work outwards from the inputs, writing the expression for each gate’s output as you go.

  6. Simplify Boolean expressions using the identitiesEduqas only

    Eduqas asks you to simplify an expression so that it uses fewer operators and still gives the same output for every input. The identities are printed in the specification. Some are easy to see: anything AND 1 is itself, anything OR 0 is itself, and something OR itself is just itself. Apply one identity at a time and write each line out. A truth table for the first and last lines is a check that nothing has changed.

Boolean logic key terms

The words the specification and the mark schemes use, each defined the way an examiner wants it.

Boolean
Having only two possible values: true and false, written as 1 and 0.
Logic gate
An electronic component that takes one or more binary inputs and produces a single binary output.
AND gate
A logic gate whose output is 1 only when both of its inputs are 1.
OR gate
A logic gate whose output is 1 when at least one of its inputs is 1.
NOT gate
A logic gate with one input whose output is the opposite of that input.
XOR gate
A logic gate whose output is 1 when exactly one of its two inputs is 1.
Truth table
A table showing the output of a logic gate or circuit for every possible combination of inputs.
Logic diagram
A drawing of logic gates joined together, showing how the inputs produce the output.
Boolean expression
A statement made from inputs and logical operators that works out to true or false.

Common mistakes in Boolean logic

The slips that cost marks year after year, and what to do instead.

  • Mixing up the AND and OR truth tables

    AND needs both inputs to be 1. OR needs at least one. Check the row where the inputs differ.

  • Missing rows out of a truth table

    Two inputs need 4 rows and three inputs need 8. List them in counting order so that every combination appears once.

  • Ignoring the brackets in an expression

    Work out the bracket first and give it a column of its own, then combine that column with the rest.

  • Treating XOR as the same as OR

    They differ when both inputs are 1. OR gives 1 there, and XOR gives 0.

Practice

Try a Boolean logic question

A GCSE-style original question from this topic. Have a go before you open the working - deciding on an answer first is what makes the working stick.

The rows of a truth table are in the order A B = 00, 01, 10, 11. What is the output column for (A OR B) AND NOT A?

Make Boolean logic stick

A free account adds worked examples from our question bank, from a warm-up to a stretch, plus ask-Wiz - a coach you can put any point from this lesson to - and a checklist that remembers which points you've studied. No card needed.

Ready to practise Boolean logic?

Sign up free to practise this topic - questions that adapt to how you're doing, with instant encouraging feedback on every answer. No card needed.

Download on the App StoreGet it on Google Play

Already have an account? Log in

More Computational thinking, algorithms and programming topics