elec 2200-002 digital logic circuits fall 2014 logic

Post on 22-Dec-2021

5 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

ELEC 2200-002Digital Logic Circuits

Fall 2014Logic Minimization (Chapter 3)

Vishwani D. AgrawalJames J. Danaher Professor

Department of Electrical and Computer EngineeringAuburn University, Auburn, AL 36849http://www.eng.auburn.edu/~vagrawal

vagrawal@eng.auburn.edu

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 1

Understanding Minimization . . .Logic function:

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 2

cdbdbabaF +++=a

b

c

d

F

AND

AND

AND

AND

OR

NOT

. . . Understanding Minimization

Reducing products:

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 3

bbdccbbdcbcbbd

cbcdcbbdcdbdccb

cdbd1bcdbdaabcdbdbabaF

+=++=++=

+++=+++=

++=+++=+++=

)(

)(

)(Distributivity

Complementation

Identity

Complementation

Distribitivity

Consensus theorem

Distributivity

Complement, identity

. . . Understanding MinimizationReduced SOP:

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 4

bbdF +=

b

d

FAND

OR

NOT

. . . Understanding MinimizationReducing literals:

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 5

bdbbdF

+=+=

b

d FORNOT

Absorption theorem

db bd

Exercise: This circuit uses 8 transistors in CMOS technology.Can you redesign it with 6 transistors? (Hint: Use de Morgan’sTheorem.)

Logic Minimization

Generally means– In SOP form:

Minimize number of products (reduce gates) andMinimize literals (reduce gate inputs)

– In POS form:Minimize number of sums (reduce gates) andMinimize literals (reduce gate inputs)

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 6

Product or Implicant or CubeAny set of literals ANDed together.Minterm is a special case where all variables are present. It is the largest product.A minterm is also called a 0-implicant of 0-cube.A 1-implicant or 1-cube is a product with one variable eliminated:

Obtained by combining two adjacent 0-cubesABCD + ABCD = ABC(D +D) = ABC

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 7

Cubes (Implicants) of 4 Variables

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 8

A

B

D

C

1

1

1

Minterm or0-implicant or0-cubeAB CD

1-implicant or1-cubeABD

1

1

What is this?

Growing Cubes, Reducing Products

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 9

A

B

D

C

1

1

1-implicant or1-cubeAB D

1-implicant or1-cubeABD

1

1

2-implicant or2-cubeBD

What is this?

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

Largest Cubes or Smallest Products

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 10

A

B

D

C

1

1

What is this?

3-implicant or3-cubeB

1

1

1 1

1 1

Implication and Covering

A larger cube covers a smaller cube if all minterms of the smaller cube are included in the larger cube.A smaller cube implies (or subsumes) a larger cube if all minterms of the smaller cube are included in the larger cube.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 11

Implicants of a FunctionMinterms, products, cubes that imply the function.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 12

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

A

B

D

C

1

1

1

1

1 1

1

1

DCBACDABDBAF +++=

Prime Implicant (PI)A cube or implicant of a function that cannot grow larger by expanding into other cubes.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 13

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

A

B

D

C

1

1

1

1

1

1

1

1

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

A

B

D

C

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

PI

Essential Prime Implicant (EPI)If among the minterms subsuming a prime implicant (PI), there is at least one minterm that is covered by this and only this PI, then the PI is called an essential prime implicant (EPI).Also called essential prime cube (EPC).

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 14

1 1

1 1

A

B

C

EPI

Why not this?

Redundant Prime Implicant (RPI)If each minterm subsuming a prime implicant (PI) is also covered by other essential prime implicants, then that PI is called a redundant prime implicant (RPI).Also called redundant prime cube (RPC).

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 15

1 1

1 1

A

B

C

EPI

RPI

Selective Prime Implicant (SPI)A prime implicant (PI) that is neither EPI nor RPI is called a selective prime implicant (SPI).Also called selective prime cube (SPC).SPIs occur in pairs.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 16

1 1

1 1 1

A

B

C

EPI

SPI

Minimum Sum of Products (MSOP)

Identify all prime implicants (PI) by letting minterms and implicants grow.Construct MSOP with PI only :

Cover all mintermsUse only essential prime implicants (EPI)Use no redundant prime implicant (RPI)Use cheaper selective prime implicants (SPI)A good heuristic – Choose EPI in ascending order, starting from 0-implicant, then 1-implicant, 2-implicant, . . .

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 17

Example: F=∑m(1,3,4,5,8,9,13,15)

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 18

0 41

12 81

11

51

131

91

31

7 151

11

2 6 14 10

A

B

C

D

MSOP:F = AB D +A BC

+ A B D + ABC

RPI

Example: F=∑m(1,3,5,7,8,10,12,13,14)

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 19

0 4 121

81

11

51

131

9

31

71

15 11

2 6 141

101

A

B

C

D

MSOP:F = A D + A D + A BC

SPI

Functions with Don’t Care MintermsF(A,B,C) = ∑m(0,3,7) + d(4,5)Include don’t care minterms when beneficial.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 20

1 Φ

1 1 Φ

A

B

C

1 Φ

1 1 Φ

A

B

C

F = B C +ABC F = B C +BC

Five-Variable FunctionF(A,B,C,D,E)= ∑m(0,1,4,5,6,13,14,15,22,24,25,28,29,30,31)

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 21

01

41

12 8

11

51

131

9

3 7 151

11

2 61

141

10

A = 0 B

C

D

E

16 20 281

241

17 21 291

251

19 23 311

27

18 221

301

26

A = 1 B

C

D

E

F = ABD + A BD + B C E + C DE

Multiple-Output Minimization

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 22

Inputs OutputsA B C D F1 F20 0 0 0 0 00 0 0 1 1 00 0 1 0 0 00 0 1 1 0 00 1 0 0 0 00 1 0 1 1 00 1 1 0 0 00 1 1 1 1 11 0 0 0 0 11 0 0 1 1 11 0 1 0 0 11 0 1 1 0 11 1 0 0 0 01 1 0 1 1 11 1 1 0 0 01 1 1 1 1 1

0 4 12 81

1 5 131

91

3 71

151

111

2 6 14 101

0 4 12 8

11

51

131

91

3 71

151

11

2 6 14 10

Individual Output MinimizationNeed five products.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 23

F1 A

B

C

D

F2 A

B

C

D

0 4 12 81

1 5 131

91

3 71

151

111

2 6 14 101

0 4 12 8

11

51

131

91

3 71

151

11

2 6 14 10

Global MinimizationNeed four products.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 24

F1 A

B

C

D

F2 A

B

C

D

Minimized SOP and POSF(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)

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 25

00

4 12Φ

80

1 5Φ

13Φ

90

3 7 15Φ

11

20

60

14Φ

100

0 41

12Φ

8

11

13Φ

9

31

71

15Φ

111

2 6 14Φ

10

A

B

C

D

A

B

C

D

F = BC +AD + C D F = BD + CD + ACF = (B + D)(C + D)(A + C)

SOP and POS CircuitsF(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)

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 26

F = BC +AD + C D F = (B + D)(C + D)(A + C)

AB

C

D

F

A

B

C

D

F

Are two circuits functionally Identical?

How Don’t Cares OccurConsider two roads crossing:

Highway with traffic signal, red (R), yellow (Y) or green (G).Rural road with red (r) or green (g) signal.

Here R, Y, G, r and g are Boolean variables; a 1 implies light is on, 0 means light is off.Highway signals R, Y and G are controlled by a computer; only one light can be on.We only need to devise a digital circuit to obtain g, because r =g.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 27

Traffic Signals

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 28

Completely Specified FunctionTruth Table

minterm R Y G g

0 0 0 0 0

1 0 0 1 02 0 1 0 03 0 1 1 04 1 0 0 15 1 0 1 06 1 1 0 07 1 1 1 0

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 29

1

g = RYG

R

Y

G

R

Y

G

g

Incompletely Specified FunctionTruth Table

minterm R Y G g

0 0 0 0 0

1 0 0 1 02 0 1 0 03 0 1 1 Φ4 1 0 0 15 1 0 1 Φ6 1 1 0 Φ7 1 1 1 Φ

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 30

1

g = R

R

Y

G

R g

Φ

Φ

Φ Φ

Absorption TheoremFor two Boolean variables: A, BA + A B = AProof:

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 31

BA

AB

Consensus TheoremFor three Boolean variables: A, B, CA B +A C + B C = A B +A CProof:

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 32

BA

C

AB

AC

BC

Growing Implicants to PIF = AB +CD +ABCD initial implicants

= AB +ABCD + BCD +CD consensus th.= AB + BCD +CD absorption th.= AB + BCD +CD + BD consensus th.= AB +CD + BD absorption th.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 33

A

B

C

D

A

B

C

D

A

B

C

D

Identifying EPIFind all prime implicants.From prime implicant SOP, remove a PI.Apply consensus theorem to the remaining SOP.If the removed PI is generated, then it is either an RPI or an SPI.If the removed PI is not generated, then it is an EPI

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 34

ExamplePI SOP: F = A D +AC +CDIs AD an EPI?

F – {AD} =AC +CD, no new PI can be generated

Hence, AD is an EPI.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 35

A

B

C

D

AD

Example (Cont.)PI SOP: F = A D +AC +CDIs CD an EPI?

F – {CD } = A D +AC= A D +AC +C D (Consensus theorem)

HenceC D is not an EPI(it is an RPI)

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 36

A

B

C

D

CD

Finding MSOP1. Start with minterm or cube SOP representation

of Boolean function.2. Find all prime implicants (PI).3. Include all EPI’s in MSOP.4. Find the set of uncovered minterms, {UC}.5. MSOP is minimum if {UC} is empty. DONE.6. For a minterm in {UC}, include the largest PI

from remaining PI’s (non-EPI’s) in MSOP.7. Go to step 4.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 37

Finding Uncovered Minterms, {UC}

{UC} = ({PI} # {PMSOP}) # {DC}Where:

{PI} is set of all prime implicants of the function.{PMSOP} is any partial SOP.{DC} is set of don’t care minterms.Sharp (#) operation between Boolean expressions X and Y, X # Y, is the set of minterms covered by X that are not covered by Y.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 38

Example: # (Sharp) Operation

AD #CD = {A B C D, AB C D}CD # AD = {A BC D,ABC D}

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 39

A

B

C

D

ADCD

Minterms Covered by a ProductA product from which k variables have been eliminated, covers 2k minterms.Example: For four variables, A, B, C, D

Product AC covers 22 = 4 minterms:1) AB CD2) AB C D3) A B CD4) A B C D

Obtained by inserting theeliminated variables in all possible ways.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 40

(4) (2)

(3) (1)

A

B

C

D

Quine-McCluskey

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 41

Willard V. O. Quine1908 – 2000

Edward J. McCluskeyb. 1929

Quine-McCluskey Tabular Minimization Method

W. V. Quine, “The Problem of Simplifying Truth Functions,” American Mathematical Monthly, vol. 59, no. 10, pp. 521-531, October 1952.E. J. McCluskey, “Minimization of Boolean Functions,” Bell System Technical Journal, vol. 35, no. 11, pp. 1417-1444, November 1956.Textbook, Section 3.9, pp. 211-225.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 42

Q-M Tabular MinimizationMinimizes functions with many variables.Begin with minterms:

Step 1: Tabulate minterms in groups of increasing number of true variables.Step 2: Conduct linear searches to identify all prime implicants (PI).Step 3: Tabulate PI’s vs. minterms to identify EPI’s.Step 4: Tabulate non-essential PI’s vs. minterms not covered by EPI’s. Select minimum number of PI’s to cover all minterms.

MSOP contains all EPI’s and selected non-EPI’s.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 43

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

Q-M Step 1: Group minterms with 1 true variable, 2 true variables, etc.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 44

Minterm ABCD Groups2 0010

1: single 14 01008 10006 0110

2: two 1’s9 1001

10 101012 110013 1101 3: three 1’s15 1111 4: four 1’s

Q-M Step 2Find all implicants by combining minterms, and then combining products that differ in a single variable: For example,

2 and 6, orAB CD and A B CD → A CD, written as 0 – 1 0.

Try combining a minterm (or product) with all minterms (or products) listed below in the table.Include resulting products in the next list.If minterm (or product) does not combine with any other, mark it as PI.Check the minterm (or product) and repeat for all other minterms (or products).

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 45

Step 2 Executed on Example

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 46

List 1 List 2 List 3Minterm ABCD PI? Minterms ABCD PI? Minterms ABCD PI?

2 0010 X 2, 6 0-10 PI2 8,9,12,13 1-0- PI14 0100 X 2,10 -010 PI38 1000 X 4,6 01-0 PI46 0110 X 4,12 -100 PI59 1001 X 8,9 100- X

10 1010 X 8,10 10-0 PI612 1100 X 8,12 1-00 X13 1101 X 9,13 1-01 X15 1111 X 12,13 110- X

13,15 11-1 PI7

Step 3: Identify EPI’sCovered by EPI → x x x x x

Minterms → 2 4 6 8 9 10 12 13 15PI1 is EPI x x x x

PI2 x xPI3 x xPI4 x xPI5 x xPI6 x x

PI7 is EPI x x

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 47

Step 4: Cover Remaining MintermsRemaining minterms → 2 4 6 10

PI2 x xPI3 x xPI4 x xPI5 xPI6 x

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 48

Integer linear program (ILP), available from Matlab and other sources: Define integer {0,1} variables, xk = 1, select PIk;xk = 0, do not select PIk.Minimize ∑k xk, subject to constraints: x2 + x3 ≥ 1

x4 + x5 ≥ 1x2 + x4 ≥ 1x3 + x6 ≥ 1

A solution is x3 = x4 = 1, x2 = x5 = x6 = 0

Linear Programming (LP)A mathematical optimization method for problems where some “cost” depends on a large number of variables.An easy to understand introduction is:

S. I. Gass, An Illustrated Guide to Linear Programming, New York: Dover Publications, 1970.

Very useful tool for a variety of engineering design problems.Available in software packages like Matlab.Courses on linear programming are available in Math, Business and Engineering departments.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 49

Q-M MSOP Solution and Verification F(A,B,C,D) = PI1 + PI3 + PI4 + PI7

= 1-0- + -010 + 01-0 + 11-1= AC +B CD +A BD + A B D

See Karnaugh map.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 50

1 1 1

1 1

1

1 1 1

A

B

C

DEPI’s in MSOP

Non-EPI’s in MSOP Non-EPI’s notin MSOP

Minimized Circuit

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 51

PI1

PI3

PI4

PI7

F

A BA B C C D D

QM Minimizer on the Web

http://www.mathcs.bethel.edu/~gossett/DiscreteMathWithProof/QuineMcCluskey.htmlNote: This minimizer may not always select the best from the selective prime implicants.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 52

Further Reading

Incompletely specified functions: See Example 3.25, pages 218-220.Multiple output functions: See Example 3.26, pages 220-222.

Fall 2014, Oct 13 . . . ELEC2200-002 Lecture 5 53

top related