In the study of computer aptitude and digital logic, simplifying Boolean expressions is a crucial skill. Boolean expressions represent logical relationships using variables that can be either true (1) or false (0). However, as the number of variables increases, these expressions can become complex and difficult to manage.
This is where the Karnaugh Map, or K-map, comes into play. A K-map is a graphical tool that helps visualize and simplify Boolean expressions efficiently. It reduces the complexity of logical expressions by organizing truth table values into a grid format, making it easier to spot patterns and minimize terms.
For students preparing for competitive exams, mastering K-maps is essential because it saves time and reduces errors when simplifying logic functions, which often appear in entrance tests for engineering and computer science courses.
To understand K-maps, let's start from the basics. A K-map is essentially a visual representation of a truth table arranged in a way that adjacent cells differ by only one variable. This arrangement follows the Gray code sequence, which ensures that only one bit changes between neighboring cells.
Each cell in a K-map corresponds to a specific combination of input variables and holds the output value (0 or 1) of the Boolean function for that combination.
Let's begin with the simplest K-map - a 2-variable K-map.
For two variables, say A and B, there are \(2^2 = 4\) possible input combinations. The K-map is a 2x2 grid where each cell corresponds to one combination of A and B.
The variables are arranged such that the columns and rows follow Gray code ordering:
Explanation: The top row corresponds to \(B=0\), the bottom row to \(B=1\). The left column corresponds to \(A=0\), and the right column to \(A=1\). Notice the Gray code ordering in the bottom row: 11 (A=1,B=1) is adjacent to 10 (A=1,B=0), differing by only one bit.
The main power of K-maps lies in grouping adjacent cells containing 1s to simplify the Boolean expression. These groups must follow specific rules:
Let's see how grouping works in a 3-variable K-map.
A 3-variable K-map has \(2^3 = 8\) cells arranged in a 2x4 grid. Here's an example with some 1s grouped:
Explanation: The red rectangle groups four 1s in the top-left corner (cells with C=0, AB=00 and 01). The green rectangle groups four 1s in the bottom-left corner (cells with C=1, AB=00 and 01). These groups help simplify the Boolean expression by combining terms.
Given the Boolean function \(F(A,B)\) which is 1 for minterms 1 and 3, simplify it using a 2-variable K-map.
Step 1: List all minterms for 2 variables. The minterms correspond to the decimal equivalent of the binary inputs:
Step 2: Draw the 2-variable K-map and fill in 1s for minterms 1 and 3, 0s elsewhere.
| A | ||
|---|---|---|
| 0 | 1 | |
| B=0 | 0 | 0 |
| B=1 | 1 | 1 |
Step 3: Group adjacent 1s. Here, the two 1s are adjacent horizontally in the bottom row.
Step 4: Determine the simplified expression from the group. Since B=1 in both cells and A changes, the simplified expression is:
Answer: \(F = B\)
Simplify the Boolean function \(F\) where the function is 1 for minterms 1, 3, 5, 7 and don't care for minterms 0 and 2 using a 3-variable K-map.
Step 1: Identify the minterms and don't care terms.
Step 2: Draw the 3-variable K-map (2 rows for C, 4 columns for AB in Gray code order: 00, 01, 11, 10).
| AB | ||||
|---|---|---|---|---|
| 00 | 01 | 11 | 10 | |
| C=0 | d (X) | 1 | 1 | d (X) |
| C=1 | 0 | 1 | 1 | 0 |
Step 3: Use don't care cells (marked X) to form larger groups of 1s.
Step 4: Group the four 1s in the middle columns (01 and 11) across both rows, including don't cares to maximize group size.
Step 5: Simplify the expression from the group.
Answer: \(F = B\)
Simplify the Boolean function \(F\) with four variables \(A, B, C, D\) given the minterms above using a 4-variable K-map.
Step 1: Understand that a 4-variable K-map has \(2^4 = 16\) cells arranged in a 4x4 grid.
The rows represent variables \(A\) and \(B\) in Gray code order: 00, 01, 11, 10.
The columns represent variables \(C\) and \(D\) in Gray code order: 00, 01, 11, 10.
| CD | ||||
|---|---|---|---|---|
| 00 | 01 | 11 | 10 | |
| 00 (AB) | 1 (0) | 0 (1) | 0 (3) | 1 (2) |
| 01 (AB) | 0 (4) | 1 (5) | 0 (7) | 0 (6) |
| 11 (AB) | 0 (12) | 0 (13) | 1 (15) | 0 (14) |
| 10 (AB) | 1 (8) | 0 (9) | 0 (11) | 1 (10) |
Step 2: Mark 1s in the K-map for minterms 0, 2, 5, 7, 8, 10, 13, 15.
Step 3: Group adjacent 1s in powers of two, remembering to consider wrapping around edges.
Step 4: Write simplified terms for each group:
Step 5: Combine terms:
\(F = B'D' + B'D + AB C\)
Answer: The simplified Boolean expression is \(F = B' + AB C\)
A vending machine accepts INR notes of denominations Rs.10, Rs.20, Rs.50, and Rs.100. The machine uses three sensors represented by variables \(A, B, C\) to detect the note type. The output \(F\) is 1 if the note is Rs.20 or Rs.100. Given the truth table below, simplify \(F\) using a 3-variable K-map.
| A | B | C | F |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 |
Step 1: Identify minterms where \(F=1\): minterms 1 (001) and 4 (100).
Step 2: Draw the 3-variable K-map and plot 1s at minterms 1 and 4.
| AB | ||||
|---|---|---|---|---|
| 00 | 01 | 11 | 10 | |
| C=0 | 0 | 0 | 0 | 1 |
| C=1 | 1 | 0 | 0 | 0 |
Step 3: Since the two 1s are not adjacent, each forms a group of one.
Step 4: Write simplified terms:
Answer: \(F = A' B' C + A B' C'\)
A sensor system uses four binary inputs \(A, B, C, D\) to measure metric units. The output \(F\) is 1 for minterms 1, 3, 7, 11, and 15. Simplify the function using a 4-variable K-map.
Step 1: Plot the 1s in the 4-variable K-map.
Step 2: Identify possible groups:
Step 3: Write simplified terms:
Answer: \(F = B D + A' B' C'\)
When to use: When grouping 1s in the K-map to minimize Boolean expressions.
When to use: When don't care terms are present in the Boolean function.
When to use: When grouping cells at the edges of the K-map.
When to use: When given truth tables in competitive exam questions.
When to use: When setting up K-map cells for multiple variables.
Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.
Go to practice →