Boolean Expressions and Logic Circuits · Cambridge syllabus 10.3 · Lesson 1 of 2
Boolean Expressions
Logic expressions describe logic using the words AND, OR, NOT, NAND, NOR and XOR, as 0478 papers write them. Brackets show which operation is performed first. An expression can be written from a problem statement, a circuit or a truth table: from a truth table, take each row whose output is 1, write its inputs joined by AND, and join those brackets with OR.
By the end, you can
- Understand Boolean operators.
- Write logic expressions using the words AND, OR, NOT, NAND, NOR and XOR.
- Evaluate Boolean expressions.
- Write a logic expression from a problem statement.
- Write a logic expression from a truth table.
Logic notation
A logic expression writes a logic circuit in words. The letters stand for the inputs, and the gate names stand for the gates: AND, OR, NOT, NAND, NOR and XOR. 0478 papers write expressions this way, such as X = (A AND B) OR (B AND NOT C). Other courses use symbols such as a dot for AND and a plus for OR, but those are not used here.
Brackets show which operation is done first, and every gate’s output should be bracketed when it feeds another gate. X = (A OR B) AND C and X = A OR (B AND C) are different circuits with different truth tables, and only the brackets tell them apart, so never leave a mixed expression unbracketed.
Evaluating an expression for given input values means substituting the values and working outwards from the innermost brackets. For A = 1, B = 0, C = 1, the expression (A AND B) OR C becomes (1 AND 0) OR 1, which is 0 OR 1, which is 1.
NOT applies only to what follows it. NOT A AND B means (NOT A) AND B; to invert the whole of A AND B, write NOT (A AND B), which is the same as A NAND B.
Worth remembering
- Write logic expressions in words: AND, OR, NOT, NAND, NOR, XOR.
- Bracket every gate’s output so the order is never in doubt.
- Evaluate from the innermost brackets outwards.
Writing logic expressions
An expression can be written from a problem statement by naming the inputs and turning the statement into words joined by AND, OR and NOT. A heating system that switches on when it is cold and someone is home, or when frost protection is on, with inputs C for cold, H for someone home and F for frost protection, gives X = (C AND H) OR F.
Look for the words in the statement. And means AND; or means OR; not, or a condition being off, means NOT; and either but not both means XOR. The brackets follow the way the statement groups its conditions.
An expression can be written from a truth table by looking only at the rows where the output is 1. For each of those rows, join the inputs with AND, writing NOT in front of any input that is 0 in that row; then join the brackets for the different rows with OR. If the output is 1 only in rows 011 and 110, the expression is X = (NOT A AND B AND C) OR (A AND B AND NOT C).
That one-bracket-per-row expression is always correct, and it is enough for full marks. Check it by putting one of its rows back in: each bracket should be 1 for its own row and 0 for every row where the output is 0.
Worth remembering
- From a statement: name the inputs, then translate and, or and not into AND, OR, NOT.
- From a truth table: one AND bracket for each row whose output is 1, joined by OR.
- Write NOT before an input that is 0 in that row.
Worked example
X = (A AND B) OR (B AND NOT C). From a truth table whose only 1 outputs are rows 011 and 110: X = (NOT A AND B AND C) OR (A AND B AND NOT C).
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
0 OR 1 is 1, so the final result is 0.
Check your method, units and explanation against it.
Marked practice
Set 1 of 5 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.