SLIDES FOR CHAPTER 5 KARNAUGH MAPS

51
©2010 Cengage Learning SLIDES FOR CHAPTER 5 KARNAUGH MAPS This chapter in the book includes: Objectives Study Guide 5.1 Minimum Forms of Switching Functions 5.2 Two- and Three-Variable Karnaugh Maps 5.3 Four-Variable Karnaugh Maps 5.4 Determination of Minimum Expressions 5.5 Five-Variable Karnaugh Maps 5.6 Other Uses of Karnaugh Maps 5.7 Other Forms of Karnaugh Maps Programmed Exercises Problems

description

This chapter in the book includes: Objectives Study Guide 5.1Minimum Forms of Switching Functions 5.2Two- and Three-Variable Karnaugh Maps 5.3Four-Variable Karnaugh Maps 5.4Determination of Minimum Expressions 5.5Five-Variable Karnaugh Maps 5.6Other Uses of Karnaugh Maps - PowerPoint PPT Presentation

Transcript of SLIDES FOR CHAPTER 5 KARNAUGH MAPS

Page 1: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

SLIDES FOR

CHAPTER 5

KARNAUGH MAPS

This chapter in the book includes:ObjectivesStudy Guide

5.1 Minimum Forms of Switching Functions5.2 Two- and Three-Variable Karnaugh Maps5.3 Four-Variable Karnaugh Maps5.4 Determination of Minimum Expressions5.5 Five-Variable Karnaugh Maps5.6 Other Uses of Karnaugh Maps5.7 Other Forms of Karnaugh Maps

Programmed ExercisesProblems

Page 2: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Karnaugh Maps

Switching functions can generally be simplified by using the

algebraic techniques described in Unit 3. However, two

problems arise when algebraic procedures are used:

1. The procedures are difficult to apply in a systematic way.

2. It is difficult to tell when you have arrived at a minimum solution.

The Karnaugh map method is generally faster and easier to

apply than other simplification methods.

# Karnaugh Map and Quine-McCluskey provide a systematic methods for simply switching function!

Page 3: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Minimum Forms of Switching Functions

Given a minterm expansion, the minimum sum-of-products format can often be obtained by the following procedure:

Unfortunately, the result of this procedure may depend on the order in which the terms are combined or eliminated so that the final expression obtained is not necessarily minimum.

1. Combine terms by using XY′ + XY = X. Do this repeatedly to eliminate as many literals as possible. A given term may be used more than once because X + X = X.

2. Eliminate redundant terms by using the consensus theorem or other theorems.

Page 4: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Minimum Forms of Switching Functions:

* Minimum sum-of-products expression: 不同於 minterm expansion, 主要目的在於表示為一個 tow-level circuit( 以 AND , OR gate 來實現電路 ) ,並使 gate number 和 gate input 之 cost 達最低。

* 對於描述一個 function ,不同於 minterm expansion , 這邊所述之 Minimum sum-of-products expression 不必是唯一。

Page 5: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Example:Find a minimum sum-of-products expression for

None of the terms in the above expression can be eliminated by consensus. However, combining terms in a different way leads directly to a minimum sum of products:

多次使用(X+X=X)

*minimum sum-of-products expression 不必是唯一解

Page 6: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Example:Find a minimum products-of-sum expression for

Using the theorem (X+Y)(X+Y’)=X, to combine terms.Using consensus law: (X+Y)(X’+Z)(Y+Z)= (X+Y)(X’+Z)

( X + Y ) ( X + Y’ )

( Z + X’ ) ( Z + Y ) ( Y + X )

• 由上述兩個 case 可以得知,以 minmum POS 或 minimumSOP來化簡為一 two-level circuit ,雖可以得到化簡,但仍非唯一解。

Page 7: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Just like a truth table, the Karnaugh map of a function specifies the value of the function for every combination of values of the independent variables.

Karnaugh Maps: Two- and Three- Variable Karnaugh Maps(K-maps)

• 在描述 K-maps 時,僅一變數於上列,其餘變數在行。• 下圖為一雙變數之 K-maps 。

Page 8: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

(a)如何描述 K-maps:1.在 maps 填入相對應於 F 的值 其中 1 代表相對應於 F 的一個 minterm 。2. 如同上一章節所述,取 1 的項來描述 F 的 minterm expansion ,其中位元為 0 時, 其文字符號便是一個取補數的變數。3. 相鄰 (adjacent) 之 1 變數,由於僅一位元差異 ,因此可以合併而化簡之。

* Looping the corresponding 1’s on the maps* Adjacent rows differ in only one variable

Page 9: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Karnaugh Map for Three-Variable Function

* The rows are labeled in the sequence 00, 01, 11, 10 so that values in adjacent rows differ in only one variable. ( 請不要跟 truth table 混淆,鄰近項差 一變數可幫助化簡 !)

* Fill the maps from truth table.

Construct the K-map

Page 10: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Location of Minterms on a Three-Variable Karnaugh Map

* Again, the adjacent squares of the map differ in only one variable(including top and bottom rows) and therefore can be combined using the theorem XY’+XY=X.

* 請注意 decimal notation 在 square中之順序

Page 11: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

The adjacent terms in Karnaugh Map

Page 12: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

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

* 如同二變數 K-maps 的建構方式,若以Minterm expansion 描述 function F ,將 F=1 所對應之方格填入 1 ,其餘方格填滿 0 。得到 :F(a, b, c) = m(1, 3, 5)

* 反之,若以 Maxterm expansion 描述function F ,取其對應為 0 的項次。可得 :F(a, b, c) = M(0, 2, 4, 6, 7)

Page 13: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Karnaugh Maps for Product Terms

* You can easily plot a K-maps from a algebraic form. For example, the bc’ is 1 only when b=1 and c=0.

Page 14: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

f(a,b,c) = abc' + b'c + a'Example:

Page 15: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Simplification of a Three-Variable Function (Figure 5-6)

如何藉由 K-maps 來化簡一布林函數 ?

Page 16: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Complement of Map in Figure5-6

The map for the complement of F is formed by replacing 0’s with 1’s and 1’s with 9’s on the map of F.

F′ = c′ + ab

要由 K-maps 取得函數之互補式,可將 0’s 方格取代為 1‘s ,然後再簡化

Page 17: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Karnaugh Maps Which Illustrate the Consensus Theorem

* Ch2~Ch3 所敘述之運算簡化方式,可以完全由 K-maps 來描述跟簡化。 K-maps 中, looping1’s 方格,以最少 loops ,但涵蓋所有 1’s 方格為基礎原則。

( 多餘之 loop)

Page 18: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Function with Two Minimal Forms

不同 looping 方式,獲得不同的 solution ,就如前所述,表示法為不唯一,但皆符合化簡之” cost down” 和” function demand” 之原則。

Different Looping form

Page 19: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

The basic rules to simply function from the K-Maps

1. 將對應於 truth table 中之變數填入 K-maps 中。辨識 function F=0 或 1 , 填入 K-maps 之方格中。2. 圈選 (looping) 方格中 1’s 的位置,找出最少個數的 loops ,但卻足以 包含或函蓋標註為 1’s 的全部方格。如此便可以得出最少乘積項以 加總這些乘積時會有最低的輸入成本。3. 在 looping 時,盡可能使 loops 大一些,以便包含最多的 1’s 方格,其 乘積項可以得到低輸入成本 (input cost)

Page 20: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Location of Minterms onFour-Variable Karnaugh Map

Each minterm is located adjacent to the four terms with which it can combine. For example, m5 (0101) could combine with m1 (0001), m4 (0100), m7 (0111), or m13 (1101).

* 如同三變數 K-maps ,注意項次的在方格中的排列次序 !

Page 21: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Plot of f(a,b,c,d)= acd + a’b + d’

Page 22: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Simplification ofFour-Variable Functions

為何要取上下兩列 ?

Page 23: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Simplification of an Incompletely Specified Function

• The don’t-care minterms are indicated by X’s. • When choosing terms to form the minimum SOP, all the 1’s must• be covered, but the X’s are only used if they will simplify the resulting expression.

Page 24: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Example: Obtainning minimum-SOP from minimum POS

Use a four variable Karnaugh map to find the minimum product of sums for f:

f = x′z′ + wyz + w′y′z′ + x′y

First, we will plot the 1’s on a Karnaugh map.

Page 25: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Figure 5-14

Then, from the 0’s we get:

f ' = y'z + wxz' + w'xy

Finally, we can complement f ' to get a minimum product of sums of f :f = (y + z′)(w′ + x′ + z)(w + x′ + y′)

From DeMorgan’s theorem

Page 26: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Implicants and Prime Implicants

Section 5.4 (p. 136)

Any single 1 or any group of 1’s which can be combined together on a map of the function F represents a product term which is called an implicant(意含項 ) of F.

A product term implicant is called a prime implicant(必要項 ) if it cannot be combined with another term to eliminate a variable.

Page 27: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Implicant

Prime Implicant

Prime Implicant

Prime Implicant

Implicant

Implicant

Page 28: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Determination of All Prime Implicants

Example 01:

Page 29: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Example 02:

Page 30: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Essential Prime Implicants

Section 5.4 (p. 138)

If a minterm is covered by only one prime implicant, that prime implicant is said to be essential, and it must be included in the minimum sum of products.

Essential Prime Implicants

Prime Implicants

Implicants

Page 31: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

以系統化的程序從 K-map 來求出化簡表示式

1.Implicant( 意含項 ): K-maps 中由含有 1 之方格所組合而成的所有 loops 均是意含項。

2.Prime implicant( 必要項 ): 可由 K-maps 中的意含項合併化簡, 使該合併項不再是函數的一個意含項。

3.Essential ( 本質必要項 ): 如果函數的某一個 miniterm 僅包含在 其中一個必要項時。該必要項稱為本質必要項。

Essential

Page 32: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Note: 1’s shaded in blue are covered by only one prime implicant. All other 1’s are covered by at least two prime implicants.

Essential :

* 共有五個必要項,其中有三個本質必要項* 利用本質必要項來化簡 : 因此函數可以由三個本質必要項 (AC’ 、 A’B’D’ 、 ACD) 和一個必要項 (m7)

來獲得 :

Page 33: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

1 1

1 1

1 1 1

1

AB

CD 00 01 11 10

00

01

11

10

Page 34: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Flowchart for Determining a Minimum Sum of Products Using a Karnaugh Map

yes

yes

no

no

Choose a 1 which has not been covered.

Find all adjacent 1’s and X’s.

Are the chosen 1 and its adjacent 1’sand X’s covered by a single term?

That term is an essential prime implicant. Loop it.

All uncovered 1’s checked?

Find a minimum set of prime implicantswhich cover the remaining 1’s on the map.

* Essential term then add the remaining prime implicants

Page 35: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Shaded 1’s are covered by only one prime implicant.

Essential prime implicants:

A′B, AB′D′

Then AC′D covers the remaining 1’s.

Example 01: 透過上述之程序來化簡

Page 36: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Five-Variable Karnaugh Maps

A five-variable map can be constructed in three dimensions by placing one four-variable map on top of a second one. Terms in the bottom layer are numbered 0 through 15 and corresponding terms in the top layer are numbered 16 through 31, so that the terms in the bottom layer contain A' and those in the top layer contain A.

To represent the map in two dimensions, we will divide each square in a four-variable map by a diagonal line and place terms in the bottom layer below the line and terms in the top layer above the line.

Section 5.5 (p. 141)

Page 37: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

1. Note that terms m0 and m20 do not combine because they are in different layers and different columns (they differ in two variables).

2. Each term can be adjacent to exactly five other terms, 5 in the same layer, 1 in other layer.

Page 38: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Simply a five-variable K-maps

Page 39: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Figure 5-22

Each term can be adjacent to exactly five other terms: four in the same layer and one in the other layer.

How to loop the terms?

Page 40: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

When checking for adjacencies, each term should be checked against the five possible adjacent squares.

P1 and P2 are essential prime implicants.

Example 01: F(A, B,C,D,E)=m(0,1,4,5,13,15,20,21,22,23,24,26,28,30,31)

1. 本 K-maps 共有 6 個必要項,其中 2 個為本質必要項。2. 先處理 Essential(P1,P2), 在處理 Prime implicants(P3,P4) ,最後補上剩餘兩項次

Page 41: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

F(A, B, C, D, E) = Ʃ m(0, 1, 3, 8, 9, 14, 15, 16, 17, 19, 25, 27, 31)

P1, P2, P3, and P4 are essential prime implicants.

Example 02:

Page 42: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Figure 5-25

Using a Karnaugh map to facilitate factoring, we see that the two terms in the first column have A′B′ in common; the two terms in the lower right corner have AC in common.

Page 43: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

F = ABCD + B’CDE + A’B’ + BCE’

We can use a Karnaugh map for guidance in algebraic simplification. From Figure 5-26, we can add the term ACDE by the consensus theorem and then eliminate ABCD and B’CDE.

Page 44: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Figure 5-26

Page 45: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Other Forms of Karnaugh Maps

Instead of labeling the sides of a Karnaugh map with 0’s and 1’s, some people prefer to use Veitch diagrams. In Veitch diagrams, A = 1 for the half of the map labeled A, and A = 0 for the other half. The other variables have a similar interpretation.

Section 5.7 (p. 146)

Page 46: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Figure 5-27: Veitch Diagrams

Page 47: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Two alternative forms of five-variable maps are also used. One form simply consists of two four-variable maps side-by-side.

A modification of this uses a mirror image map. In this map, first and eighth columns are “adjacent” as are second and seventh columns, third and sixth columns, and fourth and fifth columns.

Page 48: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Figure 5-28: Side-by-side Form of Five-Variable Karnaugh Maps

Page 49: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

Figure 5-28: Mirror Image Form of Five-Variable Karnaugh Maps

Page 50: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

通常超過六變數後的 K-Maps ,較依賴人的經驗法則,因此不易執行電腦程序的標準運算,因此當變數過多時,通常會使用 Quine-McCluskey method 來幫助化簡。

Page 51: SLIDES FOR CHAPTER 5 KARNAUGH MAPS

©2010 Cengage Learning

HW Ch55.8 (a) (c)5.9(a)5.135.23(a)-(d)5.275.34( 取消 )