Sitemap

Karnaugh Maps — for OCR A-Level Computer Science

5 min readDec 1, 2023

--

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?

How can we simplify this?

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:

Following the rules of Karnaugh maps if we get rid of the inputs the change, i.e B and not B we are left with just A

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:

  1. 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
Press enter or click to view image in full size
Make 2 boxes one with 2 ones and the other with 8 ones.
  • 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?

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

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

Put a 1 in boxes where C and B are true. Then put a one in box where D is true. Then you have2 boxes. One with 8 ones, D. One iwht 4 ones C and B

Practice 2: Filling in the boxes according to the boolean expressions:

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

Answers to Practice 1:

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

Answers to Practice 2:

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

Past Paper Question:

From 2018 paper

Press enter or click to view image in full size

From paper 2020:

From Paper 2022 H046–01:

Answers to PPQ:

2018

Press enter or click to view image in full size

2020:

From Paper 2022 H046–01:

--

--