How do logic gates and Boolean algebra build a computer's logic?
Understand the logic gates NOT, AND, OR, XOR, NAND and NOR, their truth tables, combining gates into logic circuits, and simplifying expressions using Boolean algebra.
A focused answer to AQA A-Level Computer Science 4.6.2 and 4.6.3, covering the logic gates NOT, AND, OR, XOR, NAND and NOR, their truth tables, building logic circuits, and simplifying Boolean expressions using the laws of Boolean algebra.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
AQA wants you to know the logic gates and their truth tables, build and read combinational logic circuits, write Boolean expressions for them, and simplify expressions using the laws of Boolean algebra including De Morgan's laws.
The logic gates
A truth table lists every combination of inputs and the resulting output. For two inputs there are rows; for inputs there are rows, which is why three-input circuits have eight rows.
A B | AND OR XOR
0 0 | 0 0 0
0 1 | 0 1 1
1 0 | 0 1 1
1 1 | 1 1 0
NAND and NOR are described as universal gates because any other gate, and so any circuit, can be built from NAND alone or from NOR alone. This matters in hardware manufacture because building a chip from a single repeated gate type is simpler and cheaper, which is why this property is worth knowing even though the exam mainly tests the basic six.
Logic circuits and Boolean expressions
Gates are wired together to form a combinational logic circuit whose output depends only on the current inputs (unlike sequential circuits, which also depend on stored state). Each circuit corresponds to a Boolean expression, for example , and you can move freely between three equivalent representations: the circuit diagram, the Boolean expression, and the truth table. A common exam task is to be given one and produce another, for example reading a circuit to write its expression, or building a truth table from an expression by evaluating it for every input row.
Simplifying with Boolean algebra
For example, , so a circuit that looks like it needs three gates reduces to a plain wire. The practical reason this matters is that fewer gates means a smaller, cheaper, faster chip, so simplification is not an academic exercise but a real engineering goal. De Morgan's laws are the most error-prone: the rule is that when a bar is broken across an expression, the operator underneath it flips (AND to OR, OR to AND) and each variable is individually inverted.
Exam-style practice questions
Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AQA 20194 marksComplete the truth table for the Boolean expression Q = (A AND B) OR (NOT C) for all input combinations of A, B and C, and state for how many of the eight rows Q is 1.Show worked answer →
There are rows. . is 1 whenever C is 0, so any row with C = 0 gives Q = 1 (four rows). Among the rows with C = 1, Q is 1 only when both A and B are 1 (one row: A = 1, B = 1, C = 1).
So Q is 1 in of the eight rows, and 0 in the remaining three rows (those with C = 1 and at least one of A, B equal to 0).
Markers reward building all eight rows, correctly evaluating the AND and the inverted C, ORing them, and the count of 5 ones.
AQA 20214 marksSimplify the Boolean expression Q = A.B + A.(NOT B) using the laws of Boolean algebra, naming the law used at each step, and state how many gates the simplified expression needs.Show worked answer →
Start: . Apply the distributive law to factor out A: . Apply the complement law, since a variable ORed with its inverse is 1: , so . Apply the identity law, since anything ANDed with 1 is itself: .
The simplified expression is , which needs no gates at all (the output is just the input A connected straight through), down from the three gates (two AND, one OR plus a NOT) of the original.
Markers reward each named law (distributive, complement, identity), the final result , and recognising the reduction in gate count.
Related dot points
- Understand the relationship between hardware and software, the classification of software into system and application software, and the role of the operating system and utility programs.
A focused answer to AQA A-Level Computer Science 4.6.1, covering the relationship between hardware and software, the classification of software into system and application software, and the role of the operating system and utility programs.
- Use arithmetic operations including integer division, modulus and exponentiation, relational operators, and the Boolean operators AND, OR and NOT, and understand operator precedence.
A focused answer to AQA A-Level Computer Science 4.1.3, covering arithmetic operators including integer division and modulus, relational operators, the Boolean operators AND, OR and NOT, and operator precedence.
- Understand the internal components of a computer, the role of the processor, main memory and buses, and the difference between RAM, ROM and cache memory.
A focused answer to AQA A-Level Computer Science 4.7.1, covering the internal components of a computer, the role of the processor, main memory and the system buses, and the differences between RAM, ROM and cache memory.
- Understand unsigned and signed binary using two's complement, binary addition and subtraction, fixed point and floating point representation of real numbers, and the effects of overflow and rounding.
A focused answer to AQA A-Level Computer Science 4.5.2 to 4.5.7, covering unsigned and signed binary using two's complement, binary addition and subtraction, fixed and floating point representation of real numbers, and overflow and rounding errors.
- Understand assemblers, compilers and interpreters, the differences between them, the stages of compilation (lexical analysis, syntax analysis, code generation and optimisation), and intermediate code.
A focused answer to AQA A-Level Computer Science 4.6.5, covering assemblers, compilers and interpreters and their differences, the stages of compilation (lexical analysis, syntax analysis, code generation and optimisation), and intermediate code such as bytecode.
Sources & how we know this
- AQA A-level Computer Science (7517) specification — AQA (2015)