Skip to topic
    ← Back to course topics

    Boolean Algebra — OCR A-Level Computer Science

    Boolean Algebra explained

    Boolean Algebra covers 5 specification points, including (a) Define problems using Boolean logic.

    Read the full explanation

    See… and (b) Manipulate Boolean expressions, including…. Open a point below for its explanation and revision guidance.

    (a) Define problems using Boolean logic. See appendix 5d.

    This criterion asks you to define a problem using Boolean logic: state precisely what a situation requires in terms of true and false inputs and outputs. Assign each input condition a variable name, such as A for 'sensor active'. Identify the output, for example 'alarm sounds', and state exactly when it must be true. Express the relationship with the operators AND, OR and NOT, so that an alarm which sounds when a door is open and the system is armed becomes Alarm = Door AND Armed. Test the definition against every case the problem describes, using a truth table if helpful. The statement refers to appendix 5d, so read that appendix to confirm the expected scope, and do not add requirements it does not set out. Define means giving a precise, complete statement rather than a loose description.

    (b) Manipulate Boolean expressions, including the use of Karnaugh maps to simplify Boolean expressions.

    This criterion covers two linked skills. First, manipulate Boolean expressions by applying laws such as identity, complement, absorption, De Morgan's laws and distribution to rewrite an expression in an equivalent, simpler form. For example, A ∧ (B ∨ ¬B) becomes A ∧ 1, which simplifies to A, because B ∨ ¬B is always true. Second, use Karnaugh maps to simplify expressions: place each 1 from the truth table into the matching cell, with rows and columns labelled in Gray code order so that neighbouring cells differ by one variable. Group the 1s into rectangles of 1, 2, 4 or 8 cells, allowing groups to wrap around the edges and overlap. Each group gives one term, found by keeping only the variables that stay constant across it. Check the final expression against the original truth table.

    (c) Use the following rules to derive or simplify statements in Boolean algebra: De Morgan’s Laws, distribution, association, commutation, double negation.

    This statement requires you to apply five named rules to derive or simplify Boolean expressions. De Morgan’s Laws move a NOT across a bracket: ¬(A ∧ B) becomes ¬A ∨ ¬B, and ¬(A ∨ B) becomes ¬A ∧ ¬B. Distribution expands a bracket: A ∧ (B ∨ C) becomes (A ∧ B) ∨ (A ∧ C). Association regroups operands without changing meaning: (A ∧ B) ∧ C equals A ∧ (B ∧ C). Commutation swaps operands: A ∨ B equals B ∨ A. Double negation removes a pair of NOTs: ¬¬A equals A. Worked example: simplify ¬(¬A ∧ B). De Morgan gives ¬¬A ∨ ¬B; double negation gives A ∨ ¬B. Write each step on its own line and name the rule used, because a traceable chain of valid steps is easier to check.

    (d) Using logic gate diagrams and truth tables. See appendix 5d.

    This statement asks you to represent Boolean logic in two linked ways: logic gate diagrams and truth tables. Start from an expression such as Q = (A ∧ B) ∨ ¬C. Draw one gate for each operation: an AND gate for A ∧ B, a NOT gate for ¬C, and an OR gate that combines their outputs to give Q. Then build a truth table with a column for each input, a column for each intermediate output, and a final column for Q. Fill every combination of inputs, which for three inputs gives 2³ = 8 rows. Checking the table against the expression confirms the diagram. The statement also refers to appendix 5d, which is not reproduced in this note; consult the official specification for its content and do not rely on this note for appendix material.

    (e) The logic associated with D type flip flops, half and full adders.

    This item covers three circuits: the D type flip flop, the half adder and the full adder. A D type flip flop has a data input D and a clock input. On a rising clock edge it copies D to Q, so Q(next) = D; between edges Q holds its value. A half adder adds two bits, A and B, giving Sum = A ⊕ B (exclusive OR) and Carry = A · B (AND). It has no carry input. A full adder adds A, B and a carry in, Cin, giving Sum = A ⊕ B ⊕ Cin and Carry out = A·B + Cin·(A ⊕ B). Two half adders and an OR gate can build a full adder. The Sum is the result bit and the Carry is the bit passed to the next column. Practise tracing each truth table row.

    Your focus

    1. Identify the inputs and outputs of a described problem and assign a Boolean variable to each.
    2. Write a Boolean expression that matches a stated output condition.
    3. Check a Boolean definition against the cases given in a problem and correct it where it fails.
    Show all 15 objectives
    1. Apply Boolean laws to rewrite an expression in an equivalent, simpler form.
    2. Transfer a truth table onto a Karnaugh map using Gray code labels.
    3. Form valid groups of 1s and derive the simplified expression from them.
    4. Rewrite a negated bracket using De Morgan’s Laws, showing each step and naming the rule.
    5. Simplify a Boolean expression to a shorter equivalent using double negation and distribution, naming each rule used.
    6. Verify that an original Boolean expression and its simplified form give identical outputs for all input combinations.
    7. Draw a logic gate diagram for a given Boolean expression with three inputs.
    8. Complete a truth table with a column for each input and each intermediate output.
    9. Check that a gate diagram’s output matches its truth table for every input combination.
    10. State the Q output of a D type flip flop after a rising clock edge for a given D input.
    11. Derive the Sum and Carry expressions for half and full adders from their truth tables.
    12. Trace a full adder for a given three-bit input and state its Sum and Carry out values.

    Boolean Algebra exam tips

    Marking Points
    • Identifies every input condition in the problem and gives each one a clearly named Boolean variable.
    • States the output condition and specifies exactly when it is true.
    • Expresses the relationship between inputs and output as a correct Boolean expression using AND, OR and NOT.
    • Checks the expression against all cases the problem describes, for example with a truth table.
    • Uses precise terms and avoids vague wording such as 'sometimes' or 'usually'.
    • Applies a named Boolean law correctly at each step and shows the working line by line.
    • Reduces the expression to an equivalent form and confirms that the result matches the original truth table.
    • Places every 1 from the truth table in the correct Karnaugh map cell using Gray code labels.
    • Forms the largest valid groups of 1s, using rectangles of 1, 2, 4 or 8 cells and allowing wrap-around.
    • Reads one term from each group by keeping only the variables that stay constant, then combines the terms with OR.
    • Applies De Morgan’s Laws by changing AND to OR or OR to AND and negating each operand inside the bracket.
    • Shows each rewritten line with the rule named beside it, so the derivation can be followed step by step.
    • Reaches an expression that is logically equivalent to the original, which can be confirmed by comparing truth tables.
    • Removes a double negation such as ¬¬A and reduces it to A.
    • Uses commutation and association to regroup operands only when this moves the expression towards the simplified form.
    • Draws one gate for each operation in the expression, with each input connected to the correct gate.
    • Links each intermediate output to the next gate so that the final output matches the expression.
    • Lists every input combination in the truth table, giving 2ⁿ rows for n inputs.
    • Checks each truth table output against the expression for every row.
    • Labels the inputs, gates and output clearly so that the diagram can be followed.
    • States that a D type flip flop stores the value on D and copies it to Q on a rising clock edge.
    • Explains that Q holds its value between clock edges, so the flip flop acts as a one-bit memory.
    • Gives Sum = A ⊕ B and Carry = A · B for the half adder, and identifies that the Carry is the AND of the two inputs.
    • Gives Sum = A ⊕ B ⊕ Cin and Carry out = A·B + Cin·(A ⊕ B) for the full adder.
    • Shows that a full adder can be constructed from two half adders and an OR gate.
    Examiner Tips
    • 💡Write your variable names down before writing any expression so the definition stays consistent throughout.
    • 💡Test your expression against every case the question gives, not just one case that looks correct.
    • 💡Remember that Define asks for a precise, complete statement, so a list of examples alone is not a definition.
    • 💡Write each algebraic step on its own line and name the law used, so the examiner can follow your manipulation.
    • 💡Draw the Karnaugh map with Gray code labels before grouping, and check that each 1 sits in the correct cell.
    • 💡Start with the largest valid groups, make sure every 1 is covered at least once, then check the final expression against the truth table.
    • 💡Remember that Manipulate asks you to change the expression, so show the transformation steps rather than only the final answer.
    • 💡Write one rule per line and name it, so each step can be checked independently.
    • 💡Before simplifying, check whether any bracket is negated, because De Morgan’s Laws should be applied first in that case.
    • 💡Check the final expression by substituting a few input combinations or by building truth tables for the original and simplified expressions.
    • 💡Work from the innermost bracket outwards when drawing the diagram, so each gate has its inputs ready.
    • 💡Build the truth table one column at a time, filling the input columns in binary counting order.
    • 💡Use the gate symbols and labels that your course materials use, and keep them consistent throughout the answer.
    • 💡Write the truth table for each circuit first, then derive the Boolean expression from the rows where the output is 1.
    • 💡Check each answer option by tracing one input row, such as A = 1, B = 1, Cin = 1, which gives Sum = 1 and Carry out = 1.
    • 💡Remember a half adder has no carry input, so eliminate any option that includes Cin for it.
    Common Mistakes
    • Describes the problem in prose without naming inputs or outputs; assign a variable to each condition before writing any expression.
    • Treats ordinary English 'or' as exclusive without saying so; Boolean OR is true when at least one input is true, so state the intended meaning.
    • Omits a condition named in the problem; read the problem line by line and map each condition to a variable.
    • Groups 1s diagonally or in sizes such as three; groups must be rectangles of 1, 2, 4 or 8 cells, so a group of three is invalid.
    • Reads a term from a group by keeping the variables that change across it; keep only the variables that stay constant.
    • Labels map rows or columns in ordinary binary order 00, 01, 10, 11; use Gray code order so that neighbouring cells differ by only one variable.
    • Treats the NOT of a bracket as applying to only the first operand, so a negated AND becomes an AND of two negations; negate both operands and change the operator, giving an OR of two negations.
    • Expands A ∧ (B ∨ C) by distributing A to only one term; distribute A to every term inside the bracket so the expansion is complete.
    • Removes only one of two NOT symbols in a double negation; a pair of NOTs cancels completely, so ¬¬A becomes A.
    • Omits an intermediate column in the truth table, so the output cannot be traced through the gates; add one column for each sub-expression.
    • Places a NOT gate on the wrong signal, negating the whole AND output instead of the single variable it applies to; follow the brackets to attach each NOT to its correct input.
    • Lists too few rows for the number of inputs, such as 4 rows for three inputs; use 2³ = 8 rows so every combination is covered.
    • Treats Q as following D continuously rather than only on the active clock edge; the output changes only when the clock edge arrives.
    • Uses OR for the half adder Sum instead of XOR; the Sum is A ⊕ B, which is 1 only when exactly one input is 1.
    • Omits the carry in term from the full adder Carry out, so the answer is wrong when Cin = 1 and A ⊕ B = 1.