elec 2200-002 digital logic circuits fall 2015 logic minimization (chapter 3) vishwani d. agrawal...

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

Upload: nigel-joseph

Post on 19-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 2: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Understanding Minimization . . .Logic function:

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

cdbdbabaF a

b

c

d

F

AND

AND

AND

AND

OR

NOT

Page 3: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

. . . Understanding Minimization

Reducing products:

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

bbd

ccbbdcbcbbd

cbcdcbbd

cdbdccbcdbd1b

cdbdaabcdbdbabaF

)(

)(

)(Distributivity

Complementation

Identity

Complementation

Distribitivity

Consensus theorem

Distributivity

Complement, identity

Page 4: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

. . . Understanding MinimizationReduced SOP:

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

bbdF

b

d

FAND

OR

NOT

Page 5: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

. . . Understanding MinimizationReducing literals:

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

bdbbdF

b

dFOR

NOT

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Or, Could Use Karnaugh MapOr, Could Use Karnaugh Map

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

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

Page 7: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Logic Minimization

Generally means– In SOP form:

Minimize number of products (reduce gates) and

Minimize literals (reduce gate inputs)

– In POS form:Minimize number of sums (reduce gates) and

Minimize literals (reduce gate inputs)

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

Page 8: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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-cubes

ABCD + ABCD = ABC(D +D) = ABCFall 2015, Oct 23 . . .Fall 2015, Oct 23 . . . ELEC2200-002 Lecture 5ELEC2200-002 Lecture 5 88

Page 9: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Cubes (Implicants) of 4 VariablesCubes (Implicants) of 4 Variables

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Growing Cubes, Reducing ProductsGrowing Cubes, Reducing Products

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Largest Cubes or Smallest ProductsLargest Cubes or Smallest Products

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 13: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

1 1

1 1

A

B

C

EPI

Why not this?

Page 16: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

1 1

1 1

A

B

C

EPI

RPI

Page 17: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

1 1

1 1 1

A

B

C

EPI

SPI

Page 18: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Minimum Sum of Products (MSOP)

Identify all prime implicants (PI) by letting minterms and implicants grow.

Construct MSOP with PI only :Cover all minterms

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

Page 19: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

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

0 4

112 8

1

1

15

113

19

1

3

17 15

111

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

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

0 4 12

18

1

1

15

113

19

3

17

115 11

2 6 14

110

1

A

B

C

D

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

SPI

Page 21: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

0

14

112 8

1

15

113

19

3 7 15

111

2 6

114

110

A = 0 B

C

D

E

16

20

28

124

1

17

21

29

125

1

19 23 31

127

18 22

130

126

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Multiple-Output Minimization

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

0

4

12

8

1

1

5

13

19

1

3 7

115

111

1

2 6

14

10

1

0

4

12 8

1

15

113

19

1

3 7

115

111

2 6

14

10

Individual Output Minimization

Need five products.

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

F1 A

B

C

D

F2 A

B

C

D

Page 25: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

0

4

12

8

1

1

5

13

19

1

3 7

115

111

1

2 6

14

10

1

0

4

12 8

1

15

113

19

1

3 7

115

111

2 6

14

10

Global Minimization

Need four products.

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

F1 A

B

C

D

F2 A

B

C

D

Page 26: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

0

04

12

8

0

1

5

13

9

0

3 7

15

11

2

06

014

10

0

0

4

112

8

1

1

5

13

9

3

17

115

11

12 6

14

10

A

B

C

D

A

B

C

D

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

Page 27: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

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

A

B

C

D

F

A

B

C

D

F

Are two circuits functionally Identical?

Page 28: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

How Don’t Cares OccurConsider two crossroads:

A highway with traffic signals, red (R), yellow (Y) and green (G), and

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

Page 29: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Traffic SignalsTraffic Signals

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

Page 30: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Completely Specified FunctionTruth Table

minterm R Y G g

0 0 0 0 0

1 0 0 1 0

2 0 1 0 0

3 0 1 1 0

4 1 0 0 1

5 1 0 1 0

6 1 1 0 0

7 1 1 1 0

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

1

g = RYG

R

Y

G

R

Y

G

g

Page 31: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Incompletely Specified Function

Truth Table

minterm R Y G g

0 0 0 0 Φ

1 0 0 1 0

2 0 1 0 0

3 0 1 1 Φ

4 1 0 0 1

5 1 0 1 Φ

6 1 1 0 Φ

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Absorption TheoremFor two Boolean variables: A, B

A + A B = A

Proof:

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

BA

AB

Page 33: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Consensus TheoremFor three Boolean variables: A, B, C

A B +A C + B C = A B +A C

Proof:

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

BA

C

AB

AC

BC

Page 34: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

A

B

C

D

A

B

C

D

A

B

C

D

Page 35: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 36: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

ExamplePI SOP: F = A D +AC +CD

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

A

B

C

D

AD

AC

Page 37: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Example (Cont.)PI SOP: F = A D +AC +CD

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

A

B

C

D

CD

Minimum SOP: F = A D +AC

Page 38: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 39: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 40: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Example: # (Sharp) Operation

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

CD # AD = {A BC D,ABC D}

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

A

B

C

D

ADCD

Page 41: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Minterms Covered by a ProductA product from which k variables have been eliminated, covers 2k minterms.

Example: For four variables, A, B, C, DProduct AC covers 22 = 4 minterms:

1) AB CD

2) AB C D

3) A B CD

4) A B C D

Obtained by inserting the

eliminated variables in all possible ways.

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

(4) (2)

(3) (1)

A

B

C

D

Page 42: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Quine-McCluskeyQuine-McCluskey

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

Willard V. O. Quine1908 – 2000

Edward J. McCluskeyb. 1929

Page 43: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 44: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 45: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Minterm ABCD Groups

2 0010

1: single 14 0100

8 1000

6 0110

2: two 1’s9 1001

10 1010

12 1100

13 1101 3: three 1’s

15 1111 4: four 1’s

Page 46: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 47: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Step 2 Executed on ExampleStep 2 Executed on Example

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

List 1 List 2 _List 3

Minterm ABCD PI? Minterms ABCD PI? Minterms ABCD PI?

2 0010 X 2, 6 0-10 PI_2 8,9,12,13 1-0- PI_1

4 0100 X 2,10 -010 PI_3

8 1000 X 4,6 01-0 PI_4

6 0110 X 4,12 -100 PI_5

9 1001 X 8,9 100- X

10 1010 X 8,10 10-0 PI_6

12 1100 X 8,12 1-00 X

13 1101 X 9,13 1-01 X

15 1111 X 12,13 110- X

13,15 11-1 PI_7

Page 48: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Step 3: Identify EPI’s

Covered by EPI → x x x x x

Minterms → 2 4 6 8 9 10 12 13 15

PI_1 is EPI x x x x

PI_2 x x

PI_3 x x

PI_4 x x

PI_5 x x

PI_6 x x

PI_7 is EPI x x

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

Page 49: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

PI_2 x x

PI_3 x x

PI_4 x x

PI_5 x

PI_6 x

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Page 51: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Minimized CircuitMinimized Circuit

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

PI1

PI3

PI4

PI7

A B

A B

C

C

D

D

F

Page 53: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

QM Minimizer on the Web

http://quinemccluskey.com/

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

Page 54: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Minterm ABCD Groups

2 0010

1: single 14 0100

8 1000

6 0110

2: two 1’s9 1001

10 1010

12 1100

13 1101 3: three 1’s

15 1111 4: four 1’s

Page 55: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Step 2: Same As Before on “All” MintermsStep 2: Same As Before on “All” Minterms

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

List 1 List 2 List 3

Minterm ABCD PI? Minterms ABCD PI? Minterms ABCD PI?

2 0010 X 2, 6 0-10 PI2 8,9,12,13 1-0- PI1

4 0100 X 2,10 -010 PI3

8 1000 X 4,6 01-0 PI4

6 0110 X 4,12 -100 PI5

9 1001 X 8,9 100- X

10 1010 X 8,10 10-0 PI6

12 1100 X 8,12 1-00 X

13 1101 X 9,13 1-01 X

15 1111 X 12,13 110- X

13,15 11-1 PI7

Page 56: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

Covered by EPI → x x x x

Minterms → 4 6 8 9 10 12 13

PI1 is EPI x x x x

PI2 x

PI3 x

PI4 x x

PI5 x x

PI6 x x

PI7 x

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

Page 57: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Step 4: Cover Remaining MintermsRemaining minterms → 4 6 10

PI_2 x

PI_3 x

PI_4 x x

PI_5 x

PI_6 x

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

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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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

1 1 1

1 1

1

1 1 1

A

B

C

D

EPI’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 Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

Minimized CircuitMinimized Circuit

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

PI1

PI3

PI4

A B

A B

C

C

D

D

F

Page 60: ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and

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