How to use Karnaugh map to simplify a boolean expression

Karnaugh map, also widely known as K-map, is used to minimize various boolean expressions. This is done through pictorial methods rather than using the standard Boolean algebra theorems along with the equation manipulations. We can solve two to four variable expressions with the K-map method. Moreover, the number of variables in the boolean expression directly corresponds to the dimensions:

  • Two variables: It consists of rows and columns (2-D).

  • Three variables: It consists of rows, columns, and the third dimension (3-D).

  • Four variables: It consists of rows, columns, a third dimension, and the fourth dimension (4-D).

Forms of K-map

A Boolean function can be derived from an algebraic expression representing a logical relationship. This function can be represented using NAND gates or through the utilization of the K-Map method, resulting in two standardized forms that are:

Sum of product (SOP)

As the name suggests, this form will take the sum of the products of all the variables. In this form, the sum refers to the AND gate, and the product refers to the OR gate. This form is also known as the disjunctive normal form.

The variables in the SOP form of boolean representation functions are multiplied together, and then the result is added to get a final output.

Using the following steps, the SOP form can be generated:

  • Using the AND gate for each combination results in a HIGH(1) output.

  • Using the variable as it is if the input value is '1' while using the compliment for an input value of '0'.

  • Getting the AND terms joined by the OR terms can help us get the output function.

Moreover, with SOP form, we consider the minterms of the boolean function. Minterms represent the combinations of input variables for which the boolean function results in 1 (true).

Product of sum (POS)

Similar to the SOP form, it takes the product of all the sums of the variables. Once again, the product refers to the OR gate, while the sum refers to the AND gate. This form is also known as conjunction normal form.

The variables in the POS form of boolean representation functions are first summed together, and then the result is multiplied to get a final output.

Using the following steps, the POS form can be generated:

  • Using the OR gate for each combination results in a LOW(0) output.

  • Using the variable as it is if the input value is '0' while using the compliment for an input value of '1'.

  • Getting the OR terms joined by the AND terms can help us get the output function.

Moreover, with POS form, we consider the maxterms of the boolean function. Maxterms represent the combinations of input variables for which the boolean function results in 0(false).

General steps for solving a K-map

Now, we’ll be looking at the general steps for minimizing any boolean expression with the following steps:

  • Choose the appropriate K-map based on the number of variables in the Boolean function.

  • Identify the minterms or maxterms specified in the problem statement.

  • For the SOP form, place 1's in the corresponding blocks of the K-map for the minterms, leaving other blocks as 0's.

  • For POS form, place 0's in the corresponding blocks of the K-map for the maxterms, leaving other blocks as 1's.

  • Form groups that contain a total number of terms that are a power of two (e.g., 2, 4, 8, etc., excluding 1), trying to cover as many elements as possible within each group.

  • From the groups formed in the last step, identify the product terms and combine them (sum them up) to obtain the SOP form of the Boolean function.

How to create a basic K-map 

To create a K-map and understand how to solve it, we need to know what Gray code is. Gray code is also known as the reflected code, where two consecutive values vary by only a single bit in the arrangement of the binary numeral system. Let's see how to make the K-map using the Gray code:

Illustratoin of a K-map for a three variable boolean expression.
Illustratoin of a K-map for a three variable boolean expression.

Grouping

Before practicing the questions, we have to see the possible ways to form groups of '1' for minterms and '0' for maxterms on the K-map for three and four variable K-map.

Poosible ways to form groups.
Poosible ways to form groups.

K-map examples

To further explain this, we’ll be looking at examples of how to use a K-map with a varying number of variables. In these examples, we assume the minterms and maxterms are already provided and will be stated beside the K-map.

SOP with three variables

SOP with four variables

POS with three variables

POS with four variables

Assessment

Q

Consider a Karnaugh map with two input variables, A and B. How many cells are present in this K-map?

A)

2

B)

4

C)

6

D)

8

E)

16

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved