You are on page 1of 28

Switching Circuits & Logic Design

Karnaugh Maps
Professor Chien-Mo James Li
Graduate Institute of Electronics Engineering
National Taiwan University
Logic Design

NTUEE C.M. Li

Review Questions
What is minterm? What is maxterm?
What is full adder? Show the truth table of a full adder
What is dont care X?

Logic Design

NTUEE C.M. Li

Problems with Algebraic Procedures


1. difficult to apply in a systematic way
2. difficult to tell if final answer is minimum solution

NTUEE C.M. Li

Logic Design

Objective of this Chapter


How to simplify Boolean expressions with the help of Karnaugh
maps
Very useful with 3 to 5 variables

Next chapter (Quine-McCluskey)

Useful for more than 5 variables

Both K-map and QM methods

Systematic

Logic Design

NTUEE C.M. Li

Maurice Karnaugh (USA)


The Karnaugh map (K-map for short) was invented by Maurice
Karnaugh, a telecommunications engineer at Bell Labs. It is a very
useful tool to facilitate Boolean algebraic expressions.

Maurice Karnaugh, The Map Method for Synthesis of Combinational


Logic Circuits, Trans. AIEE. pt I, 72(9):593-599, November 1953.

http://www.nationmaster.com/encyclopedia/Karnaugh-map

Logic Design

NTUEE C.M. Li

Outline

Minimum Forms of Switching Functions.


Two- and Three-Variable Karnaugh Maps.
Four-Variable Karnaugh Maps.
Determination of Minimum Expressions Using Essential Prime
Implicants.
Five-Variable Karnaugh Maps.
Other Uses of Karnaugh Maps.
Other Forms of Karnaugh Maps.

Logic Design

NTUEE C.M. Li

Minimum SOP
Minimum SOP expression for a function is defined as a SOP terms
which
1. has a minimum number of terms, and
2. of all those expressions which have the same minimum
number of terms, has a minimum number of literals

In circuits, minimum SOP corresponds to a minimum two-level gate


circuit with
Minimum number of gates and
minimum number of inputs

NOTE: minimum SOP is NOT unique

unlike minterm expansion, which is unique

NTUEE C.M. Li

Logic Design

Orders Matters
The order you apply theorems may determine the simplification
results

Example

P128.
(eq 5-1) NOT minimum SOP

(eq 5-2) minimum SOP

Algebraic simplification is not systematic way


Logic Design

NTUEE C.M. Li

Minimum POS
A POS terms which

1. has a minimum number of factors, and


2. of all those expressions which have the same number of
factors, has a minimum number of literals

NOTE: minimum POS is not unique

unlike maxterm expansion

Exercise: Example P.128

Logic Design

NTUEE C.M. Li

Outline

Minimum Forms of Switching Functions.


Two- and Three-Variable Karnaugh Maps.
Four-Variable Karnaugh Maps.
Determination of Minimum Expressions Using Essential Prime
Implicants.
Five-Variable Karnaugh Maps.
Other Uses of Karnaugh Maps.
Other Forms of Karnaugh Maps.

Logic Design

NTUEE C.M. Li

10

Karnaugh Map of 2 variables


One variable listed across top

The other variable listed on left


Each cell correspond to a pair of values
NOTE: adjacent squares differ in only one variable

Logic Design

11

NTUEE C.M. Li

2-variable K Map
Each 1 in K-map corresponds to a minterm of F
Minterms in adjacent squares can be combined since they differ in

only one variable


Example Fig 5-1
XY+XY=X

Fig. 5-1

Logic Design

NTUEE C.M. Li

12

3-variable K Map
Adjacent squares differ in only one variable
Example Fig 5-2
ABC

000

001

010

011

100

101

110

111

Logic Design

NTUEE C.M. Li

13

Adjacency on K Map
Fig. 5-3

011 is adjacent to 001, 010, 111


100 is adjacent to 000, 101, 110

Logic Design

NTUEE C.M. Li

14

Location of Minterms on K Map


Fig 5-3

NTUEE C.M. Li

Logic Design

15

From Minterm to K Map


Given minterm expansion,

Place 1s in square which corresponds to minterm of F


Place 0s in the other squares

Example Fig 5-4

F = m (1,3,5)

Logic Design

NTUEE C.M. Li

16

From Maxterm to K Map


Given maxterm expansion,

Place 0s in squares which corresponds to maxterm of F


Place 1s in the other squares

Example Fig 5-4

F = M (0,2,4,6,7)

Logic Design

NTUEE C.M. Li

17

Product Terms on K Map


Fig 5-5

Term b has 4 squares


Term bc has 2 squares
Term ac has two squares

Logic Design

NTUEE C.M. Li

18

Plot Boolean Expression on K-Map


No need to do minterm expansion
Example: p.131

f(a.b.c) =abc+bc+a

NTUEE C.M. Li

Logic Design

19

Simplification in K Map
Fig 5-6
XY+XY=X

Loop adjacent squares

Logic Design

NTUEE C.M. Li

20

Complement in K Map
Exchange 0s and 1s
Fig 5-7 = complement of Fig 5-6

Note top and bottom rows can be grouped into c

Logic Design

NTUEE C.M. Li

21

Consensus Theorem in K Map


XY+XZ+YZ=XY+XZ
Fig 5-8

Logic Design

NTUEE C.M. Li

22

Minimum SOP
Fig 5-9
A function can have two or more minimum SOP

Same number of terms, same number of literals


Minimum SOP is NOT unique

Logic Design

NTUEE C.M. Li

23

Outline

Minimum Forms of Switching Functions.


Two- and Three-Variable Karnaugh Maps.
Four-Variable Karnaugh Maps.
Determination of Minimum Expressions Using Essential Prime
Implicants.
Five-Variable Karnaugh Maps.
Other Uses of Karnaugh Maps.
Other Forms of Karnaugh Maps.

Logic Design

NTUEE C.M. Li

24

Four-Variable K Map

Adjacent squares differ by one variable


Top and bottom rows are adjacent
Leftmost and rightmost columns are adjacent
Fig 5-10

Logic Design

NTUEE C.M. Li

25

Simplification
Example: f (a,b,c,d) = acd+ab+d
Fig 5-11

Logic Design

NTUEE C.M. Li

26

Minterms
Fig 5-12

Note that four corners can be combined

Logic Design

NTUEE C.M. Li

27

Dont Cares
When choosing terms form the minimum sum of products, all 1s

MUST be covered
But X are only used if they will simplify the resulting expression
Fig 5-13

Logic Design

NTUEE C.M. Li

28

Question
Why not red circles?

Fig. 5-13
NTUEE C.M. Li

Logic Design

29

Minimum POS
Steps:

Draw K map of f
Looping zeros on a map of f obtain a minimum SOP of f
Take complement of f obtain a minimum POS of f
Example:
f = xz +wyz+wyz+xy
Fig 5-14

Very useful for exam!

Logic Design

NTUEE C.M. Li

30

Outline

Minimum Forms of Switching Functions.


Two- and Three-Variable Karnaugh Maps.
Four-Variable Karnaugh Maps.
Determination of Minimum Expressions Using Essential Prime
Implicants.
Five-Variable Karnaugh Maps.
Other Uses of Karnaugh Maps.
Other Forms of Karnaugh Maps.

Logic Design

NTUEE C.M. Li

31

Implicant
Implicant

Any single 1 or any group of 1s which can be combined together


on a map of function F represents a product term which is called
an Implicant of F
See Ch 6 for more formal definition

Prime Implicant

A product term Implicant that cannot be combined with another


terms

Logic Design

NTUEE C.M. Li

32

Example
Fig 5-15

ac abc acd are prime implicants


abcd abc abc are NOT prime implicants
Q: why?

Logic Design

NTUEE C.M. Li

33

Minimum SOP and PI


Minimum SOP expression of a function consists of ONLY prime

implicants of a function
No none-prime implicants
Because none-prime implicants can be combined with other
terms
NOTE: not all prime implicants are necessarily needed
Fig 5-16: 6 PI ; only 3 needed for minimum SOP

Logic Design

NTUEE C.M. Li

34

More about PI
Notice: bcd is PI even though both 1s are covered by other PI
Notice: dont care treated like 1 in finding PI

But PI composed entirely of Xs are not part of minimum SOP


Fig 5-16

Logic Design

NTUEE C.M. Li

35

Order of Choosing PI Matters


Fig 5-17

(a) 4 terms if CD chosen


(b) 3 terms if CD not chosen

Logic Design

NTUEE C.M. Li

36

Distinguished 1-cell *not in textbook


A minterm that is covered by only one prime implicant
example

m2 is distinguished 1-cell
m3 is not

Fig. 5-17
NTUEE C.M. Li

Logic Design

37

Essential Prime Implicant


Definition

The prime implicant that contains a distinguished 1-cell


Example
BC BD AC are EPI
CD is not
EPI MUST be included in minimum SOP

Fig. 5-17
Logic Design

NTUEE C.M. Li

38

How to find EPI?


If a minterm and all its adjacent 1s are all covered by a single term

Then that term is EPI


Otherwise
That term can be EPI or none EPI

Logic Design

NTUEE C.M. Li

39

Example
Fig 5-18

Three EPI: ACD, AC, ABD

Logic Design

NTUEE C.M. Li

40

Flow Chart to Find Minimum SOP


Fig 5-19

Logic Design

41

NTUEE C.M. Li

Example of the Flow


14 15 are not sure. 16 is distinguish-1-cell

choose EPI: 16 (AB)


18 19 are not sure. 110 is distinguish-1-cell
choose EPI: 110 (ABD)
finally choose ACD

Fig. 5-20
Logic Design

NTUEE C.M. Li

42

Outline

Minimum Forms of Switching Functions.


Two- and Three-Variable Karnaugh Maps.
Four-Variable Karnaugh Maps.
Determination of Minimum Expressions Using Essential Prime
Implicants.
Five-Variable Karnaugh Maps.
Other Uses of Karnaugh Maps.
Other Forms of Karnaugh Maps.

NTUEE C.M. Li

Logic Design

43

Five-Variable K Map
Two dimensional K map

Every cell has five neighbors

Fig. 5-21
Logic Design

NTUEE C.M. Li

44

Simplification Example
First choose EPI P1, P2
Then choose PI P3, P4
Finally add either ABC or BCD

Fig. 5-23
Logic Design

NTUEE C.M. Li

45

Another Example
Fig 5-24

Logic Design

NTUEE C.M. Li

46

Outline

Minimum Forms of Switching Functions.


Two- and Three-Variable Karnaugh Maps.
Four-Variable Karnaugh Maps.
Determination of Minimum Expressions Using Essential Prime
Implicants.
Five-Variable Karnaugh Maps.
Other Uses of Karnaugh Maps.
Other Forms of Karnaugh Maps.

Logic Design

NTUEE C.M. Li

47

Applications of K map
Prove two Boolean Expressions are the same
AND/OR of two Boolean expressions
Factoring

Fig 5-25
Help algebra simplification of Boolean (CHEAT!)

Logic Design

NTUEE C.M. Li

48

Factoring
Given m(0, 1, 3, 10, 14, 15), please factor it into POS

Fig. 5-25
Logic Design

NTUEE C.M. Li

49

Cheating !
Fig 5-26 Consensus theorem

Logic Design

NTUEE C.M. Li

50

Outline

Minimum Forms of Switching Functions.


Two- and Three-Variable Karnaugh Maps.
Four-Variable Karnaugh Maps.
Determination of Minimum Expressions Using Essential Prime
Implicants.
Five-Variable Karnaugh Maps.
Other Uses of Karnaugh Maps.
Other Forms of Karnaugh Maps.

Logic Design

NTUEE C.M. Li

51

Veitch Diagram
Essentially the same as K map

Fig. 5-27
Logic Design

NTUEE C.M. Li

52

5-variable K Map
Make 2D into two 1D

Fig. 5-28

NTUEE C.M. Li

Logic Design

53

Next Time

ch 1 Introduction Number Systems


and Conversion
ch 2 Boolean Algebra
ch 3 Boolean Algebra (contd)
holiday no class
ch 4. Application of Boolean Algebra
ch 5 Karnaugh Maps
ch 7 Multi-Level Gate Circuits;
NAND NOR Gates
ch 8 Combinational Ckt Design
Midterm

Logic Design

NTUEE C.M. Li

54

Visualize Equation by Kmap *Not in textbook


XY+XZ=(X+X)(X+Z)(X+Y)(Y+Z) = (X+Z)(X+Y) eq3.3
x=0

x=1

yz=00

yz=01

yz=11

yz=10
Logic Design

1
1
NTUEE C.M. Li

55

You might also like