chapter 3 simplification of switching functions. simplification goals goal -- minimize the cost of...

Post on 20-Dec-2015

228 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Chapter 3Simplification of Switching Functions

Simplification Goals

• Goal -- minimize the cost of realizing a switching function

• Cost measures and other considerations– Number of gates

– Number of levels

– Gate fan in and/or fan out

– Interconnection complexity

– Preventing hazards

• Two-level realizations– Minimize the number of gates (terms in switching function)

– Minimize the fan in (literals in switching function)

Example 3.1

g(A,B,C) = AB + A B + AC

Determine the form and the number of terms and literals in each of the following.

Two-level form, three products , two sums, six literals.

f(X,Y,Z) = X Y(Z + Y X) + Y Z

Four-level form, four products, two sums, seven literals.

--------------------

Minimization Methods

• Commonly used techniques– Boolean algebra postulates and theorems

– Karnaugh maps

– Quine-McCluskey method

– Petrick’s method

– Generalized concensus algorithm

• Characteristics– Heuristics (suboptimal)

– Algorithms (optimal)

Minimum SOP and POS Representations

• The minimum sum of products (MSOP) of a function, f, is a SOP representation of f that contains the fewest number of product terms and fewest number of literals of any SOP representation of f.

• Example -- f(a,b,c,d) = m(3,7,11,12,13,14,15) = ab + acd + acd = ab + cd

• The minimum product of sums (MPOS) of a function, f, is a POS representation of f that contains the fewest number of sum terms and the fewest number of literals of any POS representation of f.

• Example -- f(a,b,c,d) = M(0,1,2,4,5,6,8,9,10) = (a + c)(a + d)(a + b + d)(b + c + d) = (a +c)(a + d)(b + c)(b + d)

Karnaugh Maps

• Karnaugh maps (K-maps) -- convenient tool for representing switching functions of up to six variables.

• K-maps form the basis of useful heuristics for finding MSOP and MPOS representations.

• An n-variable K-map has 2n cells with each cell corresponding to a row of an n-variable truth table.

• K-map cells are labeled with the corresponding truth-table row.

• K-map cells are arranged such that adjacent cells correspond to truth rows that differ in only one bit position (logical adjacency).

• Switching functions are mapped (or plotted) by placing the function’s value (0,1,d) in each cell of the map.

Figure 3.1 Venn diagram and equivalent K-mapfor two variables

(d )

A B f(A B )

m

0

m

2

m

1

m

3

A

B

0 2

1 3

A

B

B

A

0 2

1 3

(a ) (b ) (c )

(e ) ( f)

B

A

0 2

1 3

(g )

0 1

0

1

0 0

0 1

1 0

1 1

BA B

A

B

A

A B A B A Bm

2

m

1

m

3

A Bm

0

0 1

0

1

Figure 3.2 Venn diagram and equivalent K-mapfor three variables

m 0

B

m 2 m 6

m 1 m 3 m 7 m 5

0 2 6 4

1 3 7 5

B

A

A B

C

A B

(a )

(d )

A B C

A B C A B CA B C

A B C m 0m 1

m 2

m 3

m 4

m 5

m 6m 7

m 4

C

A

C

C

A B

0 2 6 4

1 3 7 5

0 0 0 1 1 1 1 0

0

1

C

A B C

A B C

A B C

C

A B

(b ) (c )

(e ) ( f)

Figure 3.3 (a) -- (d) K-maps for four and five variables

C D

A B

00 01 11 100 4 1 2 8

1 5 1 3 9

3 7 1 5 1 1

2 6 1 4 1 0

00

01

11

10

0 4 1 2 8

1 5 1 3 9

3 7 1 5 1 1

2 7 1 4 1 0

B

D

D E

A B C

000 001 011 0100 4 1 2 8

1 5 1 3 9

3 7 1 5 1 1

2 6 1 4 1 0

00

01

11

10

100 101 111 1101 6 2 0 2 8 2 4

1 7 2 1 2 9 2 5

1 9 2 3 2 7

1 8 2 2 3 0 2 6

0 4 1 2 8

1 5 1 3 9

3 7 1 5 1 1

2 6 1 4 1 0

C

D

B

A

C

1 6 2 0 2 8 2 4

1 7 2 1 2 9 2 5

1 9 2 3 3 1 2 7

1 8 2 2 3 0 2 6

B

C

A

E

(a) (b)

(c) (d)

Figure 3.3 (e) -- (f) K-maps for six variables

(e ) ( f)

A E F

B C D

000 001 011 0100 4 1 2 8

1 5 1 3 9

3 7 1 5 1 1

2 6 1 4 1 0

000

001

011

010

100 101 111 1101 6 2 0 2 8 2 4

1 7 2 1 2 9 2 5

1 9 2 3 3 1 2 7

1 8 2 2 3 0 2 6

3 2 3 6 4 4 4 0

3 3 3 7 4 5 4 1

3 5 3 9 4 7 4 3

3 4 3 8 4 6 4 2

100

101

111

110

4 8 5 2 6 0 5 6

4 9 5 3 6 1 5 7

5 1 5 5 6 3 5 9

5 0 5 4 6 2 5 8

0 4 1 2 8

1 5 1 3 9

3 7 1 5 1 1

2 6 1 4 1 0E

C C

B

3 2 3 6 4 4 4 0

3 3 3 7 4 5 4 1

3 5 3 9 4 7 4 3

3 4 3 8 4 6 4 2

D

E

D

4 8 5 2 6 0 5 6

4 9 5 3 6 1 5 7

5 1 5 5 6 3 5 9

5 0 5 4 6 2 5 8

1 6 2 0 2 8 2 4

1 7 2 1 2 9 2 5

1 9 2 3 3 1 2 7

1 8 2 2 3 0 2 6

F

FA

Plotting (Mapping) Functions in Canonical Form on a K-map

• Let f be a switching function of n variables where n 6.

• Assume that the cells of the K-map are numbered from 0 to 2n where the numbers correspond to the rows of the truth table of f.

• If mi is a minterm of f, then place a 1 in cell i of the K-map.

• Example -- f(A,B,C) = m(0,3,5)

• If Mi is a maxterm of f, then place a 0 in cell i.

• Example -- f(A,B,C) = M(1,2,4,6,7)

• If di is a don’t care of f, then place a d in cell i.

Figure 3.4 Plotting functions on K-maps

B

C

AC

A B

1

0 0 0 1 1 1 1 00 2 6 4

1 3 7 5

0

1

B

0 0 0

0 1 0 1C

A

C

A B

0 0 0 1 1 1 1 00 2 6 4

1 3 7 5

0

1

B

0 0 0

0 0C

A

C

A B

1

0 0 0 1 1 1 1 00 2 6 4

1 3 7 5

0

1 1 1C

A

B

(a ) (b )

(c ) (d )

f(A,B,C) = m(0,3,5) = M(1,2,4,6,7)

Figure 3.5 K-maps for f(a,b,Q,G) in Example 3.4(a) Minterm form. (b) Maxterm form.

QG

a b

1

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

b

G

1

1 1

1 1 1 1

1 1

a

Q

QG

a b

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

b

G

0 0

a

Q

0 0

0 0

(a ) (b )

f(a,b,Q,G) = m(0,3,5,7,10,11,12,13,14,15) = M(1,2,4,6,8,9)

Figure 3.6 K-map of Figure 3.5(a) with variables reordered: f(Q,G,b,a).

b a

QG

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

G

a

1 1

Q

b

1 1

1 1

1 1 1 1

f(Q,G,b,a) = m(0,12,6,14,9,13,3,7,11,15) = m(0,3,6,7,9,11,12,13,14,15)

Plotting Functions in Algebraic Form

• Example 3.6 -- f(A,B,C) = AB + BC

• Example 3.7 -- f(A,B,C,D) = (A + C)(B + C)(B + C + D)

• Example 3.8 -- f(A,B,C,D)= (A+B)(A+C+D)(B+C+D)

Figure 3.7 -- Example 3.6. (a) Venn diagram form. (b) Sum of minterms. (c) Maxterms.

C

A B

0 0 0 1 1 1 1 00 2 6 4

1 3 7 5

0

1

B

0

0C

A

C

A B

0 0 0 1 1 1 1 00 2 6 4

1 3 7 5

0

1C

A

B

(b ) (c )

U n iv e rsa l se t

B C

A

B A B

A B

C

B C

1 1

1 0

0

(a )

0

f(A,B,C) = AB + BC

Figure 3.8 -- Example 3.7. (a) Maxterms, (b) Minterms, (c) Minterms of f .

C D

A B

0

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

0 0

0 0 0

0 0

C

A(A + C )

(B + C + D )

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1

1

1 1 1 1

1 1

C

A

(a ) (b )

C D

A B

1

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1 1

1 1 1

1 1

C

AA C

B C D

(B + C )

B C

(c)

f(A,B,C,D) = (A + C)(B + C)(B + C + D)

Figure 3.9 -- Example 3.8.(a) K-map of f, (b) K-map of f.

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1

1

1 1

1

A

C

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1 1

A

C

1 1

1

(a ) (b )

1

1

1

1

1

1

f(A,B,C,D)= (A+B)(A+C+D)(B+C+D)

Simplification of Switching FunctionsUsing K-maps

• K-map cells that are physically adjacent are also logically adjacent. Also, cells on an edge of a K-map are logically adjacent to cells on the opposite edge of the map.

• If two logically adjacent cells both contain logical 1s, the two cells can be combined to eliminate the variable that has value 1 in one cell’s label and value 0 in the other.

• This is equivalent to the algebraic operation, aP + aP =P where P is a product term not containing a or a.

• Example -- f(A,B,C,D) = m(1,2,4,6,9)

Figure 3.10 K-map for Example 3.9

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1

1 1

1 1

A

C

S tep 2

S tep 1

S tep 3

f(A,B,C,D) = m(1,2,4,6,9)

Simplification Guidelines for K-maps

• Each cell of an n-variable K-map has n logically adjacent cells.

• Cells may be combined in groups of 2,4,8,…,2k.

• A group of cells can be combined only if all cells in the group have the same value for some set of variables.

• Always combine as many cells in a group as possible. This will result in the fewest number of literals in the term that represents the group.

• Make as few groupings as possible to cover all minterms. This will result in the fewest product terms.

• Always begin with the “loneliest” cells.

Prime Implicants and Covers

• An implicant is a product term that can cover minterms of a function.

• A prime implicant is a product term that is not covered by another implicant of the function.

• An essential prime implicant is a prime implicant that covers at least one minterm that is not covered by any other prime implicant.

• A set of implicants is said to be a cover of a function if each minterm of the function is covered by at least one implicant in the set.

• A minimal cover is a cover that contains the smallest number of prime implicants and the smallest number of literals..

Figure 3.11 K-map illustrating implicants

1

C

A B

0 0 0 1 1 1 1 00 2 6 4

3 7 5

0

1

B

1 1

1 1 1

A

C

Minterms: {AB C, A BC, A BC, ABC, ABC}

Groups of two minterms: {A B, AB, A C, BC, BC}

Groups of four minterms: {B}

Prime implicants: {A C, B}Cover = {A C, B}

MSOP = A C + B

Algorithm 3.1 -- Generating and SelectingPrime Implicants

1. Count the number of adjacencies for each minterm on the K-map.

2. Select an uncovered minterm with the fewest number of adjacencies. Make an arbitrary choice if more than one choice is possible.

3. Generate a prime implicant for this minterm and put it in the cover. If this minterm is covered by more than one prime implicant, select the one that covers the most uncovered minterms.

4. Repeat steps 2 and 3 until all minterms have been covered.

Figure 3.12 -- Example 3.10(Illustrating Algorithm 3.1)

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1

A

C

1 1

(a ) (b )

1

1

1

1 1

1 1

1 1

1 1

1 1 1

1

1 1

11 1

1

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1

A

C

1 1

(c) (d )

1

1

1

1 1

1 1

1 1

1 1

1 1 1

1

1 1

11 1

1

f(A,B,C,D) = m(2,3,4,5,7,8,10,13,15)

Algorithm 3.2 -- Generating and SelectingPrime Implicants (Revisited)

1. Circle all prime implicants on the K-map.

2. Identify and select all essential prime implicants for the cover.

3. Select a minimum subset of the remaining prime implicants to complete the cover, that is, to cover those minterms not covered by the essential prime implicants.

Figure 3.13 -- Example 3.11(Illustrates Algorithm 3.2)

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1

A

C

1 1

(a ) (b )

1

1

1

1 1

1 1

1 1

1 1

1 1 1

1

1 1

11 1

1

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

1 1

1 1

1 1

1 1

1

(c)

f(A,B,C,D) = m(2,3,4,5,7,8,10,13,15)

Figure 3.14 -- Example 3.12

f(A,B,C,D) = m(0,5,7,8,10,12,14,15)

1

1 1

1

1 11

1

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

(a ) (b )

1

1 1

1

1

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

1

(c) (d )

1

1

1

1 1

1

1

1 11

1

1

1 1

1

1 11

1

1

1 1

1

1 11

1

Figure 3.15 -- Example 3.13

f(A,B,C,D) = m(1,2,3,6) = AC + BC

1

C

A B

0 0 0 1 1 1 1 00 2 6 4

3 7 5

0

1

B

1 1

1 1

A

C

Figure 3.16 -- Example 3.14

f(A,B,C,D) = BD + BC + BCD

C D

A B

1

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 1 1

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1 1

1

A

C

1

1

1

1

Figure 3.17 -- Example 3.15Function with no essential prime implicants.

C D 0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

C DA B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

1 1

(a ) (b )

1

1

1

1 1

1 1

1

1 1

1

1 1

1

C D

A B0 0 0 1 1 1 1 0

0 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

A

C

1

1 1

1 1

1

(c )

1

1

1

1

1

1

A B

f(A,B,C,D) = m(0,4,5,7,8,10,14,15)

Figure 3.18 -- Example 3.16Minimizing a five-variable function.

f(A,B,C,D,E) = m(0,2,4,7,10,12,13,18,23,26,28,29)

D E

A B C

1

0 0 0 0 0 1 0 1 1 0 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

1

1

1

1

B

D

1 0 0 1 0 1 1 1 1 1 1 01 6 2 0 2 8 2 4

1 7 2 1 2 9 2 5

1 9 2 3 3 1 2 7

1 8 2 2 3 0 2 6

C

E

1

B

(a ) (b )

1

1

1

1

1

1

C

A

Prime Implicates and Covers

• A implicate is a sum term that can cover maxterms of a function.

• A prime implicate is a sum term that is not covered by another implicate of the function.

• An essential prime implicate is a prime implicate that covers at least one maxterm that is not covered by any other prime implicate.

• A set of implicate is said to be a cover of a function if each maxterm of the function is covered by at least one implicate in the set.

• A minimal cover is a cover that contains the smallest number of prime implicate and the smallest number of literals..

Algorithm 3.3 -- Generating and SelectingPrime Implicates

1. Count the number of adjacencies for each maxterm on the K-map.

2. Select an uncovered maxterm with the fewest number of adjacencies. Make an arbitrary choice if more than one choice is possible.

3. Generate a prime implicate for this maxterm and put it in the cover. If this maxterm is covered by more than one prime implicate, select the one that covers the most uncovered maxterms.

4. Repeat steps 2 and 3 until all maxterms have been covered.

Algorithm 3.4 -- Generating and SelectingPrime Implicates (Revisited)

1. Circle all prime implicates on the K-map.

2. Identify and select all essential prime implicates for the cover.

3. Select a minimum subset of the remaining prime implicates to complete the cover, that is, to cover those maxterms not covered by the essential prime implicates.

Example 3.17 -- Find the minimum POS form of the functionf(A,B,C,D) = M(0,1,2,3,6,9,14)

C D

A B

0

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

0

0

A

C

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

0 0

A

C

0

(a ) (b )

0

0

0

0 0

0

0

0

Figure 3.19 K-maps for Example 3.17.

Algorithm 3.5 -- Finding MPOS of f from f

1. Plot the complement function f on the K-map.

2. Use algorithm 3.1 or 3.2 to produce a MSOP of f.

3. Complement f and use DeMorgan’s theorem to produce a MSOP of f.

Example 3.18 -- Find the MPOS of the following function using Algorithm 3.5

f(A,B,C,D) = M(0,1,2,3,6,9,14)

C D

A B

1

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1 1

1

1 1 1

A

C

C D

A B

1

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1 1

1

1 1 1

A

C

(a ) (b )

Figure 3.20 K-map of f

f = A B + B C D + BCD

f = (A + B)(B + C + D )(B + C + D)

Example 3.19 -- Minimum covers off(A,B,C,D) = M (3,4,6,8,9,11,12,14) and its complement.

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

0 0

A

C

(a )

0 0

0

000

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1 1

A

C

(b )

1 1

1

111

Figure 3.21

Figure 3.22 Finding a minimal POS expressionfor a 5-variable function.

D E

A B C

0 0 0 0 0 1 0 1 1 0 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

C

0 0

B

D

0

0 0

0

1 0 0 1 0 1 1 1 1 1 1 01 6 2 0 2 8 2 4

1 7 2 1 2 9 2 5

1 9 2 3 3 1 2 7

1 8 2 2 3 0 2 6

C

0

B

0 0

0

A

E

0

Figure 3.23 Deriving POS and SOP forms of a function.

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

0

A

C

(a )

0

0 0

0

D

0 0

0

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

1

A

C

(b )

1

1 1

1

D

1 1

1

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

1

A

C

(c)

1 1

1

D

1

1

1 1

Example 3.22 -- Minimizing a Function with Don’t Cares.f(A,B,C,D) = m(1,3,4,7,11) + d(5,12,13,14,15)

= M(0,2,6,8,9,10) D(5,12,13,14,15)

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

0

A

C

(b )

0 d

d

D

d

0

0

00 d

d

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

A

C

(a )

1 d

d

D

d

d

d1

1 1 1

Figure 3.24 K-maps for Example 3.22.

SOP POS

Example 3.23 -- Design a circuit to distinguish BCD digits 5 from those 5.

ABCD

A B C D

L o g icc ircu it f

M in te rm f(A , B , C , D )

0 0 0 00 0 0 10 0 1 00 0 1 10 1 0 00 1 0 10 1 1 00 1 1 11 0 0 01 0 0 11 0 1 01 0 1 11 1 0 01 1 0 11 1 1 01 1 1 1

0123456789

1 01 11 21 31 41 5

0000011111dddddd

(a )

(b )

Figure 3.25 -- block diagram and truth table.

Example 3.23 (concluded)

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

0

A

C

(b )

0 d

d

D

d

0

dd

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

A

C

(a )

1d

d

D

d

d

1 1

1 d

1 d

0

0 d

Figure 3.26 Use of don’t cares for SOP and POS forms.

MSOP MPOS

f(A,B,C,D) = A + BD + BC; f(A,B,C,D) = (A + B)(A + C + D)

Timing Hazards in Combinational Logic Circuits

• Hazards are undesirable changes in the output of a combinational logic circuit caused by unequal gate propagation delays.

• Static hazard (glitch) -- the output momentarily changes from the correct or static state– Static 1 hazard -- the output changes from 1 to 0 and back to 1– Static 0 hazard -- the output changes from 0 to 1 and back to 0

• Dynamic hazard (bounce) -- the output changes multiple times during a change of state– Dynamic 0 to 1 hazard -- the output changes from 0 to 1 to 0 to 1– Dynamic 1 to 0 hazard -- the output changes from 1 to 0 to 1 to 0

Figure 3.27 (a)--(b) Illustration of a static hazard.

x 1

x 2

x 3

x 1

y 1

y 2

G 1

G 2

G 3I1z (x 1 , x 2 , x 3)

(a ) (b )

x 1

x 2

x 3

y 1

y 2

G 1

G 2

G 3z (x 1 , x 2 , x 3)

x 1

Figure 3.27 (c) Illustration of a static hazard (con’t)

x 1

x 2

x 3

y 1

y 2

z

T im e

(c)

t1 t2 t3 t4 t5 t6

D t D t D t

Figure 3.27 (d) Illustration of a static hazard (con’t).

x 1

x 2

x 3

y 1

y 2

z

T im e

(d )

t1 t2 t3 t4 t5 t6 t7 t8 t9

D t2 D t3

D t1 D t3

D t2 D t3

Figure 3.28 Identifying hazards on a K-map.

(b )

1

11 1

x 1

x 2

x 3

z

(a )

1

11 1

x 1

x 2

x 3

z

Figure 3.29 Hazard-free network.

x 1

x 2

x 3

G 1

G 4

G 3z (x 1 , x 2 , x 3)

x 3

G 2x 1

x 2

Figure 3.30 (a)--(b) Example of a static-0 hazard.

G 1

G 3

G 4z (A , B , C , D )

G 2

0

B

D

0

0 0 0 0

0 0

0

C

A

(a )

(b )

A

C

A

D

BA

C

Figure 3.30 (c)--(d) Example of a static-0 hazard (con’t).

0

B

D

0

0 0 0 0

0 0

0

C

A

G 1

G 4z (A , B , C , D )

G 2

G 3

(c )

(d )

A

C

A

D

BA

C

CB

DG 5

Figure 3.31 Dynamic hazards.

(a ) (b )

Quine-McCluskey Minimization Method

• Advantages over K-maps– Can be computerized

– Can handle functions of more than six variables

• Overview of the method– Given the minterms of a function

– Find all prime implicants (steps 1 and 2)• Partition minterms into groups according to the number of 1’s

• Exhaustively search for prime implicants

– Find a minimum prime implicant cover (steps 3 and 4)• Construct a prime implicant chart

• Select the minimum number of prime implicants

Example 3.24 -- Use the Q-M method to find the MSOP of the function

f(A,B,C,D) = m(2,4,6,8,9,10,12,13,15)

C D

A B

1

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

D

1 1

1

1 1 1

A

C

1 1

Figure 3.32 K-map for example 3.30.

Step 1 -- List Prime Implicants in Groups(Example 3.24)

Step 2 -- Generate Prime Implicants (Example 3.24)

Step 3 -- Prime Implicant Chart (Example 3.24)

642 8 1 0 1 2 1 3 1 5

P I 2

P I 3

P I 4

P I 5

P I 6

* * P I 7

* * P I 1

9

Step 4 -- Reduced Prime Implicant Chart(Example 3.24)

642 1 0

P I 2

*P I 3

*P I 4

P I 5

P I 6

The Resulting Minimal Realization of f

f(A,B,C,D) = PI1 + PI3 + PI4 + PI7

= 1-0- + -010 + 01-0 + 11-1

= AC + B CD + A BD + ABD

How the Q-M Results Look on a K-map

C D

A B

0 0 0 1 1 1 1 00 4 1 2 8

1 5 1 3 9

3 7 1 5 11

2 6 1 4 1 0

0 0

0 1

1 1

1 0

B

1

A

C

1 1

1

D

1

1

1

1 1

Figure 3.33 Grouping of terms.

Covering Procedure

Step 1 -- Identify any minterms covered by only one PI. Select these PIs for the cover.

Step 2 -- Remove rows covered by the PIs identified in step 1. Remove minterms covered by the removed rows.

Step 3 -- If a cyclic chart results from step 2, go to step 5. Otherwise, apply the reduction procedure of steps 1 and 2.

Step 4 -- If a cyclic chart results from step 3, go to step 5. Otherwise return to step 1.

Step 5 -- Apply the cyclic chart procedure. Repeat step 5 until a void chart or noncyclic chart chart is produced. In the latter case, return to step 1.

Coverage Examplef(A,B,C,D) = m(0,1,5,6,7,8,9,10,11,13,14,15)

510 6 8 9 1 0 1 1

* * P I1

P I2

P I3

P I4

P I5

P I6

* * P I7

7

1 3 1 4 1 5

Reduced PI Charts

111 05 1 3

P I2

P I3

P I4

P I5

P I6

1 05

* P I2

* P I4

Cyclic PI Charts

1. No essential PIs.2. No row or column coverage.

321 4

* P I1

P I2

P I3

P I4

P I5

P I6

5 6

542 6

P I2

P I3

P I4

P I5

P I6

542 6

* P I3

P I4

* P I5

Using the Q-M Procedure with Incompletely Specified Functions

1. Use minterms and don’t cares when generating prime implicants

2. Use only minterms when finding a minimal cover

Example 3.25 -- Find a minimal sum of products of the following functionusing the Quine-McCluskey procedure.

Minimizing Table for Example 3.25

PI Chart for Example 3.25

732 1 0 1 5 2 7

P I1

P I2

P I3

1 2

* * P I4

* * P I5

* * P I6

* * P I7

Results of Minimization for Example 3.25

f(A,B,C,D,E) = PI1 + PI4 + PI5 + PI6 + PI7 OR

= PI2 + PI4 + PI5 + PI6 + PI7

Minimizing Circuits with Multiple Outputs

Minimizing Table for Example 3.26

Prime Implicant Chart for Example 3.26

720 1 0 4 5 2 7

P I2

P I3

P I4

P I5

P I6

P I7

P I8

P I9

2

8

P I

P I1 0

P I1 1

P I1 2

P I1 3

Reduced Prime Implicant Chart for Example 3.26

877

* P I3

P I7

P I9

P I1 1

P I1 3

Minimum Realizations for Example 3.26

Figure 3.34 Reduced multiple-output circuit.

A CB D

f

f

P I1

P I2

P I3

P I5

P I1 3

A CB D

fa

Petrick’s Algorithm for Selecting a Minimal Cover(Algorithm 3.6)

1. Find all prime implicants of the function to be minimized.

2. Construct a prime implicant table and identify and remove all essential prime implicants and their corresponding rows and columns.

3. Write a POS function that contains a product term for eachminterm left in the reduced prime implicant chart that includesa variable for each prime implicant that covers the minterm.

4. Convert the function to SOP form.

5. Select a minimal cover by finding a product term representing the fewest prime implicants and literals.

Example 3.27 -- Example of Petrick’s Algorithm

642 1 0

P I 2

* P I 3

* P I 4

P I 5

P I 6

The Cover Function for Example 3.27

C = (PI2 + PI3)(PI4 + PI5)(PI2 + PI4)(PI3 + PI6)

= PI2PI3 PI5 + PI3PI4 + PI2 PI4PI6 + PI2 PI5PI6

Minimal cover = {PI1*, PI7*, PI3, PI4}

Figure 3.35S w itch in gfu n ction

Y es

N oM in im u m S O P ex p ressio n(su m o f e lem en ts o f E P I)

C rea te cu b erep resen ta tio n

D ete rm in e p r im eim p lica n t se t

P I

D ete rm in e essen tia lp r im e im p lica n ts.

M o v e fro m P I to E P I .

A llce lls

co v e redb y E P I

?

S e lec t b est te rmfro m P I a n d p u t

in to E P I

Figure 3.36

1 0 0 1 1 0

0 0 0 0 1 0

1 0 11 1 1

0 0 1 0 1 1

(a )

(x 1 , x 2 , x 3 )

1 0 0 1 1 0

0 0 0 0 1 0

1 0 11 1 1

0 0 1 0 1 1

(b )

(a , b , c )

Figure 3.37

B

A

C

(a )

1

1

1

D

1

1

B

C

(b )

1

1

D

1

11

1

1

A

Figure 3.38In p u ts : E P I, P I, D C

Y es

N o

Y es

N o

M in im u m S O P ex p ressio n(su m o f e lem en ts o f E P I)

C o m p u te u n co v e redm in te rm s U C

U C = F?

R em o v e red u n d a n tp r im e im p lica n ts

fro m P I

R em o v e u n d esira b lete rm s fro m P I

L o o k fo r n ew essen tia lp r im e im p lica n ts in P I .

M o v e to E P I .

N ewE P I

fo u n d?

M o v e lo w est-co stp r im e im p lica n t fro m

P I to E P I

Figure P3.1

ABCD

L o g icc ircu it f(A , B , C , D )B C D in p u ts

top related