Skip to main content
EnglandComputer ScienceSyllabus dot point

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.

Generated by Claude Opus 4.89 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The logic gates
  3. Logic circuits and Boolean expressions
  4. Simplifying with Boolean algebra

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 22=42^2 = 4 rows; for nn inputs there are 2n2^n 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 Q=(A⋅B)+C‾Q = (A \cdot B) + \overline{C}, 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, A⋅B+A⋅B‾=A⋅(B+B‾)=A⋅1=AA \cdot B + A \cdot \overline{B} = A \cdot (B + \overline{B}) = A \cdot 1 = A, 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 23=82^3 = 8 rows. Q=(A⋅B)+C‾Q = (A \cdot B) + \overline{C}. C‾\overline{C} 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 4+1=54 + 1 = 5 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: Q=A⋅B+A⋅B‾Q = A \cdot B + A \cdot \overline{B}. Apply the distributive law to factor out A: Q=A⋅(B+B‾)Q = A \cdot (B + \overline{B}). Apply the complement law, since a variable ORed with its inverse is 1: B+B‾=1B + \overline{B} = 1, so Q=A⋅1Q = A \cdot 1. Apply the identity law, since anything ANDed with 1 is itself: Q=AQ = A.

The simplified expression is Q=AQ = A, 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 Q=AQ = A, and recognising the reduction in gate count.

Related dot points

Sources & how we know this