0% found this document useful (0 votes)
5 views36 pages

4-Karnaugh Map Lecture

The document explains the use of Karnaugh Maps (K-maps) for simplifying Boolean functions through graphical representation of minterms and maxterms. It details the process of grouping cells in the K-map to derive minimal Boolean expressions in both Sum of Products (SoP) and Product of Sums (PoS) forms, including examples for 2, 3, 4, and 5-variable K-maps. Additionally, it discusses the concept of don't-care conditions and their role in further simplification of Boolean functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views36 pages

4-Karnaugh Map Lecture

The document explains the use of Karnaugh Maps (K-maps) for simplifying Boolean functions through graphical representation of minterms and maxterms. It details the process of grouping cells in the K-map to derive minimal Boolean expressions in both Sum of Products (SoP) and Product of Sums (PoS) forms, including examples for 2, 3, 4, and 5-variable K-maps. Additionally, it discusses the concept of don't-care conditions and their role in further simplification of Boolean functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Boolean Function

Simplification Using
Karnaugh Map
Digital Design. M. Morris Mano
Prof. Imane Aly Saroit Ismail 1 Logic Design
Karnaugh Map

Karnaugh Map (K-map) is a diagram made up of squares,


with each square representing one minterm/maxterm of the
function that is to be minimized. Since any Boolean function
can be expressed as a sum of minterms (or a product of
maxterms), it follows that a Boolean function is recognized
graphically in the map from the area enclosed by those squares
whose minterms/maxterms are included in the function.
Karnaugh map is used for Boolean function simplification.

Prof. Imane Aly Saroit Ismail 2 Logic Design


Karnaugh Map

The minterms/maxterms are transferred from a truth table


onto a two-dimensional grid where, in Karnaugh maps, the
cells are ordered in Gray code.
Simplification is obtained by optimal groups of 1s or 0s are
identified, which represent the terms of a canonical form of
the logic in the original truth table. These terms can be used to
write a minimal Boolean expression representing the required
logic.

Prof. Imane Aly Saroit Ismail 3 Logic Design


Karnaugh Map

The grid is toroidally connected, which means that rectangular


groups can wrap across the edges. Cells on the extreme right
are actually 'adjacent' to those on the far left, in the sense that
the corresponding input values only differ by one bit; similarly,
so are those at the very top and those at the bottom.

Prof. Imane Aly Saroit Ismail 4 Logic Design


Karnaugh Map

Combine the cells (squares) in the toroidal grid into one or


more group, each of 2n, where n=0,1,2,3 … etc.
It is better to have larger groups (i.e. it is better to maximize
the number of grouped cells), as it will leads to less
variables in a term.
A cell may be included in more than one group.
Do not add new groups if all cells are included in others.

Prof. Imane Aly Saroit Ismail 5 Logic Design


Karnaugh Map

In SoP Groups are composed of 1’s


A term is composed of the product of the variable(s) whom
value is not changed in the group.
Unchanged variable with value=1 is used as it is. But if the
value of the unchanged variable=0, its complement is used.
Then the sum of the terms are used.
For example: F(A, B, C, D)  B C  CD  AD

Prof. Imane Aly Saroit Ismail 6 Logic Design


Karnaugh Map

In PoS, Groups are composed of 0’s


A term is composed of the sum of the variable(s) whom value
is not changed in the group.
Unchanged variable with value=0 is used as it is. But if the
value of the unchanged variable=1, its complement is used.
Then the product of the terms are used.
For example: F(W, X, Y, Z)  (W  X  Y  Z)(X  Y  Z)(W  Y  Z)

Prof. Imane Aly Saroit Ismail 7 Logic Design


2-Variable K-map

Var2
Var1 0 1
00 01
0 In each square:
0 1
10 11 Black values represents the binary values.
1
2 3 Red values represents the decimal values.

Prof. Imane Aly Saroit Ismail 8 Logic Design


2-Variable K-map (Example 1)

Example 1:
Using k-map, optimize: B
A 0 1
F(A,B)= m (1,3) 0 1
As SoP form. 1 1

F(A,B)=B

Prof. Imane Aly Saroit Ismail 9 Logic Design


3-Variable K-map

Var2 Var3
Var1 00 01 11 10
000 001 011 010
0
0 1 3 2
100 101 111 110
1
4 5 7 6
In each square:
Black values represents the binary values.
Red values represents the decimal values.

Prof. Imane Aly Saroit Ismail 10 Logic Design


3-Variable K-map (Example 2)

Example 2:
Using k-map, optimize: BC
A 00 01 11 10
F(A,B,C)= m (0,1,4) as PoS 0 0 0
form. 1 0 0 0
As we need F as PoS, so we
need to use maxterms.
F(A,B,C)= M (2,3,5,6,7)
Prof. Imane Aly Saroit Ismail 11 Logic Design
3-Variable K-map

Exercise:
Using k-map, optimize: F(X,Y,Z)= m (0,1,3,5,6) as PoS form.

Prof. Imane Aly Saroit Ismail 12 Logic Design


3-Variable K-map
Exercise:
Using k-map, optimize the following function as SoP form.
F(A, B, C)  ABC  AB C  ABC  ABC  ABC

Prof. Imane Aly Saroit Ismail 13 Logic Design


3-Variable K-map
Exercise:
Using k-map, optimize the following function as PoP form.
F(A, B, C)  AB  ABC

Prof. Imane Aly Saroit Ismail 14 Logic Design


4-Variable K-map

Var3 Var4
Var1 Var2 00 01 11 10
0000 0001 0011 0010
00
0 1 3 2 In each square:
0100 0101 0111 0110
01 Black values represents the binary values.
4 5 7 6
1100 1101 1111 1110 Red values represents the decimal values.
11
12 13 15 14
1000 1001 1011 1010
10
8 9 11 10

Prof. Imane Aly Saroit Ismail 15 Logic Design


4-Variable K-map (Example 3)
CD
Example 3: AB 00 01 11 10
Using k-map, optimize: 00 0 0
F(A,B,C,D) = 01 0 0
11 0 0 0
M (1,2,5,6,9,11,13,14,15)
10 0 0
as PoS.

Prof. Imane Aly Saroit Ismail 16 Logic Design


4-Variable K-map (Example 4)

Example 4:
Using k-map, optimize F in an SoP form:

We need to find minterms or maxterms. We can use truth


table. But an easier way can be used is by adding 1’s (in case
of SoP) or 0’s (in case of PoS) in the square(s) that met the
value of the variables. Of course do not add two 1’s (or 0’s)
in the same square.
Prof. Imane Aly Saroit Ismail 17 Logic Design
4-Variable K-map (Example 4)

• add 1’s in the squares where A=0, B=0, C=0 (2)


• For add 1’s in the squares where A=0, D=1 (4)
• add 1’s in the squares where B=0, C=1 (4)
• add 1’s in the squares where C=1, D=1 (4)
• add 1’s in the squares where A=1, B=0, D=0 (2)

Prof. Imane Aly Saroit Ismail 18 Logic Design


4-Variable K-map (Example 4)

CD
AB CD
00 01 11 10
AB 00 01 11 10
00 1 1 111 1
00 1 1 1 1
01 1 1 11
01 1 1 1
11 1  11 1
10 1 11 11
10 1 1 1

Prof. Imane Aly Saroit Ismail 19 Logic Design


4-Variable K-map (Example 4)

CD
AB 00 01 11 10
00 1 1 1 1 Note that we can obtain the
01 1 1 1 minterms and maxterms directly
11 1  from the k-map.
10 1 1 1 F(A,B,C,D) =
=m (0,1,2,3,4,5,7,8,10,11,15)
=M (6,9,12,13,14)
Prof. Imane Aly Saroit Ismail 20 Logic Design
4-Variable K-map

Exercise:
Using k-map, optimize F as SoP.
F(W,X,Y,Z)=M(0,1,2,4,7,8,9,10,12,15)

Prof. Imane Aly Saroit Ismail 21 Logic Design


4-Variable K-map

Exercise:
Using k-map, optimize F as SoP & PoS
F(A, B, C, D)  BC AB  BCD  ABD  AB C D

Prof. Imane Aly Saroit Ismail 22 Logic Design


5-Variable K-map
Var1=0 Var1=1
Var4 Var5 Var4 Var5
Var2 Var3 Var2 Var3 00 01 11 10
00 01 11 10
00000 00001 00011 00010 10000 10001 10011 10010
00 00
0 1 3 2 16 17 19 18
00100 00101 00111 00110 10100 10101 10111 10110
01 01
4 5 7 6 20 21 23 22
01100 01101 01111 01110 11100 11101 11111 11110
11 11
12 13 15 14 28 29 31 30
01000 01001 01011 01010 11000 11001 11011 11010
10 10
8 9 11 10 24 25 27 26
In each square: Black values represents the binary values.
Red values represents the decimal values.
Prof. Imane Aly Saroit Ismail 23 Logic Design
5-Variable K-map (Example 5)

Example 5:
Using k-map, optimize:
F(V,W,X,Y,Z) =M(0,4,7,8,12,15,16,20,23,24,28,29,30,31)
As PoS form.

Prof. Imane Aly Saroit Ismail 24 Logic Design


5-Variable K-map (Example 5)

V=0 V=1
YZ YZ
WX 00 01 11 10 WX 00 01 11 10
00 0 00 0
01 0 0 01 0 0
11 0 0 11 0 0 0 0
10 0 10 0

Prof. Imane Aly Saroit Ismail 25 Logic Design


5-Variable K-map

Exercise:
Using k-map, optimize F as SoP.
F(V,W,X,Y,Z) = m
(0,2,4,6,9,10,12,13,14,15,16,17,21,25,26,28,29,30,31)

Prof. Imane Aly Saroit Ismail 26 Logic Design


F(V,W,X,Y,Z) = m (0,2,4,6,9,10,12,13,14,15,16,17,21,25,26,28,29,30,31)

27

Prof. Imane Aly Saroit Ismail


5-Variable K-map

Exercise:
Using k-map, optimize F as SoP.
F(A, B, C, D, E)  (A  B  C )(A  D  E)(C  D  E)(B  C )

Then get its minterms & maxterms.

Prof. Imane Aly Saroit Ismail 28 Logic Design


F(A, B, C, D, E)  (A  B  C )(A  D  E)( C  D  E)(B  C )

29

Prof. Imane Aly Saroit Ismail


don’t care conditions

A don't-care term for a function is an input-sequence (a


series of bits) for which the function output does not matter.
An input that is known never to occur is a can't-happen
term. Both these types of conditions are treated the same
way in logic design and may be referred to collectively
as don't-care conditions.
An “x” is added on the cell of don’t care conditions. The
cell may be used iff it will lead to more simplified function.

Prof. Imane Aly Saroit Ismail 30 Logic Design


don’t care conditions (Example 6)

Example 6: CD
AB 00 01 11 10
Using k-map, optimize:
00 0
F(A,B,C,D)= 01 0 x
 m(0,2,3,6,7,8,10,11)+ d(5,14,15) 11 0 0 x x
10 0
As PoS form.
F(A,B,C,D)=M(1,4,9,12,13)
+ d(5,14,15)
Prof. Imane Aly Saroit Ismail 31 Logic Design
don’t care conditions
Exercise:
Compare the simplified SoP function (using k-map) of:
F(A,B,C,D)= m(0,2,3,6,7,8,10,11)
F(A,B,C,D)= m(0,2,3,6,7,8,10,11) + d(5,14,15)

Prof. Imane Aly Saroit Ismail 32 Logic Design


F(A,B,C,D)= m(0,2,3,6,7,8,10,11) + d(5,14,15)

33

Prof. Imane Aly Saroit Ismail


don’t care conditions
Exercise:
Using k-map, optimize F(A,B,C) =m (4,5)+ d(0,6,7) as SoP.

Prof. Imane Aly Saroit Ismail 34 Logic Design


don’t care conditions
Exercise:
Using k-map, optimize F as SoP
F(A, B, C, D, E)  ABE(C D D)  A( C E  BD)
+d(5,12,13,14,15,17,22,23,31)
Also get the function’ minterms & maxterms.

Prof. Imane Aly Saroit Ismail 35 Logic Design


F(A, B, C, D, E)  ABE(C D D)  A( C E  BD)
+d(5,12,13,14,15,17,22,23,31)

36

Prof. Imane Aly Saroit Ismail

You might also like