Karnaugh Maps: Simplifying Boolean Expressions Visually (OCR A-Level CS 1.4.3)
OCR A-Level CS 1.4.3: how a Karnaugh map works, the Gray-code layout, the grouping rules, and how to simplify a Boolean expression using a K-map.

Free Karnaugh Maps revision resources (OCR A-Level Computer Science, 1.4.3)
We’ve made exam-style practice for this exact topic, free to download: Karnaugh Maps question sheet, mark scheme and cheat sheet. Grab them, have a go, then read the full guide below.
Simplifying with algebra works, but it's easy to get lost. A Karnaugh map (K-map) does the same job visually — you just spot rectangles of 1s. Spec point 1.4.3(b) covers manipulating Boolean expressions, including using Karnaugh maps to simplify them. Questions ask you to "complete the K-map", "ring the groups" and "find the simplest Boolean expression."
Let's cover the layout, the grouping rules, and a couple of worked examples.

What is a Karnaugh map?
A Karnaugh map is a grid that holds the output (0 or 1) for every combination of inputs — the same information as a truth table, but arranged so that simplification jumps out. Each cell is one combination of the variables; you write a 1 in the cells where the expression is true.
The trick is the labelling order. The rows and columns are labelled in Gray code — 00, 01, 11, 10 — so that adjacent cells differ by only one variable. That's the whole point: when two neighbouring cells are both 1, the variable that changed between them doesn't matter, so it can be eliminated.
A 2-variable map is 2×2; a 4-variable map is 4×4, with the columns labelled by CD (00 01 11 10) and the rows by AB (00 01 11 10).
The grouping rules
To read a simplified expression off the map, you ring the 1s in groups, following strict rules:
Groups must be rectangles containing only 1s, and the size must be a power of two — 1, 2, 4, 8 (or 16).
Make each group as large as possible — bigger groups eliminate more variables.
Use as few groups as possible to cover every 1; groups may overlap.
Groups can wrap around the edges — the left edge is adjacent to the right, and the top to the bottom (and all four corners are adjacent).
Then for each group, keep only the variables that stay the same across the whole group, and OR the groups together.
A group of 2 eliminates 1 variable.
A group of 4 eliminates 2 variables.
A group of 8 eliminates 3 variables.
Worked example 1: a group of four

Suppose the 1s sit in the cells where A = 0 and C = 0 — the four cells 0000, 0001, 0100, 0101. They form a 2×2 block. Across that whole group:
A is always 0, C is always 0 — those stay the same.
B changes (0 and 1) and D changes (0 and 1) — they vary, so they're eliminated.
So the four 1s simplify to just ¬A · ¬C. One group of four removed two variables. (You can confirm with a truth table — both forms are 1 on exactly those four input combinations.)
Worked example 2: a wrap-around group
If the 1s are in the four cells where B = 1 and D = 1 (0101, 0111, 1101, 1111), they form a group of four (a column-pair that the Gray-code layout places adjacently). B and D stay 1; A and C vary — so the expression is B · D.
And if 1s appear in all four corners of the map, they wrap around to form a single group of four — a reminder that the edges are connected, like rolling the map into a tube.
Worked example 3: counting squares
A handy check: an AND term with k variables fills a specific number of cells on a 4-variable map. A 4-variable term (e.g. A·B·C·D) is 1 square; a 3-variable term is 2 squares; a 2-variable term is 4 squares; a 1-variable term is 8 squares. This tells you how big each group should be.
Common exam mistakes
Labelling in binary order, not Gray code. It must be
00, 01, 11, 10so neighbours differ by one bit — otherwise grouping breaks.Groups that aren't powers of two. A group of 3 is not allowed; use 1, 2, 4 or 8.
Missing wrap-around groups. The edges and corners are adjacent — don't miss a group that spans them.
Groups too small. Always make groups as large as possible to eliminate the most variables.
Keeping a variable that changes. In each group, drop any variable that isn't constant across the whole group.
Quick recap
A K-map holds the output for every input combination; you write 1s where the expression is true.
Rows/columns are in Gray code (
00 01 11 10) so adjacent cells differ by one variable.Group the 1s into rectangles of size 1, 2, 4, 8, as large and as few as possible; groups can overlap and wrap around.
A group of 2 removes 1 variable, of 4 removes 2, of 8 removes 3.
For each group, keep the variables that stay constant, then OR the groups.
Frequently asked questions
What is a Karnaugh map? A Karnaugh map is a grid that holds the output of a Boolean expression for every combination of its inputs, with a 1 written in each cell where the expression is true. It is arranged so that simplification can be done visually by grouping the 1s.
Why are the rows and columns of a Karnaugh map labelled in Gray code? The labels are in Gray code order — 00, 01, 11, 10 — so that adjacent cells differ by only one variable. This means when two neighbouring cells are both 1, the variable that changes between them can be eliminated, which is what allows the visual simplification.
What are the rules for grouping in a Karnaugh map? Groups must be rectangles of 1s whose size is a power of two (1, 2, 4 or 8), made as large as possible and as few as possible to cover all the 1s. Groups may overlap and may wrap around the edges and corners of the map.
How does a Karnaugh map simplify an expression? For each group of 1s you keep only the variables that stay the same across the whole group and discard those that change, then OR the resulting terms together. A group of two removes one variable, a group of four removes two, and a group of eight removes three.
How many cells does a Boolean term fill on a four-variable Karnaugh map? A term with all four variables fills one cell, a three-variable term fills two cells, a two-variable term fills four cells and a one-variable term fills eight cells. This relationship helps you know how large each group should be.
Can Karnaugh map groups wrap around the edges? Yes. The left edge of the map is adjacent to the right edge, and the top is adjacent to the bottom, so a group can wrap around the edges. If 1s appear in all four corners, they form a single group of four because the corners are all adjacent.


