Karnaugh Map Simplifying or Minimisation Technique - Chapter 6-1
Karnaugh Map Simplifying or Minimisation Technique - Chapter 6-1
by
Engineer Motion Marufu
[email protected]
Cell: 0773587388
Objectives
After completing this lesson, you should be able to:
◆ Derive Boolean expression from truth table
◆ Derive SOP and POS from truth table
◆ Should be able to illustrate 2, 3, and 4 variable K-Map
◆ Plot Boolean expression on a K-Map
◆ Correctly loop adjacent variables on a K-map
◆Simplify/Minimise Boolean expression using K-map
◆Define basic Combinational logic terms
Elements of Combinational Logic
Literal, Product Term, Sum Term, Sum of Products, Product of Sum,
Maxterm, Minterm are related with combinational logic circuits. The
definations of all these terms are explained below:
Literal: It is a Boolean variable. It will be either primed/complemented or
unprimed/uncomplemented state in the logic expression. As for example,
X and 𝑋ത are both literals.
Similarly, ABC𝐷 consists of four literals A, B, C and 𝐷
Product Term: A product term is the logical product (AND) of literals.
For example, X, X𝑌 , XYZ are the product of terms when X, Y, Z are
boolean variables. But X + Y + Z is not a product term due to presence of
plus (+) sign in the expression.
Elements Of Combinational Logic
Sum Term: A sum term is sum of literals or the logical OR of literals. For example,
𝑋 + 𝑌 and X + Y + Z are sum terms, when X, Y, Z are Boolean variables. 𝑋(𝑌 + 𝑍)
is not a sum term as the logical AND operation is present.
Sum of Products: Sum of product (SOP) is the logical expression in which OR of
multiple product terms are present. Each product term is the logical AND of literals.
The example of SOP expression is 𝑌 + 𝑋𝑌 + 𝑋𝑌𝑍
Products of Sums: Product of Sum (POS) is the logical expression in which AND of
multiple OR terms are present. Each sum term is the OR of literals. The expression
(X + X𝑌) (XY + Z) (𝑌+ Z) is an example of POS.
Minterms: It is a special type of product (AND) term. It is a product term which
contains all the input variables that make up a Boolean expression.
Maxterm: A maxterm is a special type (OR) term. A maxterm is a sum term that
contains all the input variables that make up a Boolean expression.
Standard Product (Minterm) and Standard Sum
(Maxterm)
Standard Product (Minterm) and Standard Sum (Maxterm)
A standard product-term called "minterm" is the product of all the variables of the
function, with that variable complemented whose value is a 0 in the truth table.
Similarly, a standard sum-term, called "maxterm" is the sum of all the variables of
the function, with that variable complemented whose value is a 1 in the truth table. In
this way, a canonical SOP expression is the sum of minterms, and the canonical POS
expression is the product of maxterms.
Standard Product (Minterm) and Standard Sum
(Maxterm)
Note that each minterm is the complement of the corresponding maxterm, and vice
versa. Also, the total number of minterms, or maxterms is 2𝑛 in a truth table of n
variables.
Thus, for the two variables A and B, there would be four minterms (𝐴ҧ𝐵, ҧ 𝐴𝐵,
ത 𝐴𝐵, ത 𝐴𝐵)
and four maxterms(A+B, A+𝐵, ҧ
ത 𝐴+B, 𝐴+ҧ 𝐵).
ത
NOTE: Any product-term or a sum-term that does not contain all the variables of the
function, either in complemented or in un-complemented form, is not a minterm, or
maxterm.
Synthesis of Boolean Expressions-SOP And POS
To derive a logical expression from a given truth table is called synthesis, which is
just reverse of the evaluation process. There are two standard forms of an expression
which can be derived from the same truth table. One form, called sum-of-products
(SOP) expression is written as the sum of product-terms, while the other form, called
product-of sums (POS) expression , is written as the product of sum-terms. Both
these forms of the same expression are the standard forms, and are called as
canonical SOP and canonical POS expressions, respectively. Also, these canonical
forms are equivalent in providing identical outputs because each form is derived from
the same truth table. So far as hardware implementation is concerned, their relative
suitability can be decided only when each form is simplified into its minimal form.
Canonical Expressions with Two Variables
To derive a Boolean expression in the canonical SOP and POS forms from the truth
table of a 2-variable function (F) as given in Table below(a), we proceed as follows.
(a) (b)
1. In the given truth table, we add two more columns, one for the minterms and the
other for maxterms, as shown in Table (b).
2. Minterms (𝐴ҧ𝐵, ҧ 𝐴𝐵,
ത 𝐴𝐵, ത 𝐴𝐵) are entered in one column which are obtained by
multiplying all the variables, with that variable complemented whose value is a 0 in
the truth table.
Canonical Expressions with Two Variables
3. Maxterms (A + B, 𝐴 + 𝐵, ത 𝐴ҧ + 𝐵, 𝐴ҧ + 𝐵)ത are entered in the other column which are
obtained by summing all the variables, with that variable complemented whose
value is a 1 in the truth table.
4. Now we sum up all those minterms for which the output is F = 1, so as to obtain
the SOP expression as 𝑨 ഥ𝑩 ഥ + 𝑨𝑩ഥ ... Canonical SOP
5. To obtain POS expression, we multiply all those maxterms for which the output is
F = 0. Thus, the POS expression is 𝑭 = 𝑨 ഥ + 𝑩 . (𝑨
ഥ+𝑩 ഥ ) … Canonical POS
Note that the above two expressions are in their fully expanded form including all the
variables, and therefore they are also referred to as canonical expansions of the given
function. The minimal forms can be obtained by simplifying each expression
separately.
Physical Significance Of SOP And POS Forms
The physical significance of SOP and POS expressions consists in that each
expression can be implemented directly by using gating networks. That is, the SOP
form can be implemented with the AND-to-OR gating network, as shown in Figure
below. The NAND-NAND gating network shown in this Figure, is also equivalent in
providing the same output, because the two inversion circles that appear in series,
cancel out each other.
𝐴ҧ𝐴ҧ + 𝐴𝐵
ҧ + 𝐴ҧ𝐵ത + 𝐵 𝐵ത
𝐴𝐵ҧ + 𝐴ҧ𝐵ത
It can be seen that each row of the truth table represents a minterm. Below the
output (0), 1’s are placed to indicate that output contains a particular minterm in its
sum and 0’s when that term is excluded from the sum. According to the truth table,
the output (0) contains minterm 1 and 2 only. Then the output can be expressed as
ത
𝑂 = 𝐴𝐵+𝐴 𝐵ത
Sum of Product (SOP)/Minterm Representation
Another way of representing this relationship is to use the Greek
letters sigma, ∑ and an ‘m’ to represent “the sum of minterms”.
Applying these notations, we can represent the previous truth
table as 0 = ∑ 𝑚(1,2). The expression 0 = ∑ 𝑚(1,2). should be
read as “0 is the sum of minterms 1 and 2”. Illustrate the logic
diagram of 0 = ∑ 𝑚 1,2
Worked Example
Derive the canonical SOP and POS expressions from the following truth table.
Solution: According to the procedure given above, we first write down the minterms
and the maxterms in the extra columns of the following table.
Then by summing the minterms for which F = 1, we get the SOP expression as 𝐹
ҧ + 𝐴𝐵ത
= 𝐴𝐵
Worked Example
Similarly, by multiplying the maxterms for which F = 0, we get the POS expression
as 𝐹 = (𝐴 + 𝐵)(𝐴ҧ + 𝐵)ത ... Canonical POS
which can be reduced to the simplified form 𝐹 = 𝐴𝐵ҧ + 𝐴𝐵ത
3-Variable Canonical Expressions
Let us consider the truth table given
in Table (a) below with 3 input-
variables A, B and C and the output F
in a certain logic system.
(a)
It is very important, when creating the map, that adjacent variable conditions only
change by a single condition!
Three variable map
𝐹 = 𝐴𝐵 𝐶ത + 𝐴 𝐵 ഥ𝐵ഥ + 𝐴ത 𝐵 ത
ഥ 𝐶 + 𝐴𝐵𝐶
𝐹 = 𝐴𝐶ҧ + 𝐴𝐶
ҧ is the simplified Boolean expression
Karnaugh Map Format
The K map, like a truth table, is a means for showing the relationship between logic
inputs and the desired output. The following slide shows three examples of K maps
for two, three, and four variables, together with the corresponding truth tables.
These examples illustrate the following important points:
1. The truth table gives the value of output X for each combination of input values.
The K map gives the same information in a different format. Each case in the truth
table corresponds to a square in the K map.
Two Variable K-Map
For example, in Figure below, the A = 0, B = 0 condition in the truth table
corresponds to the 𝐴ҧ𝐵ത square in the K map.
Because the truth table shows X = 1 for this case, a 1 is placed in the 𝐴ҧ𝐵ത square in the
K map. Similarly, the A = 1, B = 1 condition in the truth table corresponds to the AB
square of the K map. Because X = 1 for this case, a 1 is placed in the AB square. All
other squares are filled with 0s. This same idea is used in the three- and four-variable
maps shown in the figure.
Karnaugh Map Format
2. The K-map squares are labeled so that horizontally adjacent squares differ only in
one variable. For example, the upper left- hand square in the four-variable map is
𝐴ҧ𝐵ത 𝐶ҧ 𝐷
ഥ , while the square immediately to its right is 𝐴ҧ𝐵ത 𝐶𝐷
ҧ (only the D variable is
different). Similarly, vertically adjacent squares differ only in one variable. For
example, the upper left-hand square is 𝐴ҧ𝐵ത 𝐶ҧ 𝐷
ഥ , while the square directly below it is
ҧ 𝐶ҧ 𝐷
𝐴𝐵 ഥ (only the B variable is different).
Karnaugh Map Format
Note that each square in the top row is considered to be adjacent to a
corresponding square in the bottom row. For example, the 𝐴ҧ𝐵𝐶𝐷
ത square in the top
ത
row is adjacent to the 𝐴𝐵CD square in the bottom row because they differ only in
the A variable. You can think of the top of the map as being wrapped around to
touch the bottom of the map. Similarly, squares in the leftmost column are adjacent
to corresponding squares in the rightmost column.
Karnaugh Map Format
3. In order for vertically and horizontally adjacent squares to differ in only one
variable, the top-to-bottom labeling must be done in the order shown: 𝐴ҧ𝐵, ത
ҧ 𝐴𝐵, 𝐴𝐵.
𝐴𝐵, ത The same is true of the left-to-right labeling: 𝐶ҧ 𝐷 ҧ 𝐶𝐷, 𝐶𝐷
ഥ , 𝐶𝐷, ഥ .
4. Once a K map has been filled with 0s and 1s, the sum-of- products expression
for the output X can be obtained by ORing together those squares that contain a
1. In the three- variable map, the 𝐴ҧ𝐵ത 𝐶,ҧ 𝐴ҧ𝐵𝐶, ത and 𝐴𝐵𝐶ҧ squares contain a 1,
ത 𝐴𝐵𝐶
so that X = 𝐴ҧ 𝐵ത 𝐶ҧ + 𝐴ҧ𝐵𝐶 ത + 𝐴𝐵𝐶ҧ
ത + 𝐴𝐵𝐶
Karnaugh maps and truth tables for three variables
If we interchange the vertical and horizontal variables the map will be more
horizontal than vertical. Do that and choose the layout you prefer.
Note for 3 variables we count from 23 − 1 = 7. there are 8
squares from 23 = 8.
Karnaugh maps and truth tables for four variables
Note for 4 variables we count from 24 − 1 = 15. there are 16 squares from
24= 16.
Looping
The expression for output X can be simplified by properly combining those
squares in the K map that contain 1s. The process for combining these 1s is
called looping.
Looping Groups of Two (Pairs)
Examples of looping pairs of adjacent 1s. (a) shows K map for a particular three-
variable truth table. This map contains a pair of 1s that are vertically adjacent to each
ҧ 𝐶ҧ , and the second represents 𝐴𝐵𝐶ҧ .
other; the first represents 𝐴𝐵
Note that in these two terms only the A variable appears in both normal and
complemented (inverted) form, while B and C remain unchanged. These two terms
can be looped (combined) to give a resultant that eliminates the A variable because it
appears in both uncomplemented and complemented forms.
Looping Groups of Two (Pairs)
Example of looping pairs In a K map, the top row and bottom row of squares are
considered to be adjacent. Thus, the two 1s in this map can be looped to provide a
resultant of 𝑋 = 𝐴ҧ𝐵ത 𝐶ҧ + 𝐴𝐵ത 𝐶ҧ = 𝐵ത 𝐶ҧ
Looping Groups of Two (Pairs)
Examples of looping pairs shows a K map that has two pairs of 1s that can be
looped. The two 1s in the top row are horizontally adjacent. The two 1s in the bottom
row are also adjacent because, in a K map, the left most column and the right most
column of squares are considered to be adjacent. When the top pair of 1s is looped,
ഥ ) to give the term
the D variable is eliminated (because it appears as both D and 𝐷
𝐴ҧ𝐵𝐶.
ത Looping the bottom pair eliminates the C variable to give the term 𝐴𝐵ത 𝐷 ഥ . These
two terms are ORed to give the final result for X.
Looping Groups of Two (Pairs)
To summarize:
Looping a pair of adjacent 1s in a K map eliminates the variable that appears
in complemented and uncomplemented form.
Looping Groups of Four (Quads)
A K map may contain a group of four 1s that are adjacent to each other. This
group is called a quad.
In (a), the four 1s are vertically adjacent and in (b), they are horizontally adjacent.
The K map in (c) contains four 1s in a square, and they are considered adjacent to
each other. Only C is not changing as we move from one box to another so X=C is
the Boolean expression in (a)
Looping Groups of Four (Quads)
In (b) only AB is unchanging as we move from the first box to the last or from
the last to the first whatever the case may be so X=AB. In (c) X=BD since they
are the ones not changing.
Looping Groups of Four (Quads)
In (d) are 1s adjacent, and so are those in (e), because, as pointed out earlier, the top
and bottom rows are considered to be adjacent to each other, as are the leftmost and
rightmost columns.
Looping Groups of Four (Quads)
When a quad is looped, the resultant term will contain only the variables
that do not change form for all the squares in the quad.
To summarize:
Looping a quad of adjacent 1s eliminates the two variables that appear in
both complemented and uncomplemented form.
Looping Groups of Eight (Octets)
A group of eight 1s that are adjacent to one another is called an octet. When an
octet is looped in a four-variable map, three of the four variables are eliminated
because only one variable remains unchanged.
Looping Groups of Eight (Octets)
Examples of looping an octet (c)The two rows of 𝐴ҧ𝐵ത 𝑎𝑛𝑑 𝐴 𝐵ഥ are adjacent and the
only unchanging variable is 𝐵ത is unchanging and is the simplified form.
(b)The two columns of 𝐶ҧ 𝐷
ഥ and 𝐶𝐷 ഥ and adjacent and the only unchanging term
ഥ
is 𝐷.
Complete Simplification Process
When a variable appears in both complemented and uncomplemented form
within a loop, that variable is eliminated from the expression. Variables that
are the same for all squares of the loop must appear in the final expression.
It should be clear that a larger loop of 1s eliminates more variables. To be exact, a
loop of two eliminates one variable, a loop of four eliminates two variables, and a
loop of eight eliminates three. This principle will now be used to obtain a
simplified logic expression from a K map that contains any combination of 1s and
0s.
The steps below are followed in using the K-map method for simplifying
a Boolean expression:
Complete Simplification Process
Step 1 Construct the K map and place 1s in those squares corresponding
to the 1s in the truth table. Place 0s in the other squares.
Step 2 Examine the map for adjacent 1s and loop those 1s that are not
adjacent to any other 1s. These are called isolated 1s.
Step 3 Next, look for those 1s that are adjacent to only one other 1. Loop any
pair containing such a 1.
Step 4 Loop any octet even if it contains some 1s that have already been
looped.
Step 5 Loop any quad that contains one or more 1s that have not already
been looped, making sure to use the minimum number of loops.
Complete Simplification Process
Step 6 Loop any pairs necessary to include any 1s that have not yet been looped,
making sure to use the minimum number of loops.
Step 7 Form the OR sum of all the terms generated by each loop.
Four variable K-map - Overlapping Groups
What is the simplified Boolean equation for the following logic equation
expressed by minterms?
Y = F A, B, C, D = ∑m(7, 9, 10, 11, 12, 13, 14, 15)
There are four variables and 7, 9, 10, 11, 12, 13, 14, 15 are the square
numbers in the K-map with 1s as shown below and how to loop them
DON'T-CARE CONDITIONS
In some digital systems, certain input conditions never occur
during normal operation; therefore, the y corresponding output
never appears. Since the output never appears, it is indicated by
an X in the truth table.
Table in the next slide shows a truth table where the output is low
for all input entries from 0000 to 1000, high for input entry 1001,
and an X for 1010 through 1111. The X is called a don 't-care
condition. Whenever you see an X in a truth table, you can let it
equal either O or 1, whichever produces a simpler logic circuit.
DON'T-CARE CONDITIONS
Don’t care condition in a truth table Karnaugh map with don’t care
DON'T-CARE CONDITIONS
Notice two crucial ideas. First, the 1 is included in a quad, the largest
group you can find if you visualize all X's as ls. Second, after the 1
has been encircled, all X's outside the quad are visualized as Os. In
this way, the Xs are used to the best possible advantage. As already
mentioned, you are free to do this because don't-cares correspond to
input conditions that never appear.
The minimized Boolean expression is 𝑌 = 𝐴𝐵
The logic circuit for this is an AND gate with inputs of A and D,
as shown in the next slide. You can check this logic circuit by
examining truth table. The possible inputs are from 0000 to
1001; in this range a high A and a high D produce a high Y only
for input condition 1001.
DON'T-CARE CONDITIONS