OCR · GCSE · Computer Science

    Course version: J277 · Version from Sept 2022

    Boolean logic: Combining Boolean operators using AND, OR and NOT

    Boolean operators combine conditions that are either True or False.

    Checked against the OCR J277 specification on .

    • Point 3 of 4
    • 4 key terms

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Boolean operators combine conditions that are either True or False. AND outputs True only when both inputs are True, so it narrows a search or requires two conditions together. OR outputs True when at least one input is True, so it widens a search or accepts either condition. NOT reverses a single value, turning True into False and False into True. When operators are combined, evaluate NOT first, then AND, then OR, unless brackets change the order. For example, NOT A AND B means (NOT A) AND B, while A OR B AND C means A OR (B AND C). Brackets make the intended grouping explicit, as in (A OR B) AND NOT C. This skill underpins truth tables, logic gates and program conditions such as if score > 50 AND attendance > 80.

    What earns the marks

    • States that AND produces True only when every input is True, and gives a correct two-input example such as True AND False = False.
    • States that OR produces True when at least one input is True, and gives a correct example such as False OR True = True.
    • States that NOT negates a single Boolean value, so NOT True = False and NOT False = True.
    • Applies precedence correctly: NOT before AND before OR, unless brackets override the order.
    • Evaluates a combined expression accurately, for example NOT A AND (B OR C) with A = False, B = False, C = True gives True.
    • Explains how brackets change the result, for example contrasting A OR B AND C with (A OR B) AND C.
    • Links combined Boolean expressions to a real context such as a program condition or a search filter.

    Common mistakes and how to put them right

    • Treating AND as ordinary addition or as a choice between inputs.

      Put it right by stressing that AND needs both inputs True and returns False otherwise.

    • Evaluating left to right and ignoring precedence.

      Put it right by applying NOT first, then AND, then OR, and using brackets to show grouping.

    • Assuming NOT applies to the whole expression rather than the term immediately after it.

      Put it right by writing NOT A AND B as (NOT A) AND B and using brackets where needed.

    Exam tips

    • Rewrite each combined expression with brackets before substituting values, so the order of operations is visible.
    • Substitute True and False step by step, working out one operator at a time rather than trying to do it all mentally.
    • Check the final answer against the original wording, especially whether the question asks for the result or for the expression to be simplified.

    Try the lesson

    The start of the Boolean logic: Combining Boolean operators using AND, OR and NOT lesson, made from checked teaching notes for this specification point.

    Have a go first

    Which of the following Boolean expressions evaluates to True (1) when A = 1 and B = 0?

    Listen

    Boolean operators combine conditions that are either True or False. AND outputs True only when both inputs are True, so it narrows a search or requires two conditions together. OR outputs True when at least one input is True, so it widens a search or accepts either condition. NOT reverses a single value, turning True into False and False into True. When operators are combined, evaluate NOT first, then AND, then OR, unless brackets change the order. For example, NOT A AND B means (NOT A) AND B, while A OR B AND C means A OR (B AND C). Brackets make the intended grouping explicit, as in (A OR B) AND NOT C. This skill underpins truth tables, logic gates and program conditions such as if score > 50 AND attendance > 80. A strong answer earns marks for these points. States that AND produces True only when every input is True, and gives a correct two-input example such as True AND False = False. States that OR produces True when at least one input is True, and gives a correct example such as False OR True = True. States that NOT negates a single Boolean value, so NOT True = False and NOT False = True. Applies precedence correctly: NOT before AND before OR, unless brackets override the order. A common slip: Treating AND as ordinary addition or as a choice between inputs. Instead, stressing that AND needs both inputs True and returns False otherwise. Exam tip: Rewrite each combined expression with brackets before substituting values, so the order of operations is visible.

    Key words

    Say what each word means before you turn the card.

    AND

    Try answering aloud or in your head before turning the card.

    OR

    Try answering aloud or in your head before turning the card.

    NOT

    Try answering aloud or in your head before turning the card.

    Operator precedence and grouping

    Try answering aloud or in your head before turning the card.

    See every definition
    AND
    Outputs True only when both inputs are True, so it narrows a search or requires two conditions together.
    OR
    Outputs True when at least one input is True, so it widens a search or accepts either condition.
    NOT
    Reverses a single value, turning True into False and False into True.
    Operator precedence and grouping
    When operators are combined, evaluate NOT first, then AND, then OR, unless brackets change the order.

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Boolean logic: Combining Boolean operators using AND, OR and NOT

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge