Skip to main content
WalesComputer ScienceSyllabus dot point

How are complex Boolean expressions simplified with Karnaugh maps, and how do programming constructs build a working program?

Simplify Boolean expressions using Boolean algebra and Karnaugh maps, and use programming constructs to construct programs.

A focused answer to WJEC A-Level Computer Science Unit 3 programs and logical operations, covering Boolean simplification, Karnaugh maps, sum-of-products form, and building programs from constructs and subroutines.

Generated by Claude Opus 4.813 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 answer
  3. Examples in context
  4. Try this

What this dot point is asking

WJEC wants you to simplify Boolean expressions using both algebra and Karnaugh maps, to understand sum-of-products form, and to construct programs from the standard constructs and subroutines. This A2 topic deepens the AS logic work with the systematic Karnaugh-map technique. Expect a Karnaugh-map simplification question on the Unit 3 paper, which rewards careful grouping and correct elimination of variables.

The answer

Sum-of-products form

SOP is the natural starting point because you can read it straight from a truth table, but it is usually not minimal, which is where Karnaugh maps come in.

Karnaugh maps

The map works because two adjacent cells differing in one variable means that variable can be true or false without affecting the output, so it drops out. Larger groups eliminate more variables, so always form the largest legal groups.

Constructing programs

Programs are built from the three constructs (sequence, selection, iteration) and decomposed into procedures and functions, exactly as in Unit 1 but applied to more demanding problems. Readable structure, sensible identifiers and modular design make a program correct and maintainable.

Working through a simplification

Examples in context

Example 1. Minimising a control circuit
A circuit controlling a fan from three sensor inputs starts as a six-term sum-of-products expression read from its truth table. A Karnaugh map groups the 1s and collapses it to two terms, halving the gate count. This is the everyday industrial use of the technique: fewer gates means a cheaper, faster, lower-power circuit.
Example 2. Why adjacency matters
On a Karnaugh map the columns are ordered 00, 01, 11, 10 rather than in binary counting order, so that neighbours differ in one bit. This Gray-code layout is the whole reason grouping works, and candidates who lay the map out in plain binary order group the wrong cells and get wrong answers.
Example 3. From simplified logic to a program
A simplified Boolean condition such as (NOT A) OR B can drop straight into a program's IF statement, controlling a branch cleanly. This links the logic simplification to program construction: minimised conditions make clearer, more efficient code as well as smaller circuits.

Try this

Q1. State the only group sizes allowed when grouping 1s on a Karnaugh map. [1 mark]

  • Cue. Powers of two: 1, 2, 4, 8 (and so on).

Q2. In a Karnaugh-map group, which variables are eliminated? [1 mark]

  • Cue. The variables that change value within the group; those that stay constant are kept.

Exam-style practice questions

Practice questions written in the style of WJEC exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

WJEC 20205 marksA Karnaugh map for two variables A and B has a 1 in the cells for A=0,B=1 and A=1,B=1. Write the simplified Boolean expression and explain the grouping.
Show worked answer →

Read the cells holding a 1, group adjacent ones, then identify the variable that stays constant.

The two cells with a 1 are A=0,B=1 and A=1,B=1. In both, B = 1; A changes from 0 to 1.

Grouping the two adjacent 1s, the variable that stays constant across the group is B (always 1), and A varies so it is eliminated. The simplified expression is therefore Q = B.

A truth table confirms this: the output is 1 exactly when B is 1, regardless of A.

Markers reward identifying the two 1-cells, grouping the adjacent pair, eliminating the changing variable A, and the simplified answer Q = B.

WJEC 20224 marksExplain what is meant by sum-of-products form and why a Karnaugh map is useful for simplifying a Boolean expression.
Show worked answer →

Define the form, then explain the advantage of the map over algebra.

Sum-of-products form expresses a Boolean function as several AND terms (products) combined with OR (the sum). Each product term corresponds to a row of the truth table where the output is 1.

A Karnaugh map arranges the truth-table outputs in a grid where adjacent cells differ by only one variable. Grouping adjacent 1s in powers of two lets you eliminate the variables that change within a group, giving a simplified expression directly and far more reliably than manipulating the algebra by hand.

Markers reward the products-combined-by-OR definition, and the point that the map's adjacency lets variables be eliminated by grouping, simplifying more reliably than algebra.

Related dot points

Sources & how we know this