Boolean logic — OCR GCSE Computer Science
Test yourself on Boolean logic with OCR GCSE practice questions.
7 days Premium · Then free forever · No card, no charge
Boolean logic explained
Logic diagrams show how Boolean operators combine binary inputs to produce an output.
Read the full explanation
AND outputs 1 only when all inputs are 1; OR outputs 1 when at least one input is 1; NOT inverts a single input. Each gate has a distinctive symbol: AND has a flat back and curved front; OR has a curved input side and a pointed output side; NOT is a triangle with a small circle at its output. To evaluate a diagram, trace inputs through gates in order, writing the intermediate value on each connecting line. For example, with inputs A = 1 and B = 0, an AND gate gives 0, an OR gate gives 1, and a NOT gate after the AND gives 1. Diagrams may combine gates, so work left to right and substitute values carefully.
Truth tables
A truth table lists every possible combination of binary inputs and the resulting output for a Boolean expression or logic diagram. For two inputs, there are four rows (00, 01, 10, 11); for three inputs, there are eight rows. Each row represents one input combination, and the output column shows the result of applying AND, OR and NOT operators. To construct a truth table, write all input combinations in a systematic order, such as counting up in binary. Add intermediate columns for sub-expressions to prevent errors, then evaluate the final output column. For example, for the expression A AND B, the output is 1 only when both A = 1 and B = 1. Truth tables can also be used to test if two logical expressions are equivalent.
Combining Boolean operators using AND, OR and NOT
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.
Applying logical operators in truth tables to solve problems
A truth table lists every possible combination of input values and the resulting output for a Boolean expression. For two inputs there are four rows, for three inputs there are eight rows, following 2ⁿ combinations. To build one, list inputs in a consistent order such as 00, 01, 10, 11, then add a column for each intermediate operation before the final output. For example, for A AND (NOT B), first work out NOT B, then combine it with A using AND. Truth tables solve problems by showing exactly when a system outputs True, which helps design logic circuits, test program conditions and check whether two expressions are equivalent. A complete table must include every input combination and a correct output for each row.
Your focus
- Identify AND, OR and NOT gates from their standard symbols in a logic diagram.
- Trace binary values through a simple logic diagram to determine the output for given inputs.
- Apply the correct Boolean rule for each gate when evaluating combined logic circuits.
Show all 12 objectives
- Construct a truth table for a Boolean expression with two or three inputs.
- Evaluate each row of a truth table correctly using AND, OR and NOT.
- Compare truth tables to determine whether two Boolean expressions are equivalent.
- State the output rule for AND, OR and NOT with correct truth values.
- Evaluate a combined Boolean expression using precedence and brackets.
- Explain how a combined Boolean expression represents a real decision or condition.
- Construct a complete truth table for a Boolean expression with the correct number of rows.
- Evaluate each row accurately by working through intermediate operations.
- Use a truth table to solve a problem or compare Boolean expressions.
Boolean logic exam tips
Quick Revision Summary (Key Takeaway)
Boolean logic in OCR GCSE Computer Science uses binary values (TRUE/1 and FALSE/0) to represent conditions and evaluate computational decisions using operators including AND, OR, and NOT. Students must master drawing standard logic gates, constructing truth tables, and creating combined Boolean expressions to solve logical problems.
Topic Overview
Boolean logic forms the foundational architecture of digital computing, translating theoretical mathematics into physical decision-making electronic circuitry. At GCSE level, students learn how simple binary signals are processed using fundamental logic gates to evaluate conditions and control system behaviours.
This topic directly links computer systems theory to algorithmic problem-solving in Paper 1 and Paper 2. Understanding truth tables, logic gate diagrams, and Boolean notation enables students to comprehend how CPUs execute conditional branching and arithmetic logic units (ALUs).
Key Concepts
- →Fundamental logic operators: NOT (inversion), AND (conjunction), and OR (disjunction).
- →Logic gate symbols: Distinct standard shapes representing NOT (triangle with circle), AND (D-shape), and OR (curved shield).
- →Truth tables: Structured tabular methods displaying every possible binary input permutation against the resulting system outputs.
- →Boolean expressions: Mathematical representations of logical statements combining variables with operator words or symbols.
Marking Points
- Identify the function of each gate symbol: AND requires all inputs to be 1, OR requires at least one input to be 1, and NOT inverts its single input.
- Trace signal values through a diagram from left to right, labelling each connecting line with its current binary value.
- Evaluate combined expressions correctly by applying the operator nearest the inputs first unless brackets or diagram layout indicate otherwise.
- Produce a correct output for any given combination of input values by substituting 0 or 1 systematically.
- Recognise that NOT gates have exactly one input and one output, while AND and OR gates may have two or more inputs.
- Distinguish the OR symbol (curved input side, pointed output side) from the AND symbol (flat back, curved front) when reading a diagram.
- List all possible input combinations for the given number of inputs, using 2ⁿ rows where n is the number of inputs.
- Order input combinations systematically, such as counting in binary from 00 to 11 for two inputs, to avoid missing or repeating rows.
- Evaluate the output for each row by applying the Boolean operators (AND, OR, NOT) in the correct order.
- Complete truth tables for expressions involving combinations of AND, OR and NOT, such as NOT (A AND B) or A OR NOT B.
- Use truth tables to compare expressions and determine whether they produce identical outputs for all input combinations.
- 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.
- Constructs a truth table with the correct number of rows, using 2ⁿ for n inputs.
- Lists all input combinations systematically, for example 00, 01, 10, 11 for two inputs.
- Adds intermediate columns for sub-expressions such as NOT B before the final output column.
- Applies AND, OR and NOT correctly in every row of the table.
- Uses the completed table to identify when the output is True or to compare expressions.
- Interprets a truth table in a problem context, such as deciding which input combination activates an alarm.
Examiner Tips
- 💡Write the value 0 or 1 on every line in the diagram before selecting the final answer; this reduces careless errors and shows your working.
- 💡Check each gate against its truth table definition rather than relying on memory of the shape alone.
- 💡If a diagram has more than two inputs to an AND or OR gate, apply the operator to all inputs together, not just the first two.
- 💡Write intermediate columns for parts of the expression, such as A AND B or NOT A, before completing the final output column.
- 💡As the OCR J277 exam is untiered, be prepared for both simple single-operator truth tables and more complex expressions combining AND, OR and NOT.
- 💡When comparing two expressions, complete both truth tables and compare the output columns row by row to prove equivalence.
- 💡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.
- 💡Write the number of rows before drawing the table, then fill inputs in a fixed pattern to avoid omissions.
- 💡Use separate columns for intermediate results so each step can be checked and marks are not lost through a single error.
- 💡After completing the table, test one or two rows mentally against the original expression to confirm the outputs.
- 💡Always write intermediate columns in truth tables during exams; this earns partial credit even if you make a transcription error in the final column.
- 💡Ensure all gate input lines touch the back of the logic gate symbol cleanly and that output lines emerge directly from the apex.
- 💡Memorise the exact number of rows required: 2 inputs require 4 rows (00, 01, 10, 11), while 3 inputs require 8 rows.
Common Mistakes
- Confusing the AND and OR gate symbols: remember that AND has a flat back and curved front, while OR has a curved input side and a pointed output side.
- Treating NOT as a two-input gate: NOT always has one input and inverts it, so 0 becomes 1 and 1 becomes 0.
- Evaluating gates in the wrong order in a combined diagram: trace from the inputs towards the output, not from the output backwards, unless you are deliberately working backwards to deduce an input.
- Missing or duplicating input combinations: always use 2ⁿ rows and list them systematically, for example 00, 01, 10, 11 for two inputs.
- Applying NOT to the wrong part of an expression: NOT binds to the term immediately following it unless brackets show otherwise, so NOT A AND B means (NOT A) AND B.
- Filling the output column by guessing rather than evaluating each row: work through each row using the operator definitions, and use intermediate columns to keep track.
- Treating AND as ordinary addition or as a choice between inputs; correct this by stressing that AND needs both inputs True and returns False otherwise.
- Evaluating left to right and ignoring precedence; correct this 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; correct this by writing NOT A AND B as (NOT A) AND B and using brackets where needed.
- Missing or duplicating input combinations; correct this by counting 2ⁿ rows and listing combinations in binary order.
- Filling the output column directly without working out intermediate values; correct this by adding a column for each operator in turn.
- Mixing up AND and OR outputs in some rows; correct this by checking each row against the rule that AND needs both True and OR needs at least one True.
- Assuming that NOT applies to the entire expression rather than the single adjacent operand when brackets are absent.
- Drawing AND and OR gate symbols indistinctly, such as flattening the curved back of an OR gate, which costs marks in diagram questions.
- Confusing binary addition with Boolean OR operations (e.g., thinking 1 OR 1 equals 10 instead of 1).
Revision Plan
- 1Day 1-2: Master the definitions, standard graphical symbols, and 2-input truth tables for NOT, AND, and OR gates.
- 2Day 3-4: Practice drawing combined logic circuits from written problem scenarios and converting circuits back into Boolean expressions.
- 3Day 5-6: Complete multi-input (3-input, 8-row) truth tables incorporating intermediate calculation columns.
- 4Day 7: Solve past OCR exam questions focusing on automated control scenarios and identify any recurring gate drawing errors.
Exam Question Types
- 📋Complete a truth table: Filling in missing intermediate and final output values for a given 2-input or 3-input circuit diagram.
- 📋Draw a logic circuit diagram: Constructing interconnected standard logic gates based on a given scenario or Boolean expression.
- 📋Write a Boolean expression: Formulating an expression using correct operators (AND, OR, NOT) to describe an automated system description.
Command Word Expectations (OCR)
Fill in missing values in a provided truth table or finish an uncompleted logic gate diagram accurately according to the prompt.
Produce a clear, recognised graphical representation of logic gates with distinct inputs and outputs connecting correctly.
Provide a single word, binary value (0 or 1), or concise Boolean expression without requiring detailed reasoning.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: Draw a truth table for the Boolean expression: Q = (A AND B) OR (NOT C).
- 1.Step 1: Identify the number of inputs. There are three inputs (A, B, C), which means 2^3 = 8 possible binary combinations (000 through 111).
- 2.Step 2: Add intermediate working columns to prevent calculation errors: one column for 'A AND B' and one column for 'NOT C'.
- 3.Step 3: Evaluate 'A AND B'. It outputs 1 only when both A is 1 and B is 1 (rows 7 and 8).
- 4.Step 4: Evaluate 'NOT C'. It inverts C, giving 1 when C is 0, and 0 when C is 1.
- 5.Step 5: Apply the final OR operator between 'A AND B' and 'NOT C'. The output Q is 1 if either intermediate column contains a 1.
Question: A greenhouse automated window opens (W = 1) when the temperature is high (T = 1) AND it is NOT raining (R = 0). Write the Boolean expression and state the output when T = 1 and R = 1.
- 1.Step 1: Identify the input conditions for the window opening. High temperature is represented by T, and not raining is represented by NOT R.
- 2.Step 2: Connect the conditions using the specified logical operator AND to form the expression: W = T AND (NOT R).
- 3.Step 3: Substitute the test values into the expression: T = 1 and R = 1.
- 4.Step 4: Evaluate the NOT operator first: NOT R = NOT 1 = 0.
- 5.Step 5: Evaluate the AND operator: 1 AND 0 = 0. Therefore, the window does not open.