24
Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE Department, Wayne State University Syed M. Mahmud, Ph.D ECE Department Wayne State University

Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

  • Upload
    vanmien

  • View
    227

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Lecture 6: Gate Level Minimization

Original Source: Aby K George, ECE Department, Wayne State University

Syed M. Mahmud, Ph.D

ECE Department

Wayne State University

Page 2: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Contents

• The Map method

• Two variable K-Map

• Three variable K-Map

• Four-variable K-Map

• Prime implicants

• Essential prime implicants

• Product-of-sums simplification

• Don’t-care conditions

Chapter 3 ECE 2610 – Digital Logic 1 2

Page 3: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Introduction

• Logic synthesis: Minimization of logic function with available gates.

• Manual methods for the design of simple circuits.

• Gate-level minimization with manual methods (using theorems and postulates) is difficult when function is complex.

• Computer-based logic synthesis tools for minimization of complex functions.

Chapter 3 ECE 2610 – Digital Logic 1 3

Page 4: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

The Map method or K-Map method

• Karnaugh Map or K-Map

• Pictorial form of a truth table.

• K-map• Made up of squares• Each square represents on minterm in the truth table

• The simplified expression• Sum of product form (SOP)• Product of sum (POS)

• Gives simplest algebraic expression.

• In some cases, more than one simplest expressions are possible.

Chapter 3 ECE 2610 – Digital Logic 1 4

Page 5: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Two-variable K-Map

• 2 variables => 22 = 4 min terms

• Ex: Simplify the following truth table

Chapter 3 ECE 2610 – Digital Logic 1 5

x y F

0 0 0

0 1 0

1 0 0

1 1 1

𝐹 = m3 𝐹 = 𝑥. 𝑦

Page 6: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Two-variable K-Map

• Simplify the following truth table using K-Map

Chapter 3 ECE 2610 – Digital Logic 1 6

x y F

0 0 0

0 1 1

1 0 1

1 1 1

𝐹 = 𝑚1 +𝑚2 +𝑚3

= 𝑥′𝑦 + 𝑥𝑦′ + 𝑥𝑦𝐹 = 𝑥 + 𝑦

Page 7: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Three-variable K-Map

• 3 variables => 23 = 8 minterms.

• Sequence arranged in Gray code

• Only one bit change in value between two adjacent squares

Chapter 3 ECE 2610 – Digital Logic 1 7

Page 8: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Three-variable K-Map

• Simplify the following truth table using K-Map

Chapter 3 ECE 2610 – Digital Logic 1 8

x y z F

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 1

00 01 11 10

0

1 1 1

𝑥

𝑦𝑧

𝑥

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝐹 = 𝑥𝑧

Page 9: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

00 01 11 10

0 1 1

1 1 1

Three-variable K-Map

• Simplify using K-Map

𝐹 = Σ 2,3,4,5

Chapter 3 ECE 2610 – Digital Logic 1 9

𝑥

𝑦𝑧

𝑥

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝐹 = 𝑥𝑦′ + 𝑥′𝑦

𝐹 = Σ 3,4,6,7

00 01 11 10

0 1

1 1 1 1

𝑥

𝑦𝑧

𝑥

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝐹 = 𝑦𝑧 + 𝑥𝑧′

Page 10: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

00 01 11 10

0 1 1

1 1 1 1

Three-variable K-Map

• Simplify using K-Map

𝐹 = Σ 0,2,4,5,6

Chapter 3 ECE 2610 – Digital Logic 1 10

𝑥

𝑦𝑧

𝑥

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝐹 = 𝑥𝑦′ + 𝑧′

𝐹 = Σ 1,2,3,5,7

00 01 11 10

0 1 1 1

1 1 1

𝑥

𝑦𝑧

𝑥

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝐹 = 𝑥′𝑦 + 𝑧

Page 11: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

K-Map Simplification

Number of squares combined in K-Map Minimized literals

One square Three literals

Two adjacent squares combined Two literals

Four adjacent squares combined One literal

Eight adjacent squares combined Zero literals (Always answer is 1)

Chapter 3 ECE 2610 – Digital Logic 1 11

• Three variable K-Map

• Four variable K-MapNumber of squares combined in K-Map Minimized literals

One square Four literals

Two adjacent squares combined Three literals

Four adjacent squares combined Two literal

Eight adjacent squares combined One literal

Sixteen adjacent squares combined Zero literals (Always answer is 1)

Page 12: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Four-Variable K-Map

• No. of minterms = 24 = 16

Chapter 3 ECE 2610 – Digital Logic 1 12

Page 13: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Four-variable K-Map

• Simplify the Boolean function

𝐹 𝑤, 𝑥, 𝑦, 𝑧 = Σ(0,1,2,4,5,6,8,9,12,13,14)

Chapter 3 ECE 2610 – Digital Logic 1 13

00 01 11 10

00 1 1 1

01 1 1 1

11 1 1 1

10 1 1

𝑤𝑥

𝑦𝑧

𝑤

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝐹 = 𝑦′ + 𝑥𝑧′ + 𝑤′𝑧′

𝑚12 𝑚13 𝑚15

𝑚8 𝑚9

𝑚14

𝑚11 𝑚10

𝑥

Page 14: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Four-variable K-Map

• Simplify the Boolean function

𝐹 𝐴, 𝐵, 𝐶, 𝐷 = 𝐴′𝐵′𝐶′ + 𝐵′𝐶𝐷′ + 𝐴′𝐵𝐶𝐷′ + 𝐴𝐵′𝐶′

Chapter 3 ECE 2610 – Digital Logic 1 14

00 01 11 10

00 1 1 1

01 1

11

10 1 1 1

𝐴𝐵

𝐶𝐷

𝐴

𝐶

𝐷

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹𝐴′𝐵′𝐶′ = 𝐴′𝐵′𝐶′ 𝐷 + 𝐷′ = 𝐴′𝐵′𝐶′𝐷 + 𝐴′𝐵′𝐶′𝐷′

= 𝑚1 +𝑚0

𝑚12 𝑚13 𝑚15

𝑚8 𝑚9

𝑚14

𝑚11 𝑚10

𝐵

𝐵′𝐶𝐷′ = 𝐵′𝐶𝐷′ 𝐴 + 𝐴′ = 𝐴𝐵′𝐶𝐷′ + 𝐴′𝐵′𝐶𝐷′

= 𝑚10 +𝑚2

𝐴′𝐵𝐶𝐷′ = 𝑚6

𝐴𝐵′𝐶′ = 𝐴𝐵′𝐶′ 𝐷 + 𝐷′ = 𝐴𝐵′𝐶′𝐷 + 𝐴𝐵′𝐶′𝐷′

= 𝑚9 +𝑚8

𝐹 = 𝑚0 +𝑚1 +𝑚2 +𝑚6 +𝑚8 +𝑚9 +𝑚10

𝐹 = 𝐵′𝐷′ + 𝐵′𝐶′ + 𝐴′𝐶𝐷′

Page 15: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Prime Implicants

• While choosing adjacent squares:• All minterms covered

• The number of terms in the expression is minimized

• There are no redundant terms

• A prime implicant is a product term obtained by combining the maximum possible number of adjacent squares in the Map.

• A prime implicant is essential if:• It cannot be removed from a description of the function.

• It is the only prime implicant that covers the minterm.

Chapter 3 ECE 2610 – Digital Logic 1 15

Page 16: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Prime implicants

• 𝐹 = Σ(0,2,3,5,7,8,9,10,11,13,15)

Chapter 3 ECE 2610 – Digital Logic 1 16

00 01 11 10

00 1 1 1

01 1 1

11 1 1

10 1 1 1 1

𝐴𝐵

𝐶𝐷

𝐴

𝐶

𝐷

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝑚12 𝑚13 𝑚15

𝑚8 𝑚9

𝑚14

𝑚11 𝑚10

𝐵

Essential Prime implicants: 𝐵𝐷, 𝐵’𝐷’

Prime implicants: 𝐶𝐷, 𝐵′𝐶, 𝐴𝐷, 𝐴𝐵′

𝐹 = 𝐵𝐷 + 𝐵′𝐷′ + 𝐶𝐷 + 𝐴𝐷= 𝐵𝐷 + 𝐵′𝐷′ + 𝐶𝐷 + 𝐴𝐵′= 𝐵𝐷 + 𝐵′𝐷′ + 𝐵′𝐶 + 𝐴𝐷= 𝐵𝐷 + 𝐵′𝐷′ + 𝐵′𝐶 + 𝐴𝐵′

Only one way to include 𝑚0 and 𝑚5

Page 17: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Product of sums simplification

• Take max terms for simplification

• Simplify 𝐹 = Σ(0,1,2,5,8,9,10) into product of sum form

Chapter 3 ECE 2610 – Digital Logic 1 17

00 01 11 10

00 1 1 0 1

01 0 1 0 0

11 0 0 0 0

10 1 1 0 1

𝐴𝐵

𝐶𝐷

𝐴

𝐶

𝐷

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝑚12 𝑚13 𝑚15

𝑚8 𝑚9

𝑚14

𝑚11 𝑚10

𝐵

𝐹′ = 𝐴𝐵 + 𝐶𝐷 + 𝐵𝐷′Apply DeMorgan’s theorem to get F𝐹 = (𝐴′ + 𝐵′)(𝐶′ + 𝐷′)(𝐵′ + 𝐷)

Page 18: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Product of sums simplification

• Simplify 𝐹 = Π(0,2,5,7) into product of sum form

𝐹 = Π 0,2,5,7 = Σ(1,3,4,6)

Chapter 3 ECE 2610 – Digital Logic 1 18

00 01 11 10

0 0 1 1 0

1 1 0 0 1

𝑥

𝑦𝑧

𝑥

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹 𝐹′ = 𝑥′𝑧′ + 𝑥𝑧

𝐹 = (𝑥 + 𝑧)(𝑥′ + 𝑧′)

Page 19: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Don’t-care conditions

• Don’t-care (X) minterm is a combination of variables whose logical value is not specific.

• Example: 4-bit binary code for decimal numbers • 0000 to 1001 – Valid

• 1010 to 1111 – Invalid

• The don’t-care condition can be used on a map to provide further simplification of Boolean expression.

Chapter 3 ECE 2610 – Digital Logic 1 19

Page 20: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Don’t-care condition

• Simplify the Boolean function 𝐹(𝑤, 𝑥, 𝑦, 𝑧) = Σ(1,3,7,11,15) which has a don’t-care condition 𝑑(𝑤, 𝑥, 𝑦, 𝑧) = Σ(0,2,5)

Chapter 3 ECE 2610 – Digital Logic 1 20

00 01 11 10

00 X 1 1 X

01 X 1

11 1

10 1

𝑤𝑥

𝑦𝑧

𝑤

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝑚12 𝑚13 𝑚15

𝑚8 𝑚9

𝑚14

𝑚11 𝑚10

𝑥

𝐹 = 𝑦𝑧 + 𝑤′𝑧

Page 21: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Don’t-care condition

• Simplify the Boolean function 𝐹(𝑤, 𝑥, 𝑦, 𝑧) = Σ(1,3,7,11,15) which has a don’t-care condition 𝑑(𝑤, 𝑥, 𝑦, 𝑧) = Σ(0,2,5) using product of sum simplificiton

Chapter 3 ECE 2610 – Digital Logic 1 21

00 01 11 10

00 X 1 1 X

01 0 X 1 0

11 0 0 1 0

10 0 0 1 0

𝑤𝑥

𝑦𝑧

𝑤

𝑦

𝑧

𝑚0 𝑚1 𝑚3 𝑚2

𝑚6𝑚7𝑚5𝑚4

𝐹

𝑚12 𝑚13 𝑚15

𝑚8 𝑚9

𝑚14

𝑚11 𝑚10

𝑥

𝐹′ = 𝑧′ + 𝑤𝑦′

𝐹 = 𝑧(𝑤′ + 𝑦)

Page 22: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Other minimization methods

• Algebraic methods• Simplify using Algebraic theorems.

• Quine McClusky Method• Tabular method

• Can work for any number of variables

• Scheinman Method• Column-wise writing of minterms as decimal numbers and their simplification

• Can work for any number of variables

Chapter 3 ECE 2610 – Digital Logic 1 22

Page 23: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Summary

• Simplify a Karnaugh Map for Boolean functions of 2, 3, and 4 variables

• Find prime implicants of a Boolean function

• How to obtain the sum-of-product terms and product-of-sum forms of a Boolean function directly from K-Map

• How to use don’t-care conditions to simplify a K-Map

Chapter 3 ECE 2610 – Digital Logic 1 23

Page 24: Lecture 6: Gate Level Minimization - Wayne State Universityece.eng.wayne.edu/~smahmud/ECECourses/ECE2610/... · Lecture 6: Gate Level Minimization Original Source: Aby K George, ECE

Homework 3 – Part a

• Simplify Boolean functions• 3.2

• 3.3

• 3.7

• 3.10

• 3.11

• 3.12

• 3.15

Chapter 3 ECE 2610 – Digital Logic 1 24