K-Map Simplification — Part 1
Learn the fundamentals of K-Map simplification, including minterms, maxterms, canonical SOP and POS forms, truth-table conversion, and 2-variable K-Maps with step-by-step simplification examples.
Gulshan Kumar
· 15 min read
Karnaugh Maps, commonly called K-Maps, provide a visual method for simplifying Boolean expressions.
Before learning how to simplify expressions using K-Maps, it is important to understand:
- Minterms
- Maxterms
- Canonical forms
- Sum of Products and Product of Sums
- Conversion from truth tables
- Algebraic expansion into canonical form
- Structure of a Karnaugh Map
- 2-variable K-Maps
- Grouping or looping adjacent cells
These concepts form the foundation of K-Map simplification.
Minterm
A minterm is a product (AND) term in which every variable of the Boolean function appears exactly once, either in its complemented or uncomplemented form.
For two variables and , the possible minterms are:
There are four possible minterms because two variables can have:
possible combinations.
For three variables , , and , the eight possible minterms are:
Therefore, for Boolean variables, the total number of possible minterms is:
Truth Property of a Minterm
A particular minterm evaluates to 1 for exactly one combination of input values.
For all other input combinations, it evaluates to .
For example:
is equal to only when:
For every other combination of , , and :
This property makes minterms very useful when constructing Boolean expressions directly from truth tables.
Minterm Numbering
Minterms are commonly represented using the notation:
The subscript corresponds to the decimal value of the binary input combination.
For three variables , , and :
| Minterm | Symbol | |||
|---|---|---|---|---|
| 0 | 0 | 0 | ||
| 0 | 0 | 1 | ||
| 0 | 1 | 0 | ||
| 0 | 1 | 1 | ||
| 1 | 0 | 0 | ||
| 1 | 0 | 1 | ||
| 1 | 1 | 0 | ||
| 1 | 1 | 1 |
For example:
because
Maxterm
A maxterm is a sum (OR) term in which every variable appears exactly once, either complemented or uncomplemented.
For two variables and , the possible maxterms are:
For three variables , , and , the eight possible maxterms are:
Therefore, for Boolean variables, the number of possible maxterms is:
Truth Property of a Maxterm
A particular maxterm evaluates to 0 for exactly one input combination.
For every other combination, it evaluates to .
For example:
becomes only when:
because:
For every other input combination:
Maxterm Numbering
Maxterms are represented as:
For a maxterm, a variable appears:
- uncomplemented when its corresponding input value is ,
- complemented when its corresponding input value is .
For three variables:
| Maxterm | Symbol | |||
|---|---|---|---|---|
| 0 | 0 | 0 | ||
| 0 | 0 | 1 | ||
| 0 | 1 | 0 | ||
| 0 | 1 | 1 | ||
| 1 | 0 | 0 | ||
| 1 | 0 | 1 | ||
| 1 | 1 | 0 | ||
| 1 | 1 | 1 |
Minterm Expansion
When a Boolean function is written as a sum of minterms, it is called a:
- Minterm expansion
- Canonical Sum of Products
- Standard Sum of Products
- Canonical SOP form
- Disjunctive Normal Form in the canonical Boolean sense
For example:
Another example is:
Each product term is a minterm because every variable occurs exactly once.
Sigma Notation for Minterms
Instead of writing every minterm explicitly, we can use the compact notation:
For example:
corresponds to:
Therefore:
This notation becomes especially useful when working with K-Maps.
Gate Implementation of Canonical SOP
A canonical Sum of Products expression can be implemented directly using AND and OR gates.
Consider:
Each minterm is implemented using an AND gate:
and
The outputs of these AND gates are then connected to an OR gate.
Thus, the general structure is:
If the expression contains minterms and each minterm is implemented by one AND gate, then a basic two-level implementation contains approximately:
main logic gates:
- AND gates
- OR gate
excluding any NOT gates required to generate complemented variables.
Canonical expressions are easy to construct but are often not the simplest implementation.
K-Maps help reduce such expressions.
Maxterm Expansion
When a Boolean function is written as a product of maxterms, it is called:
- Maxterm expansion
- Canonical Product of Sums
- Standard Product of Sums
- Canonical POS form
- Conjunctive Normal Form in the canonical Boolean sense
For example:
For three variables, an expression may look like:
Each parenthesized term is a maxterm.
Pi Notation for Maxterms
Maxterms can be represented compactly using:
For example:
corresponds to:
Therefore:
Canonical Form
A Boolean function written as either:
or
is said to be in canonical form.
Thus, the two important canonical forms are:
and
Complete Minterm Expansion
For variables, there are:
possible minterms.
The sum of all possible minterms is called the complete minterm expansion.
For two variables and :
This expression is always equal to .
Let us verify:
Group terms:
Using:
we get:
Therefore:
and:
Hence:
In general, the sum of all possible minterms of variables is identically:
Complete Maxterm Expansion
Similarly, the product of all possible maxterms of variables is called the complete maxterm expansion.
For two variables:
This expression evaluates identically to:
Thus:
- Sum of all minterms
- Product of all maxterms
Expansion of a Boolean Function into Canonical Form
A Boolean function can be converted into canonical form using two common methods:
- From a truth table
- Algebraically
Canonical Form from a Truth Table
Suppose a truth table describing a Boolean function is given.
The truth table can be used directly to obtain both:
and:
Obtaining the Minterm Expansion
To obtain the sum of minterms:
- Look at all rows where the output is .
- Construct a minterm for each such row.
- OR all those minterms together.
When forming a minterm:
- Input complemented variable
- Input uncomplemented variable
Obtaining the Maxterm Expansion
To obtain the product of maxterms:
- Look at all rows where the output is .
- Construct a maxterm for each such row.
- AND all those maxterms together.
When forming a maxterm:
- Input uncomplemented variable
- Input complemented variable
Notice that this rule is the opposite of the rule used for minterms.
Example: Finding Minterm and Maxterm Expansions
Consider the following truth table:
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 |
Minterm Expansion
The output is for rows:
Therefore:
The corresponding minterms are:
Hence:
Maxterm Expansion
The output is for rows:
Therefore:
The corresponding maxterms are:
Therefore:
Relationship Between Minterms and Maxterms
For the previous function:
The missing indices are:
Therefore:
In general, if:
then the maxterm indices are the indices not contained in .
For example:
Since the possible indices are:
the remaining indices are:
Thus:
Algebraic Method for Canonical Expansion
Canonical forms can also be obtained algebraically.
For a canonical SOP expression, every product term must contain all variables.
If a variable is missing, use the complement law:
For a canonical POS expression, every sum term must contain all variables.
If a variable is missing, use:
along with the Boolean identity:
Example: Convert to Sum of Minterms
Express:
as a sum of minterms.
The function contains three variables:
Expanding the Term
The term is missing both and .
Introduce using:
Therefore:
Both terms are still missing .
Introduce :
Therefore:
Similarly:
Hence:
Thus:
Expanding the Term
The term:
is missing .
Using:
we obtain:
Therefore:
Combining the Terms
Thus:
becomes:
The term appears twice.
Using the idempotent law:
we get:
The corresponding minterm indices are:
Therefore:
Example: Convert to Product of Maxterms
Consider:
We want to express it as a canonical Product of Sums.
First convert the expression into POS form.
Using the Boolean identity:
we obtain:
One convenient factorization is:
Now each sum term must contain all three variables.
Expanding
The variable is missing.
Using:
we may write:
Using:
we obtain:
Expanding
The variable is missing:
Therefore:
Expanding
The variable is missing:
Therefore:
Combining the Maxterms
Thus:
Using the idempotent law:
duplicate factors can be removed.
Hence:
In maxterm notation:
Introduction to Karnaugh Maps
Canonical forms are systematic, but they are often not minimal.
For example, a Boolean function may contain several minterms and require many gates even though an equivalent expression with fewer literals and gates exists.
The Karnaugh Map, or K-Map, provides a graphical technique for simplifying Boolean expressions.
It is especially convenient for functions involving:
- 2 variables
- 3 variables
- 4 variables
K-Maps can also be extended to 5 or 6 variables, but the map becomes increasingly difficult to manage manually.
What Is a K-Map?
A Karnaugh Map is a diagram made of cells or squares.
If a Boolean function contains variables, its K-Map contains:
cells.
Therefore:
| Variables | Number of K-Map cells |
|---|---|
| 2 | |
| 3 | |
| 4 | |
| 5 |
Each cell represents exactly one minterm.
For SOP simplification:
- Write in cells whose minterms are present.
- Write in cells whose minterms are absent or generally we keep it empty.
Thus, a K-Map is essentially a two-dimensional rearrangement of a truth table.
Its special arrangement makes simplification easier because logically adjacent minterms are placed next to one another.
2-Variable K-Map
For two variables and :
Therefore, the K-Map contains four cells.
A common representation is:
Loading image…
Equivalently, using minterm numbers:
where:
Adjacent Cells in a K-Map
Two cells are called adjacent when their corresponding minterms differ in exactly one variable.
For example:
and:
are adjacent because only changes:
while remains unchanged.
Similarly:
and:
are adjacent because only changes.
However:
and:
are not adjacent, because both variables change.
Why Adjacent Terms Simplify
Consider:
Factor out :
Using:
we get:
Therefore:
The variable disappears because it occurs once complemented and once uncomplemented.
This is the central idea behind K-Map simplification.
Looping in a K-Map
The process of combining adjacent cells containing s is called grouping or looping.
When two adjacent minterms are grouped, the variable that changes between them is eliminated.
For example:
becomes:
Therefore:
A K-Map allows us to recognize such simplifications visually rather than carrying out Boolean algebra every time.
Example 1
Simplify:
The two minterms are:
and:
The K-Map is:
Loading image…
The two s are vertically adjacent.
Inside the group:
- changes from to .
- remains .
Therefore is eliminated.
Since , the remaining literal is:
Hence:
Algebraically:
Therefore:
Example 2
Simplify:
The K-Map is:
The two s are diagonally opposite.
Diagonal cells are not adjacent in a K-Map.
Therefore, no grouping is possible.
Hence the expression cannot be simplified further using ordinary SOP grouping:
This expression is also the XOR function:
Example 3
Simplify:
Place the corresponding s in the K-Map and group the adjacent cells:
Loading image…
There are three s.
We can form two groups.
First Group
Group:
and:
Here:
- changes.
- remains constant.
Therefore:
Second Group
Group:
and:
Here:
- changes.
- remains constant.
Therefore:
Notice that the cell corresponding to:
is used in both groups.
This is perfectly valid.
A K-Map cell containing may be included in more than one group when doing so produces a simpler expression.
Therefore:
Algebraic Verification
Starting with:
Group the last two terms:
Since:
we obtain:
Now use the Boolean identity:
Taking:
and:
we get:
Therefore:
which agrees with the K-Map result.
Important Observation About Overlapping Groups
K-Map groups are allowed to overlap.
For example, in the previous expression:
the minterm:
participates in two groups.
This is allowed because the objective is not simply to cover every exactly once.
The objective is to obtain the simplest Boolean expression.
Therefore, a cell may be reused whenever it helps create a larger or more useful group.
Basic Idea Behind K-Map Simplification
Whenever adjacent minterms are combined, one or more variables disappear.
For example:
because changes while remains constant.
Similarly:
because changes while remains constant.
Thus:
while:
This simple principle is the foundation of Karnaugh Map simplification.
Minterm and Maxterm Rules at a Glance
| Property | Minterm | Maxterm |
|---|---|---|
| Operation inside term | AND | OR |
| Example | ||
| Used in | SOP | POS |
| Selected truth-table rows | Output | Output |
| Variable for input | Complemented | Uncomplemented |
| Variable for input | Uncomplemented | Complemented |
| Unique value | Equals once | Equals once |
| Notation |
Quick Example of the Complementary Relationship
Suppose:
The complete set of indices is:
The indices not present in the minterm expansion are:
Therefore:
Summary
A minterm is an AND term containing every variable exactly once:
and a minterm becomes for exactly one input combination.
A maxterm is an OR term containing every variable exactly once:
and a maxterm becomes for exactly one input combination.
For variables:
and:
A Boolean function written as a sum of minterms is expressed as:
while a function written as a product of maxterms is expressed as:
A Karnaugh Map contains:
cells for variables.
Each cell represents one minterm.
K-Map simplification is based on grouping adjacent cells containing s so that changing variables are eliminated.
For example:
and:
The main principle is:
This idea becomes even more powerful when we move to 3-variable and 4-variable K-Maps, where larger groups of , , , or more cells can eliminate multiple variables simultaneously.
What did you think?
Follow the idea
Continue the conversation
Share a question, an insight, or a different perspective.
Discussion loads when you reach this section.