Boolean expressions
Boolean Expressions and AQA Notation
A Boolean expression is a shorthand way to write the logic performed by a circuit or combination of gates. Rather than drawing a full circuit diagram, Boolean algebra uses symbols to describe the same operations compactly. AQA uses a specific set of symbols that you must be able to read and write:
| Operation | Symbol | Example | Reads as |
|---|---|---|---|
| AND | · | A · B | A AND B |
| OR | + | A + B | A OR B |
| XOR | ⊕ | A ⊕ B | A XOR B |
| NOT | A | A | NOT A |
A · B + C
The overbar extends over the whole variable being inverted. Brackets can be used to make order of operations explicit.
Operator Precedence
Boolean expressions follow an order of operations, just like arithmetic. NOT is evaluated first, then AND, then OR and XOR. When in doubt, use brackets to make the intended order explicit. For example, A + B · C is evaluated as A + (B · C), not (A + B) · C, because AND takes priority over OR.
Reading and Writing Boolean Expressions
Reading Expressions and Matching to Gates
Each symbol in a Boolean expression corresponds directly to a logic gate. To read an expression, replace each symbol with its gate name:
| Expression | Reads as | Gate(s) used |
|---|---|---|
| A · B | A AND B | AND gate, inputs A and B |
| A + B | A OR B | OR gate, inputs A and B |
| A ⊕ B | A XOR B | XOR gate, inputs A and B |
| A | NOT A | NOT gate, input A |
| A · B | (NOT A) AND B | NOT gate on A, then AND |
| A · B + C | (A AND B) OR (NOT C) | AND gate, NOT gate on C, OR gate |
To write an expression from a description: identify each gate, replace AND with ·, OR with +, XOR with ⊕, and write a bar over any inverted variable. Remove gate names - the symbols carry that information.
Two-Input Expression: A + B
The expression A + B means (NOT A) OR B. The overbar applies only to A; B is not inverted. To evaluate it, first compute NOT A for each row, then apply OR:
| A | B | A | Q = A + B |
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 |
Interpretation: Q = 0 in only one case - when A = 1 and B = 0. NOT A = 0 and B = 0 means OR gives 0. In all other cases the OR gate has at least one 1 input and outputs 1.
Three-Input Expression: A · B + C
The expression A · B + C means (A AND B) OR (NOT C). AND takes priority over OR, so A · B is evaluated first, then NOT C is computed, then OR combines them. Three inputs require 8 rows (23).
| A | B | C | A · B | C | Q = A · B + C |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
Interpretation: Q = 0 only when C = 1 and the AND gate produces 0 (A and B are not both 1). When C = 0, NOT C = 1 always forces Q = 1 regardless of A and B. When C = 1, Q depends entirely on whether A AND B = 1.
Writing an Expression from a Description
To create a Boolean expression from a word description, identify the logical conditions, replace each with the correct symbol, and add overbars for any NOT operations. For example:
- "The output is 1 when both switches A and B are on, or when switch C is off" → A · B + C
- "The alarm triggers when sensor A is active and sensor B is not active" → A · B
- "The light is on when exactly one of A or B is on" → A ⊕ B
Writing an expression is the reverse of interpreting one: read the conditions, pick the matching operator symbols, and assemble them in the correct order.
Key Takeaways
- AQA Boolean notation: · = AND, + = OR, ⊕ = XOR, overbar = NOT.
- The overbar applies only to the variable directly below it - write it precisely over just the inverted variable.
- Operator precedence: evaluate NOT first, then AND (·), then OR (+) and XOR (⊕). Use brackets to override or clarify.
- To interpret an expression, substitute each symbol for its gate name, then evaluate left to right using precedence rules.
- To create an expression, identify which operations are needed, replace gate names with symbols, and add overbars for any inverted inputs.