Karnaugh Maps — for OCR A-Level Computer Science
Simplifying boolean expressions
Making electronic circuits more simple
How to create karnaugh maps
How to interpret Karnaugh maps
Video Explanation of how to derive the boolean algebra term from a Karnaugh map: https://youtu.be/dQ9lyk3bmCw
Video how to fill in a karnaugh map from an expression: https://youtu.be/sUgxPT009qs
Karnaugh maps, often abbreviated as K-maps, are a method used in digital electronics and Boolean algebra to simplify Boolean expressions. They provide a visual way of representing truth tables and minimize logical expressions without using algebraic methods like Boolean algebra. The purpose of Karnaugh maps is to simplify logic functions used in computer circuits and digital systems.
Purpose:
- Simplify Boolean expressions.
- Minimize the number of logical operations needed in digital circuits.
- Provide a more intuitive and visual method compared to algebraic techniques.
Karnaugh maps rules:
- Boxes can be 1, 2, 4 ,8 , 16 etc
- Boxes can be across or down NOT diagonal
- When the output changes you drop that letter
- Use OR ∨ between boxes
- Use AND ∧ inside the box
- Not ¬
How can we use a Karnaugh Map to Simplify this complicated logic circuit?
If we build a 2D truth table with the inputs A and B, then put a 1 in the boxes where A, B and not B are true we get this:
More complicated examples:
Example 1: From the Karnaugh map below write out a boolean expression
To derive the Boolean expression from the given Karnaugh map, follow these steps:
- Identify the Groups:
- Look for groups of ‘1’s that can be made into rectangles. The rectangles can contain 1, 2, 4, 8, etc., cells (must be a power of two).
- Remember that the map wraps around, so you can group cells at the edges with each other.
2. Make the Groups as Large as Possible:
- Combine adjacent ‘1’s to create the largest possible groups because larger groups will simplify to simpler expressions.
3. Write Down the Expression for Each Group:
- For each group, identify which variables are the same within the group. A variable that doesn’t change (stays at 1 or 0) within a group will be part of the expression.
4. Combine the Expressions:
- Combine expressions within groups with an AND operation.
- Combine the expressions between groups with an OR operation
- The bigger box with 8 ones in it (this follows the box rule size) is D. because A and B change over the columns, and C changes, D is the only one that stays the same
- The smaller box is C and not A and B
- Answer: B ∧ ¬ A ∧ C ∨ D
Practice 1: What are the boolean expressions for each of these Karnaugh maps?
Filling in a Karnaugh map
Below is the boolean expression simplifying if possible:
Get Icodewithben’s stories in your inbox
Join Medium for free to get updates from this writer.
EXAMPLE: C ∧ B ∨ D
Practice 2: Filling in the boxes according to the boolean expressions:
Answers to Practice 1:
Answers to Practice 2:
Past Paper Question:
From 2018 paper
From paper 2020:
From Paper 2022 H046–01:
Answers to PPQ:
2018
2020:
From Paper 2022 H046–01:







