unit 5 karnaugh map - national chiao tung universitymoblie123.cm.nctu.edu.tw/101 logical design/unit...

37
Department of Communication Engineering, NCTU 1 Unit 5 Karnaugh Map

Upload: lamque

Post on 22-Mar-2018

225 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 1

Unit 5 Karnaugh Map

Page 2: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 2

5.1 Minimum Form of SwitchingFunctions

Page 3: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 3

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Switching functions can generally be simplified by usingBoolean algebraic techniques

Two problems arise when algebraic procedures are used The procedures are difficult to apply in a systematic way Difficult to tell when a minimum solution is arrived

Remedies systematic way for circuit simplifications Karnaugh map method (for small number of variables) Quine-McCluskey method (for large combinational network)

Page 4: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 4

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Karnaugh map techniques lead directly to minimum costtwo-level circuits which are categorized into two classes Sum-of-products: a group of AND gates feed a OR gate Product-of-sums: a group of OR gates feed a AND gate

A minimum sum-of-products (SOP) expression for afunction is defined as a sum of products which has A minimum number of terms A minimum number of literals of all those expressions

which have the same minimum number of terms

The min SOP corresponds directly to a circuit that has A minimum number of gates A minimum number of gate inputs

Page 5: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 5

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Given a midterm expansion, the min SOP form can oftenbe obtained by the following procedures Combine terms by repeatedly applying XY'+XY=X Eliminate redundant terms by using the consensus theorem

or other theorems

E.g.

Page 6: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 6

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

A minimum product-of-sums (POS) expression is definedas a POS which has A minimum number of factors A minimum number of literals of all those expressions

which have the same minimum number of factors

Given a maxterm expansion, the min POS can often beobtained by combining terms using (X+Y)(X+Y') = X

Page 7: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 7

5.2 Two- and Three-VariableKarnaugh Maps

Page 8: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 8

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

The Karnaugh map of a function specifies the value of thefunction for every combination of values of theindependent variables

A two-variable Karnaugh map

Page 9: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 9

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Fig. 5-1 shows the truth table for a function F and thecorresponding Karnaugh map

Each entry of a Karnaugh map is a minterm We can read the minterms from the map just like we can

read them from the truth table

Page 10: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 10

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Fig. 3 shows a 3-variable truth table and thecorresponding Karnaugh map

Page 11: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 11

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Fig. 5-3 shows the location of the minterms on a three-variable map(a) binary notation (b) decimal notation

Page 12: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 12

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

A map can be obtained by placing 1’s in the squareswhich correspond to the minterms of F, or by placing 0’sin the squares which correspond to the maxterms of F

Fig. 5-4 shows the plot of

( , , ) (1,3,5) (0, 2, 4,6,7)F a b c m M

Page 13: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 13

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Fig. 5-5 illustrates how product terms can be plotted onKarnaugh maps E.g. b’c is 1 when b=1 or c=0, so 1’s are entered in the two

squares in the bc=10 row

Page 14: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 14

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

It is unnecessary to expand a function to its minterm formbefore plotting it on a map.

E.g.

Page 15: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 15

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Terms which differ in only one variable in adjacentsquares on the map can be combined using the theoremXY’+XY=X

E.g.

Page 16: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 16

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

The Karnaugh map can also illustrate the basic theoremsof Boolean algebra

Fig. 5-8 illustrates the consensus theoremxy+x’z+yz=xy+x’z

Page 17: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 17

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

If a function has two or more min SOP forms, all of theseforms can be determined from a map

E.g.

Page 18: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 18

5.3 Four-Variable Karnaugh Maps

Page 19: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 19

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

The location of minterms on a 4-variable map

Page 20: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 20

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

ExampleThe Karnaugh map of f(a,b,c,d) = acd+a‘b+d’

Page 21: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 21

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

The simplification of a 4-variable expression on a map Minterms are combined in groups of two, four, or eight

Page 22: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 22

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Don’t care minterms are indicated by X’s X’s are only used in they will simplify the resulting

expression

Page 23: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 23

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

A minimum product of sums (POS) for f’can bedetermined by looping the 0’s on a map of f

The complement of the min SOP for f’is then the minPOS for f

f '=y'z+wxz'+w'xyf =(y+z')(w'+x'+z)(w+x'+y')

Page 24: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 24

5.4 Determination of MinimumExpressions Using Essential Prime

Implicants

Page 25: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 25

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

A single 1 or any group of 1’s which can be combinedtogether on a map of the function F represents a productterm which is called an implicant of F

A product implicant is called a prime implicant if itcannot be combined with other term to eliminate avariable

Page 26: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 26

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

E.g. In Fig. 5-15, a‘b’c, a‘cd‘及 ac‘are prime implicants.On the other hand, ab'c', abc', a'b'c'd‘are not

Page 27: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 27

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

A SOP expression containing a term which is not a primeimplicant cannot be minimum

Because all of the prime implicants of a function aregenerally not needed in forming the minimum SOP, asystematic procedure for selecting prime implicants isneeded

If a minterm is covered by only one prime implicant, thatprime implicant is said to be essential, and it must beincluded in the minimum SOP

Page 28: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 28

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

If the given minterm and all of the 1’s adjacent to it arecovered by a single term, then that term is an essentialprime implicant

Page 29: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 29

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Flow chart fordetermining aminimum SOP usinga Karnaugh Map

Page 30: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 30

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

If a don’t care minterm is present Do not check it to see if it is covered by one or more

implicants When checking a 1 for adjacent 1’s, treat the adjacent don’t

cares as if they were 1’s

Page 31: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 31

5.5 Five-Variable Karnaugh Maps

Page 32: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 32

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

A five-variable map can be constructed in 3 dimensionsby placing one four-variable map on top of a second one Terms in the bottom layer are numbered 0 through 15 Terms in the top layer are numbered 16 through 31 Terms in the top or bottom layer combine just like terms on

a four-variable map Two terms in the same square of the top and bottom layers

can be combined Each term can be adjacent to exactly five other terms, four

in the same layer and one in the same square of the otherlayer

Page 33: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 33

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Page 34: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 34

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

When checking for adjacencies, each term should bechecked against the five possible adjacent squares

E.g.

m0 P1 , m8 P3 1 2 3 4p p p p

AB CF or

B CDACD A BCEA B D ABE

Page 35: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 35

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

E.g. m16 P1 , m3 P2 , m8 P3 , m14 P4

51 2 3 4 pp p p p

C D EF or

AC EB C D B C E A C D A BCD ABDE

Page 36: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 36

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Apply consensus theorem in Karnaugh maps Add redundant terms by using the consensus theorem Eliminate terms again using the consensus theorem

E.g. F=ABCD+B'CDE+A'B'+BCE'

F=A'B'+BCE'+ACDE

Page 37: Unit 5 Karnaugh Map - National Chiao Tung Universitymoblie123.cm.nctu.edu.tw/101 logical design/Unit 05.pdf ·  · 2011-10-17... NCTU 6 Logic Design Unit 5 Karnaugh Map Sau-Hsuan

Department of Communication Engineering, NCTU 37

Logic Design Unit 5 Karnaugh Map Sau-Hsuan Wu

Two alternative forms for five-variable Karnaugh Maps

Two maps side-by-side One is the mirror image of another