0% found this document useful (0 votes)
32 views62 pages

8 Topic 5 - Karnaugh Map Quine-McCluskey Method

The document introduces the Karnaugh Map as a systematic method for simplifying Boolean expressions using a visual aid. It explains the structure of K-maps for different variable counts, their advantages, and methods for grouping terms to reduce complexity. The document also discusses the limitations of K-maps, particularly for more than six variables.

Uploaded by

64950
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views62 pages

8 Topic 5 - Karnaugh Map Quine-McCluskey Method

The document introduces the Karnaugh Map as a systematic method for simplifying Boolean expressions using a visual aid. It explains the structure of K-maps for different variable counts, their advantages, and methods for grouping terms to reduce complexity. The document also discusses the limitations of K-maps, particularly for more than six variables.

Uploaded by

64950
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 62

Topic 5:

Principle of Combinational Circuit


(Karnaugh Map)

1
Introduction to Karnaugh
Map
 Systematic method to obtain simplified
sum-of-products (SOPs) Boolean
expressions.
 Objective: Fewest possible terms/literals.
 Diagrammatic technique based on a special
form of Venn diagram.
 Advantage: Easy with visual aid.
 Disadvantage: Limited to 5 or 6 variables.

2
Venn Diagrams

 Venn diagram to represent the space of minterms.


 Example of 2 variables (4 minterms):

a'b'

ab' ab a'b
a
b

3
Karnaugh Map Methods

A Karnaugh Map is a matrix of squares


each square represents a minterm or
maxterm from a Boolean expression

A Karnaugh Map allows us to find input variable


redundancies
 help reduce output equation

4
Karnaugh Map Methods

Each map lists the 2 n product terms that can


be formed from n variables, each in a different
square.

 a product term in nxvariables


, y, z is called a minterm
 for
2 3 3variables
8 xyz , x yz ,..., x y z
 minterms i.e.

5
Karnaugh Map Methods

A map of n variables will have 2 n squares, each


representing a minterm.

The minterm in each square or element of the map is the


product of the variables listed at row and column of the
element
 x yz is at the intersection ofx y and z

6
Karnaugh Map Methods

The Karnaugh Map is very convenient

 provides some “feel” for the function due


to its graphical presentation

7
Karnaugh Map Methods

However its usefulness is chiefly due to the


arrangement of the cells or squares.

 Each cell differs from the adjacent cell by having


exactly one variable complemented in the
minterm.
 The expression must be written in canonical
form  each term in the expression must contain
each variable.

8
Different Types of K-maps

 2-variables
 3-variables
 4-variables
 5-variables
 Larger K-maps

9
2-variable K-maps

 For 2-variable case (e.g.: variables a,b), the map


can be drawn as:

10
2-variable K-maps
 Alternative layouts of a 2-variable (a, b) K-map
Alternative 1: Alternative 2:
a
b b a
OR OR
a'b a'b m0 m1 a'b ab' m0 m2
' '
a ab a m3 b ab b m1 m3
ab' m2 a'b

Alternative 3:
a a
OR
b ab a'b b m3 m1 and others…
ab' a'b m2 m0
'

11
2-variable K-maps

 Equivalent labeling:

b b
a 0 1
0
equivalent to:
a
1

a a
b 1 0

equivalent to: 0
b
1

12
2-variable K-maps

 The K-map for a function is specified by putting


 a ‘1’ in the square corresponding to a minterm
 a ‘0’ otherwise
 For example: Carry and Sum of a half adder.

b b

0 0 0 1

a 0 1 a 1 0

C = ab S = ab' + a'b

13
Karnaugh Map Methods

The map is filled by placing 1’s in the squares for terms


that lead to a 1 output.
Example (2-variable)
B
A 0 1

0 0 1
Z  A B  AB 
1 1 0
Z=1 for (A,B) = (0,1)  put 1 in box
Z=1 for (A,B) = (1,0)  put 1 in box
put 0 everywhere else.

14
3-variable K-maps

 There are 8 minterms for 3 variables (a, b, c). Therefore, there


are 8 cells in a 3-variable K-map.
b
b
bc
bc
a a 00 01 11 10
00 01 11 10
a'b'c a'b'c a'bc a'bc' 0 m0 m1 m3 m2
0
' OR
a m4 m5 m7 m6
a
1 ab'c' ab'c abc abc' 1

c
c

Above arrangement ensures that minterms Note Gray code sequence


of adjacent cells differ by only ONE literal.
(Other arrangements which satisfy this
criterion may also be used.)

15
3-variable K-maps

 There is wrap-around in the K-map:


 a'.b'.c' (m0) is adjacent to a'.b.c' (m2)
 a.b'.c' (m4) is adjacent to a.b.c' (m6)

bc
a
00 01 11 10
0 m0 m1 m3 m2

m4 m5 m7 m6
1

Each cell in a 3-variable K-map has 3 adjacent neighbours.


In general, each cell in an n-variable K-map has n adjacent
neighbours. For example, m0 has 3 adjacent neighbours:
m1, m2 and m4.

16
Karnaugh Map Methods

E.g.
Z  ABC  A BC  A B C  A B C
BC
A 00 01 11 10

0 0 0 1 0 3 variables
1 1 1 1 0

The top row BC is numbered such that only 1-bit changes at


a time, as you move from box to box
 known as a Gray Code (code where only one bit changes at
a time)
i.e. not numbered as in the usual sequence, but done to
show the relationship between variables.

Karnaugh Map 17
Karnaugh Map Methods

 the main reason

Þ any two squares that are adjacent differ in only one variable

 If two adjacent squares both have an entry of one

 the corresponding product terms differ in only one variable


 the two terms can be merged by eliminating that variable.

Karnaugh Map 18
Karnaugh Map Methods
 Consider a grouping of two of the circled terms which are
adjacent we can see that


A B C  A B C  A B C  C   A B

Can represent these 2 terms by , this is immediately


apparent from the map as for the circled ones :
 is constant = 1
 is constant = 0
 changes and  will not be in the final expression.

Karnaugh Map 19
Karnaugh Map Methods
 Then can form final simplified expression from the minimum
number of circles required to encompass all the ones.

BC
A 00 01 11 10

0 0 0 1 0

minimum expression1 1 1 1 0
we could also include the third circle and thus
Z  A B  BC
but this is not a minimum expression.
 Two loops cover all the ones.
Z  A B  AC  BC

20
4-variable K-maps

 There are 16 cells in a 4-variable (w, x, y, z) K-map.

y
yz
wx 00 01 11 10
00 m0 m1 m3 m2

m4 m5 m7 m6
01
x
m1 m1 m1 m1
11 2 3 5 4
w
m8 m9 m1 m1
10 1 0

21
4-variable K-maps

 There are 2 wrap-arounds: a horizontal wrap-around and a


vertical wrap-around.
 Every cell thus has 4 neighbours. For example, the cell
corresponding to minterm m0 has neighbours m1, m2, m4 and
m8.

yz y
wx
m0 m1 m3 m2

m4 m5 m7 m6
x
m1 m1 m1 m1
w 2 3 5 4
m8 m9 m1 m1
1 0

22
Exercise - Karnaugh Map Methods

Z  A B CD  A B C D  A B C D  A BCD  AB C D  ABCD  A B CD

CD
AB

23
Answer - Karnaugh Map Methods

CD
AB 00 01 11 10

00 0 0 1 0

01 1 1 1 0

11 0 1 1 0

10 0 0 1 0

Z  CD  BD  A B C

24
Karnaugh Map Methods
for which an implementation would be
A A.B.C

B.D

C
C.D
D

One feature should be noted at this point


 The concept of adjacency can be extended to include

wrapping around the edges of the map.


 The maps are considered so that top and bottom edges
and left and right edges are touching.

Karnaugh Map 25
Karnaugh Map Methods

or we could loop the zeros.


CD
AB 00 01 11 10

00 0 0 1 0

01 1 1 1 0

11 0 1 1 0

10 0 0 1 0

Z  CD  C B  AD

Karnaugh Map 26
Karnaugh Map Methods
for which an implementation would be
A

Z
B

Z  C D  C B  AD

  
Z  C  D C  B   A  D 

Karnaugh Map 27
Karnaugh Map Methods
A

B
Z
C

This is equivalent to A

B
Z
C

B Z
C

which is equivalent to our first implementation

Karnaugh Map 28
5-variable K-maps

 Maps of more than 4 variables are more difficult to use


because the geometry (hyper-cube configurations) for
combining adjacent squares becomes more involved.
 For 5 variables, e.g. vwxyz, need 25 = 32 squares.

Karnaugh Map 29
5-variable K-maps
 Organised as two 4-variable K-maps:
v' v
y y
yz yz
wx 00 01 11 10 wx 00 01 11 10
00 m0 m1 m3 m2 00 m1 m1 m1 m1
6 7 9 8
m4 m5 m7 m6 m2 m2 m2 m2
01 01 0 1 3 2
x x
m1 m1 m1 m1 m2 m2 m3 m3
11 2 3 5 4 11 8 9 1 0
w w
m8 m9 m1 m1 m2 m2 m2 m2
10 1 0 10 4 5 7 6

z z

Corresponding squares of each map are adjacent.


Can visualise this as being one 4-variable map on TOP of the
other 4-variable map.

Karnaugh Map 30
Larger K-maps

 6-variable K-map is pushing the limit of human “pattern-


recognition” capability.
 K-maps larger than 6 variables are practically unheard of!
 Normally, a 6-variable K-map is organised as four 4-variable
K-maps, which are mirrored along two axes.

Karnaugh Map 31
Larger K-maps w
b

ef a‘.b' a‘.b ef
cd 00 01 11 10 10 11 01 00 cd

00 m0 m1 m3 m2 m1 m1 m1 m1 00
8 9 7 6
m4 m5 m7 m6 m2 m2 m2 m2
2 3 1 0
01 m1 m1 m1 m1 m3 m3 m2 m2 01
2 3 5 4 0 1 9 8
m8 m9 m1 m1 m2 m2 m2 m2 11
11 1 0 6 7 5 4

10 10
10 m4 m4 m4 m4 m5 m5 m5 m5 10
0 1 3 2 8 9 7 6
m4 m4 m4 m4 m6 m6 m6 m6
a 4 5 7 6 2 3 1 0
m3 m3 m3 m3 m5 m5 m5 m5
11 6 7 9 8 4 5 3 2
11
m3 m3 m3 m3 m5 m5 m4 m4
01 2 3 5 4 0 1 9 8 01
cd cd
00 01 11 10 10 11 01 00 ef
00ef a.b' a.b 00

Try stretch your recognition capability by finding simplest


sum-of-products expression for S m(6,8,14,18,23,25,27,29,41,45,57,61).

Karnaugh Map 32
NAND and NOR Implementations

NAND implementation important, due to Silicon Area


reasons.

NAND can be made to yield AND and OR gates

Þ an AND gate can be formed from 2 NAND gates

and

2-input OR can be formed from 3 NAND gates

Karnaugh Map 33
NAND and NOR Implementations

A
A B A B
B

A A
A

AB

B B
B

Thus a set of NAND’s can thus be used to


make any combinational network by
substituting the above for AND and OR
blocks

Karnaugh Map 34
NAND and NOR Implementations

Same applies for NOR’s


A A. B A+B
B

A A

AB

B B

Karnaugh Map 35
NAND and NOR Implementations

Z  A B C D  A B C D  A B C D  A B C D  A BCD  A BC D  AB C D 
ABCD  ABC D  A B C D  A B C D

CD
AB 00 01 11 10

00 1 1 0 1

01 0 1 1 1

11 0 1 1 1

10 1 1 0 0

Prime implicants and essential prime


implicants (EPI)

Karnaugh Map 36
NAND and NOR Implementations

Minimum expression

Z  B C  C D  BC  A C D eqn (1) SOP

use AND and OR

Karnaugh Map 37
NAND and NOR Implementations
A C D

A
B C

B
Z

C
B C

D
C D

or

Z  B C  BD  BC  A C D

Karnaugh Map 38
NAND and NOR Implementations

Sometimes it is easier to group the zeros terms


together

CD
AB 00 01 11 10

00 1 1 0 1

01 0 1 1 1

11 0 1 1 1

10 1 1 0 0

Z  B C D  A B C  B CD

Karnaugh Map 39
NAND and NOR Implementations

eqn (2)
Z  B C D  A B C  B CD

A B C

B B C D Z

D
B C D

Karnaugh Map 40
NAND and NOR Implementations

Can further arrange

Z  B C D  A B C  B CD
    
Z  B C D  A BC  BC D  eqn (3) POS

use OR and AND A  B C

B
B C  D Z

D
B C  D

Karnaugh Map 41
NAND and NOR Implementations

We can also rearrange Z as follows :

Z  B C D  A B C  B CD
eqn (4) Use NOR
  
Z B C D  A BC  BC D 
A  B C

B
B C  D Z

D
B C  D

Karnaugh Map 42
NAND and NOR Implementations

likewise for sum of products form of Z

Z  B C  C D  BC  A C D

eqn (5) Use NAND


Z  B C  C D  BC  A C D

A C D

A
B C

B
Z

C
B C

D
C D

Karnaugh Map 43
Implementation of Minimum Functions

Observing the function Z, from the last example again

Z  A B C D  A B C D  A B C D  A B C D  A BCD  A BC D  AB C D 
ABCD  ABC D  A B C D  A B C D

To implement Z would require :


· 4 inverters
· 11 quad-input AND gates
· 1 eleven-input OR gate

Thus in general always need to minimise the function

Karnaugh Map 44
Implementation of Minimum Functions

Can implement the minimum Z in Sum of Products


form
i.e. Eqn. 1 .

Can implement the minimum Z in negation of Sum of


Products form
i.e. Eqn. 2

Can implement the minimum Z in Product of Sums


form
i.e. Eqn. 3

Karnaugh Map 45
Implementation of Minimum Functions

By applying deMorgans Laws we can rearrange Z and then


implement it
i.e. Eqn. 4 i.e. inverters & NOR gates

or Egn. 5 i.e. only NAND gates

Can convert between Product-of-Sums to NOR gate


implementation, with the use of 2 inverters.
· between the output of the OR gates and input of the AND gate
· obviously has no effect on the output
· now each OR + NOT  makes it a NOR
and
the NOT’s at the input of the AND makes it a NOR

Karnaugh Map 46
Conversion of POS to NOR Gates

A  B C

B B C  D Z

D
B C  D

  
Z  B C  D A B C B C  D 

Karnaugh Map 47
Don’t Cares
When an output value is term is known for every possible
combination of input variables.
 function said to be completely specified.

However, when output not known for every combination of input


variables (usually because all combinations cannot occur)
 function said to be incompletely specified

The minterms or maxterms that are not used as part of the


output function are called don’t care terms.

Karnaugh Map 48
Quine-McCluskey Method

 The Karnaugh map method is an effective


way to simplify switching functions which
have a small number of variables.
 When the number of variables is large of if
several functions must be simplified, the use
of digital computer is desirable. The Quine-
Mcluskey method is able to deal with it.
It is codeable

Quine-McCluskey 49
Quine-McCluskey Method
 The Quine-McCluskey method reduces the minterm
expansion (standard sum-of-products form) of a function
to obtain a minimum sum of products. The procedure
consists of two main steps:
1. Eliminate as many literals as possible form each term by
systematically applying the theorem XY + XY’ = X. The
resulting terms are called prime implicants.
2. Use a prime implicant chart to select a minimum set of
prime implicants which, when Ored together, are equal to
the function being simplified and which contain a
minimum number of literals.

Quine-McCluskey 50
Step I: Determination of
Prime Implicants
AB`CD` + AB`CD = AB`C
1 0 1 0 + 1 0 1 1 = 101- (the dash indicates a missing variable)
X Y X Y`
A`BC`D + A`BCD` ?
0101+ 0110
Will not combine as two minterms will combine
if they differ in exactly one variable.

Quine-McCluskey 51
FLB 20203
DIGITAL
SYSTEMS Karnaugh Map 52
Step I: Determination of
Prime Implicants
f(a,b,c,d) = ∑ m (0, 1, 2, 5, 6, 7, 8, 9, 10, 14) is represented by
following list of
minterms:
group 0 0 0000
1 0001
group 1 2 0010
In this list, the term in
8 1000
group 0 has zero 1’s,
5 0101 the terms in group 1
group 2 6 0110 have one 1, those in
9 1001 group 2 have two 1’s,
and those in group 3
10 1010 have three 1’s.
group 3 7 0111
14 1110

Quine-McCluskey 53
Step I: Determination of
Prime Implicants
Column I Column II Column III
Group 0 0 0000 0,1 000- 0,1,8,9 -00-
1 0001 0,2 00-0 0,2,8,10 -0-0
Group 1 2 0010 0,8 -000 0,8,1,9 -00-
8 1000 1,5 0-01 0,8,2,10 -0-0
5 0101 1,9 -001 2,6,10,14 --10
Group 2 6 0110 2,6 0-10 2,10,6,14 --10
9 1001 2,10 -010
10 1010 8,9 100-
Group 3 7 0111 8,10 10-0
14 1110 5,7 01-1
6,7 011-
6,14 -110
10,14 1-10

Quine-McCluskey 54
Step I: Determination of
Prime Implicants
Terms which have not been checked off because they
cannot be combined with other terms are called prime
implicants. Because every minterm has been included in at
least one of the prime implicants, the function is equal to the
sum of its prime implicants. In this example we have
f= a`c`d + a`bd + a`bc + b`c` + b`d` + cd`
(1,5) (5,7) (6,7) (0,1,8,9) (0,2,8,10) (2,6,10,14)
In this expression, each term has a minimum number
of literals, but the number of terms is not minimum. Using the
consensus theorem to eliminate redundant terms yields
f = a`bd + b`c` + cd`

Quine-McCluskey 55
Step II: The Prime
Implication Chart (to calculate
essential prime implicants)
0 1 2 5 6 7 8 9 10 14

(0,1,8,9) b`c` x x x x
(0,2,8,10) b`d` x x x x
(2,6,10,14) cd` x x x x
(1,5) a`c`d x x
(5,7) a`bd x x
(6,7) a`bc x x

Quine-McCluskey 56
Step II: The Prime
Implication Chart (essential
prime implicants and the crossed out)
0 1 2 5 6 7 8 9 10 14

(0,1,8,9) b`c` x x x x
(0,2,8,10) b`d` x x x x
(2,6,10,14) cd` x x x x
(1,5) a`c`d x x
(5,7) a`bd x x
(6,7) a`bc x x

If a minterm is covered by only one prime implicant, then the prime implicant is
called essential prime implicant and must be included in the minimum sum of
product.
Essential prime implicants are easy to find using prime implicants chart. If a
given column contains only one X, then the corresponding row is an essential
prime implicant.
f = b`c` + cd` + a`bd

Quine-McCluskey 57
Cyclic Prime Implicant Chart

A prime implicant chart which has two or


more X’s in every column is called a cyclic
prime implicant chart. The following function
has such a chart:

F = ∑ m (0,1,2,5,6,7)

Quine-McCluskey 58
Cyclic Prime Implicant Chart
0 000 0,1 00-
1 001 0,2 0-0
2 010 1,5 -01
5 101 2,6 -10
6 110 5,7 1-1
7 111 6,7 11-

0 1 2 5 6 7
0,1 a`b` x x
0,2 a`c` x x
1,5 b`c x x
2,6 bc` x x
5,7 ac x x
6,7 ab x x

f = a`b` + bc`+ ac

Quine-McCluskey 59
Cyclic Prime Implicant Chart
0 000 0,1 00-
1 001 0,2 0-0
2 010 1,5 -01
5 101 2,6 -10
6 110 5,7 1-1
7 111 6,7 11-

0 1 2 5 6 7
0,1 a`b` x x
 0,2 a`c` x x
 1,5 b`c x x
2,6 bc` x x
5,7 ac x x
 6,7 ab x x

f = a`c` + b`c + ab

Quine-McCluskey 60
Simplification of
Incompletely Specified
Functions
F (A,B,C,D) = ∑m (2,3,7,9,11,13) + ∑d (1,10,15)

1. Terms following d are don’t care terms


2. The don’t care terms are treated like required minterms
when finding the prime implicants
3. The don’t care column are omitted when forming the
prime implicant chart

Quine-McCluskey 61
Refresh Your Mind!
 Find a minterm sum-of-products expression for the following

1. f (a,b,c,d,e) = ∑m (0,2,3,5,7,9,11,13,14,16,18,24,26,28,30)

2. f (a,b,c,d) = ∑m(2,3,4,7,9,11,12,13,14) + ∑d (1,10,15)

3. f (a,b,c,d) = ∑m (0,1,5,6,8,9,11,13) + ∑d (7,10,12)

Programming examples might base on above!!!

Quine-McCluskey 62

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy