07 Karnaugh Maps
07 Karnaugh Maps
Karnaugh Maps
CPE107-4 Logic Circuits and Design
Engr. John Paul T. Cruz
Internal Use
Objectives
• Plot Boolean functions on a Karnaugh Map in minterm, maxterm, or algebraic form.
• Obtain the minimum sum of products or minimum product of sums form of a function from
a K-Map.
• Understand the relation between operations performed using the map and the
corresponding algebraic operations.
• Determine the implicants and essential prime implicants of a function from a K-Map.
Internal Use
Introduction
Logic Expressions can be simplified algebraically using Boolean Theorems. However, two
problems arise when algebraic procedures are used:
1. The procedures are difficult to apply systematically.
2. It is difficult to tell when you have arrived at a minimum solution.
A Karnaugh Map (K-Map) provides a systematic method for simplifying logic expressions. A
K-Map will produce a minimum form of the logic Boolean function when properly used.
Internal Use
Minimum Forms
A minimum SOP/POS expression is defined as an SOP/POS term with a minimum number
of terms and a minimum number of literals. Minimum forms correspond directly to a gate
circuit with a minimum number of gates and gate inputs.
Given a minterm or a maxterm expansion, the minimum form can be obtained by combining
and factoring like terms to eliminate as many literals as possible and to eliminate redundant
terms using consensus theorem or any application theorems.
Example:
𝐹 𝑎, 𝑏, 𝑐 = 𝑚 (0,1,2,5,6,7)
Minimum SOP: 𝐹 𝑎, 𝑏, 𝑐 = 𝑎′ 𝑐 ′ + 𝑏 ′ 𝑐 + 𝑎𝑏
Minimum POS: 𝐹 𝑎, 𝑏, 𝑐 = (𝑎 + 𝑏′ + 𝑐 ′ )(𝑎′ + 𝑏 + 𝑐)
Internal Use
Minimum Forms
Obtain the minimum form of the function below: 𝐹 𝑎, 𝑏, 𝑐 = σ 𝑚 (0,1,2,5,6,7)
Internal Use
Minimum Forms
The uniting theorem 𝑋𝑌 ′ + 𝑋𝑌 = 𝑋 can be applied to minterms and products where they are
represented in algebraic or binary notation. Minterms can only be combined if they differ in
one variable, and products only combine if they have dashes in the same position (same
missing variables) and differ in one other variable.
Internal Use
Karnaugh Map
A K-Map is a systematic way of simplifying logic expressions and lead directly to minimum
cost gate circuits composed of basic gates.
The K-Map is similar to a truth table, but instead of being organized into columns and rows,
it is an array of cells in which each cell represents a binary value of the input variables.
Typically used K-Maps are from 2 variables up to 5 variables.
Internal Use
Two-Variable K-Map
Internal Use
Two-Variable K-Map
Each 1 on the map corresponds to a minterm of F. We can read the minterms from
the map just like we can read them from the truth table. Minterms in adjacent
squares of the map can be combined since they differ in only one variable
Internal Use
Three-Variable K-Map
Three-Variable K-Map
Internal Use
Three-Variable K-Map
Internal Use
Three-Variable K-Map
𝐹 𝑎, 𝑏, 𝑐 = 𝑚 (1, 3, 5)
𝐹 𝑎, 𝑏, 𝑐 = ෑ 𝑀 (0, 2, 4, 6, 7)
Three-Variable K-Map
In three-variable Karnaugh maps, each group of cells contains the following conditions:
• One square represents a minterm or maxterm of 3 literals
• A group of 2 squares represents a term of 2 literals.
• A group of 4 squares represents a term of 1 literal.
• A group of 8 squares produces a function equal to 0 or 1.
Internal Use
Three-Variable K-Map
If a function is given in
algebraic form, plot
each product term
directly as a group of
1s on the map.
Internal Use
Three-Variable K-Map
Internal Use
Three-Variable K-Map
Internal Use
Three-Variable K-Map
Four-Variable K-Map
Internal Use
Four-Variable K-Map
In four-variable Karnaugh maps, each group of cells contains the following conditions:
• One square represents a minterm or maxterm of 4 literals
• A group of 2 squares represents a term of 3 literals.
• A group of 4 squares represents a term of 2 literals.
• A group of 8 squares represents a term of 1 literal.
• A group of 16 squares produces a function equal to 0 or 1.
Internal Use
Four-Variable K-Map
Internal Use
Five-Variable K-Map
Internal Use
Five-Variable K-Map
Internal Use
Five-Variable K-Map
Five-Variable K-Maps
In five-variable Karnaugh maps, each group of cells contains the following conditions:
• One square represents a minterm or maxterm of 5 literals
• A group of 2 squares represents a term of 4 literals.
• A group of 4 squares represents a term of 3 literals.
• A group of 8 squares represents a term of 2 literals.
• A group of 16 squares represents a term of 1 literal.
• A group of 32 squares produces a function equal to 0 or 1.
Internal Use
𝐹 = 𝑨′ 𝑩′ 𝑫′ +
𝑨𝑩𝑬′ +
𝑨𝑪𝑫 +
𝑨′ 𝑩𝑪𝑬 +
𝑩′ 𝑪𝑫′
Internal Use
𝐹 = 𝑨′ 𝑩′ 𝑫′ +
𝑨𝑩𝑬′ +
𝑨𝑪𝑫 +
𝑨′ 𝑩𝑪𝑬 +
𝑨𝑩′ 𝑪
Internal Use
A prime implicant of a function F is a product term implicant or a sum term implicant, which
is no longer an implicant if any literal is deleted from it or cannot be combined with another
term to eliminate a variable.
Prime
Implicants
Implicants
Internal Use
The minimum expression for a function consists of some (but not necessarily all) of the
prime implicants of a function. In other words, a sum of products or product of sums
expression containing a term not a prime implicant cannot be minimum. A prime implicant
composed of don’t care conditions can never be part of the minimum solution. The minimum
expression is the minimum number of prime implicants which cover all of the 1’s or 0’s on
the map.
Internal Use
If a minterm/maxterm is covered by
only one prime implicant, that prime
implicant is said to be essential, and
it must be included in the minimum
expression.
Examples
Plot the following function on a Karnaugh Map and determine the minimum sum of products
and minimum product of sums: 𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐵𝐷 ′ + 𝐵′ 𝐶𝐷 + 𝐴𝐵𝐶 + 𝐴𝐵𝐶 ′ 𝐷 + 𝐵′ 𝐷′
Determine the minimum sum of products and minimum product of sums expressions for
term: 𝑓(𝑎, 𝑏, 𝑐, 𝑑) = 𝑏 ′ 𝑐 ′ 𝑑 ′ + 𝑏𝑐𝑑 + 𝑎𝑐𝑑 ′ + 𝑎′ 𝑏′𝑐 + 𝑎′ 𝑏𝑐 ′ 𝑑
Examples
Find the minimum sum-of-products expression for each function. List all the prime
implicants and determine which minterm/s makes the corresponding prime implicant
essential.
𝑓 𝑎, 𝑏, 𝑐, 𝑑 = 𝑚 0,1,3,5,6,7,11,12,14
𝑓 𝑎, 𝑏, 𝑐, 𝑑 = ෑ 𝑀 5,7,13,14,15 ∙ ෑ 𝐷 1,2,3,9
𝑓 𝑎, 𝑏, 𝑐, 𝑑, 𝑒 = 𝑚 (0,3,4,5,6,7,8,12,13,14,16,21,23,24,29,31)
Internal Use
Examples
Find the minimum sum-of-products expression for each function. Determine which
minterm/s makes the corresponding prime implicant essential.
𝑓 𝑎, 𝑏, 𝑐, 𝑑 = 𝑚 4,11,12,13,14 + 𝑑 (5,6,7,8,9,10)
𝑓 𝑎, 𝑏, 𝑐, 𝑑 = 𝑚 3,11,12,13,14 + 𝑑 (5,6,7,8,9,10)
Find the minimum sum-of-products expression and product-of-sums expression for the
function below:
𝑓 𝑎, 𝑏, 𝑐, 𝑑, 𝑒 = 𝑚 0,1,2,6,7,9,10,15,16,18,20,21,27,30 + 𝑑 (3,4,11,12,19)
Internal Use