60
ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and Computer Engineering Auburn University, Auburn, AL 36849 http://www.eng.auburn.edu/~vagrawal [email protected] Fall 2015, Oct 23 . . . ELEC2200 - 002 Lecture 5 1

ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

ELEC 2200-002Digital Logic Circuits

Fall 2015Logic Minimization (Chapter 3)

Vishwani D. AgrawalJames J. Danaher Professor

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

[email protected]

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 1

Page 2: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Understanding Minimization . . .Logic function:

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 2

cdbdbabaF +++=a

b

c

d

F

AND

AND

AND

AND

OR

NOT

Page 3: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

. . . Understanding Minimization

Reducing products:

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 3

bbdccbbdcbcbbd

cbcdcbbdcdbdccb

cdbd1bcdbdaabcdbdbabaF

+=++=++=

+++=+++=

++=+++=+++=

)(

)(

)(Distributivity

Complementation

Identity

Complementation

Distribitivity

Consensus theorem

Distributivity

Complement, identity

Page 4: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

. . . Understanding MinimizationReduced SOP:

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 4

bbdF +=

b

d

FAND

OR

NOT

Page 5: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

. . . Understanding MinimizationReducing literals:

Fall 2015, Oct 23 . . . 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.)

Page 6: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Or, Could Use Karnaugh Map

Fall 2015, Sep 30 . . . ELEC2200-002 Lecture 4 6

http://www.ee.calpoly.edu/media/uploads/resources/KarnaughExplorer_1.html

Page 7: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 7

Page 8: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 8

Page 9: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Cubes (Implicants) of 4 Variables

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 9

A

B

D

C

1

1

1

Minterm or0-implicant or0-cubeAB CD

1-implicant or1-cubeABD

1

1

What is this?

Page 10: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Growing Cubes, Reducing Products

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 10

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

Page 11: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Largest Cubes or Smallest Products

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 11

A

B

D

C

1

1

What is this?

3-implicant or3-cubeB

1

1

1 1

1 1

Page 12: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 12

Page 13: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

Fall 2015, Oct 23 . . . 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

DCBACDABDBAF +++=

Page 14: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 14

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

Page 15: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 15

1 1

1 1

A

B

C

EPI

Why not this?

Page 16: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 16

1 1

1 1

A

B

C

EPI

RPI

Page 17: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 17

1 1

1 1 1

A

B

C

EPI

SPI

Page 18: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 18

Page 19: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 19

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

Page 20: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 20

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

Page 21: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 21

1 Φ

1 1 Φ

A

B

C

1 Φ

1 1 Φ

A

B

C

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

Page 22: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 22

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

Page 23: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Multiple-Output Minimization

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 23

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

Page 24: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 24

F1 A

B

C

D

F2 A

B

C

D

Page 25: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 25

F1 A

B

C

D

F2 A

B

C

D

Page 26: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 26

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)

Page 27: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 27

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?

Page 28: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

How Don’t Cares OccurConsider two crossroads:

A highway with traffic signals, red (R), yellow (Y) and green (G), andA rural road with red (r) and green (g) signals.

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.Rural traffic can cross highway (g = 1) only when R = 1, Y = G = 0, and r =g.

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 28

Page 29: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Traffic Signals

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 29

Page 30: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Completely Specified FunctionTruth Table

minterm R Y G g0 0 0 0 01 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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 30

1

g = RYG

R

Y

G

R

Y

G

g

Page 31: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Incompletely Specified Function

Truth Tableminterm R Y G g

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 31

1

g = R

R

Y

G

R g

Φ

Φ

Φ Φ

Φ

Additional condition: Exactly one highway light can be on.

Φ or X denotes “don’t care”

Page 32: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 32

BA

AB

Page 33: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 33

BA

C

AB

AC

BC

Page 34: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 34

A

B

C

D

A

B

C

D

A

B

C

D

Page 35: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 35

Page 36: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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. Similarly, AC is an EPI.

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 36

A

B

C

D

AD

AC

Page 37: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 37

A

B

C

D

CD

Minimum SOP: F = A D +AC

Page 38: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 38

Page 39: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 39

Page 40: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Example: # (Sharp) Operation

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 40

A

B

C

D

ADCD

Page 41: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 41

(4) (2)

(3) (1)

A

B

C

D

Page 42: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Quine-McCluskey

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 42

Willard V. O. Quine1908 – 2000

Edward J. McCluskeyb. 1929

Page 43: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 43

Page 44: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 44

Page 45: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 45

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

Page 46: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 46

Page 47: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Step 2 Executed on Example

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 47

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

2 0010 X 2, 6 0-10 PI_2 8,9,12,13 1-0- PI_14 0100 X 2,10 -010 PI_38 1000 X 4,6 01-0 PI_46 0110 X 4,12 -100 PI_59 1001 X 8,9 100- X

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

13,15 11-1 PI_7

Page 48: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

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

PI_2 x xPI_3 x xPI_4 x xPI_5 x xPI_6 x x

PI_7 is EPI x x

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 48

Page 49: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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

PI_2 x xPI_3 x xPI_4 x xPI_5 xPI_6 x

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 49

Integer linear program (ILP), available from Matlab and other sources: Define integer {0,1} variables, xk = 1, select PI_k;xk = 0, do not select PI_k.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, or select PI_3, PI_4

Page 50: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

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 2015, Oct 23 . . . ELEC2200-002 Lecture 5 50

Page 51: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Q-M MSOP Solution and Verification F(A,B,C,D) = PI_1 + PI_3 + PI_4 + PI_7

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

See Karnaugh map.

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 51

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

Page 52: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Minimized Circuit

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 52

PI1

PI3

PI4

PI7

A B

A B

C

C

D

D

F

Page 53: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

QM Minimizer on the Web

http://quinemccluskey.com/

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 53

Page 54: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Function with Don’t CaresF(A,B,C,D) = ∑ m(4,6,8,9,10,12,13) + ∑ d(2, 15)

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 54

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

Page 55: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Step 2: Same As Before on “All” Minterms

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 55

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

Page 56: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Step 3: Identify EPI’s Ignoring Don’t Cares

Covered by EPI → x x x xMinterms → 4 6 8 9 10 12 13PI1 is EPI x x x x

PI2 xPI3 xPI4 x xPI5 x xPI6 x xPI7 x

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 56

Page 57: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Step 4: Cover Remaining MintermsRemaining minterms → 4 6 10

PI_2 xPI_3 xPI_4 x xPI_5 xPI_6 x

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 57

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

x2 + x4 ≥ 1x3 + x6 ≥ 1

A solution is x3 = x4 = 1, x2 = x5 = x6 = 0, or select PI_3, PI_4

Page 58: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Q-M MSOP Solution and Verification F(A,B,C,D) = PI_1 + PI_3 + PI_4

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

See Karnaugh map.

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 58

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

EPI’s not selected

Page 59: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Minimized Circuit

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 59

PI1

PI3

PI4

A B

A B

C

C

D

D

F

Page 60: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic ...eng.auburn.edu/~agrawvd/COURSE/E2200_Fall15/LECTURES/lec5_Logic... · ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic

Further Reading

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

Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5 60