62
Chapter 3 Gate-level Minimization 1

Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Embed Size (px)

Citation preview

Page 1: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Chapter 3

Gate-level Minimization

1

Page 2: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Chapter3: Gate-level Minimization

3-2 The Map MethodTwo-variable map and Three-variable map

3-3 Four-Variable Map3-4 Five-variable Map3-5 Product of Sums Simplification3-6 Don’t-care Conditions3-7 NAND and NOR Implementation3-8 Other Two-LeveI Implementations3-9 Exclusive-OR Function

2

Page 3: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

3-2 The Map Method

• Simplification of Boolean Expression– Minimum # of terms, minimum # of literals– To reduce complexity of digital logic gates– The simplest expression is not unique

• Methods:– Algebraic minimization lack of specific rules

• Section 2.4

– Karnaugh map or K-map• Combination of 2, 4, … adjacent squares

Logic circuit Boolean function Truth table K-map

Canonical form (sum of minterms, product of maxterms) (Simplifier) standard form (sum of products, product of sums)

3

Page 4: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

4

A Karnaugh map is a graphical tool for assisting in the general simplification procedure.

3-2 The Map Method

Page 5: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

5

2 variables 4 minterms 4 squares.

Y’ Y

X

X’

Page 6: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

6

We can reduce functions by circling 1’s in the K-mapEach circle represents minterm reductionFollowing circling, we can deduce minimized and-or form.Rules to considerEvery cell containing a 1 must be included at least once.The largest possible “power of 2 rectangle” must be enclosed.The 1’s must be enclosed in the smallest possible number of rectangles.

Page 7: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

7

Two variable maps:

g = b'

0 101

ab 0 1

01

ab

0 10 1

f = a

1 10 0

0A

1 01

B 0 101

F=AB+A’B

Page 8: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

8

X

Y

Page 9: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

9

Example: F(X,Y) = XY’ + XY From the map, we see that

F (X,Y) = X.Note: There are implied 0s in other boxes.

This can be justified using algebraic manipulations:

F(X,Y) = XY’ + XY

= X(Y’ +Y)

= X.1

= X

11 X

Page 10: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

10

G(x,y) = m1 + m2 + m3

1

11

G(x,y) = m1 + m2 + m3

= X’Y + XY’ + XY

From the map, we can see that

G = X + YX

Y

Page 11: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

11

F = Σ(m0,m1)

Using algebraic manipulationsF = Σ(m0,m1)

= x’y + x’y’= x’ (y+y’)= x’

x y F0 0 10 1 11 0 01 1 0

0 1y

x0

1

1

0 0

10 1

yx

0

1

x’y’

xy’ xy

x’y

x

y

X’

Page 12: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

12

3 variables 8 minterms (m0 – m7).

How can we locate a minterm square on the map?

Use figure (a) OR use column # and row # from figure (b)E.g. m5 is in row 1 column 01 (5 10 = 101 2)Q. Show the area representing X’? Y’? Z’?

Page 13: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

• 8 minterms for 3 binary variables• Any two adjacent squares differ by only

one variable

yz

13

yz

Page 14: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

14

By combining squares in powers of 2in powers of 2, we reduce number of literals in a product term, reducing the literal cost, thereby reducing the other two cost criteria.

On a 3-variable K-Map:◦ One square represents a minterm with three variables◦ Two adjacent squares represent a product term with two

variables◦ Four “adjacent” terms represent a product term with one

variables◦ Eight “adjacent” terms is the function of all ones (logic 1).

Page 15: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

15

Adjacent Squares m0+m2 = X’Y’Z’ + X’YZ’ = X’Z’(Y’+Y) = X’Z’ m4+m6 = XY’Z’ + XYZ’ = XZ’(Y’+Y) = XZ’

Page 16: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

16

F = X’Y’Z’ + X’YZ’ + XY’Z’ + XYZ’= Z’ (X’Y’ + X’Y + XY’ + XY)= Z’ (X’ (Y’+Y) + X (Y’+Y))= Z’ (X’+ X) = Z’

Page 17: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

17

F=AB’C’ +ABC +ABC +ABC + A’B’C + A’BC’

F=A+BC +BC0

A

1 11

00 01

01

BC

01 1

111 10

Page 18: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

18

Example:

F (x, y, z)= Σm (2, 3, 6, 7)

Applying the Minimization Theorem three times:

Thus the four terms that form a 2 × 2 square correspond to the term "y".

yzyyz

zyxzyxzyxzyx)z,y,x(F

00 101101

1

0

X

Z

Y

XYZ

1 1

1 1Y

Page 19: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

19

Example: SimplifyF (x, y, z)= Σm (2, 3, 4, 5)

00 101101

1

0

X

Z

Y

XYZ

1

1 1

1

X’Y

XY’

F(X,Y,Z) = X’Y + XY’

Page 20: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

20

Example: SimplifyG (a, b, c)= Σm (3, 4, 6, 7)

00 101101

1

0

a

c

b

Xbc

1

1 11

ac’

bc

G (a,b,c) = bc + ac’

a

Page 21: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

21

Example: SimplifyF(X, Y, Z) = X’Z + X’Y + XY’Z + YZF(X, Y, Z) = Σm (1, 2, 3, 5, 7)

yx

yx

z)y,F(x, z

z00 101101

1

0

X

Z

Y

XYZ

1 1

11

1

• In general, as more squares

are combined, we obtain a

product term with fewer

literals.• Overlap is allowed.

Page 22: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Examples 3-1 and 3-2

22

Page 23: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Examples 3-3 and 3-4

One square representsone minterm, giving aterm of three literals

• Two adjacent squaresrepresent a term of twoliterals

• Four adjacent squaresrepresent a term ofone literal

23

Page 24: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

3-3 Four-Variable Map

• Two adjacent squares represent a term of three literals• Four adjacent squares represent a term of two literals• Eight adjacent squares represent a term of one literalThe larger the number of squares combined, the smaller thenumber of literals in the term

24

Page 25: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

25

Page 26: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Examples 3-5 and 3-6

x

x

26

Page 27: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

27

F = m(0,1,2,4,5,6,8,9,12,13,14)

F = Y’ + XZ’ + W’Z’

Page 28: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

28

F = m(0,2,4,5,6,7,10,13,15)

Do it and show it to me next time!

Page 29: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Simplification Using Prime Implicants

29

A Prime Implicant is a product term obtained by combining the maximum possible number of adjacent squares in the map into a rectangle with the number of squares a power of 2.

A prime implicant is called an Essential Prime Implicant if it is the only prime implicant that covers (includes) one or more minterms.

Prime Implicants and Essential Prime Implicants can be determined by inspection of a K-Map.

Page 30: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

1

30

Page 31: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Minterms covered by single prime implicant

DB

CB

1 1

1 1

1 1

B

D

A

1 1

1 1

1

Find ALL Prime Implicants

ESSENTIAL Prime Implicants

C

BD

CD

BD

DB

1 1

1 1

1 1

B

C

D

A

1 1

1 1

1

AD

BA

Page 32: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Find all prime implicants for:F (W,X,Y,Z) = (0,2,3,8,9,10,11,12,13,14,15)

X

Y

Z

W

Prime implicants are: W, X‘Y, and X‘Z‘

1 1 1

1 1 1 1

1 1 11

Note that all of these prime implicants are essential.

Page 33: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Find all prime implicants for:G(W,X,Y,Z) = (0,2,3,4,7,12,13,14,15)

◦ Hint: There are seven prime implicants!

X

Y

Z

W

1 1 1

1 1

1 1 1 1

Prime Implicants are WX, XY’Z', W’Y’Z', W’X’Z', W’X’Y, W’YZ, XYZ.

There is only one essential prime implicant: WX.

Page 34: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

3-4 Five-Variable Map

34

Page 35: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

35

Page 36: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Example 3-7

36

Page 37: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

E.g. Simplify the following Boolean function in product-of-sums form

F(A,B,C,D)= m(0,1,2,5,8,9,10)1. Mark with 1’s the minterms of F.2. Mark the remaining squares with

0’s. These represent F’.3. Find the simplified F’.

F’ = AB + CD + BD’4. Complement 3 to obtain a

simplified F in product-of-sums formF = (A’ + B’)(C’ + D’) (B’ + D)

Page 38: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Simplify :F= (0,1,2,5,8,9,10) in Product-of-Sums Form

1. Mark with 0’s the Maxterms of F

2. Combine 0’s to obtain a simplified F’ in SOP.

3. Complement 2 to obtain a simplified F in POS.

A

D

C

B

F’ = AB + CD + BD’F = (A’+B’)(C’+D’)(B’+D)

Page 39: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Example 3-8Simply Boolean function F(A, B, C, D) =(0, 1, 2,5, 8, 9,10) in (a) sum of products and (b) product of sums

(a) F = B’D’+ B’C‘+ A’C’D

1. Obtain simplified complemented function:F’ = AB + CD+BD’

2. Applying DeMorgan’s theorem to obtain FF = (A’ + B’) (C’+D’) (B’ + D)

(b)

39

Page 40: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Gate Implementation for Example 3-8

40

Page 41: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

F(x, y, z) =(1, 3, 4, 6) =(0, 2, 5, 7)

F(x, y, z) =(1, 3, 4, 6) =(0, 2, 5,7)F = x’z + xz‘F’ = xz + x’z’ F = (x’ + z’)(x + z)

41

Page 42: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Sometimes a function table or map contains entries for which it is known:◦ the input values for the minterm will never occur, or◦ The output value for the minterm is not used

In these cases, the output value need not be defined Instead, the output value is defined as a “don't care” By placing “don't cares” ( an “x” entry) in the function table

or map, the cost of the logic circuit may be lowered. Example 1: A logic function having the binary codes for

the BCD digits as its inputs. Only the codes for 0 through 9 are used. The six codes, 1010 through 1111 never occur, so the output values for these codes are “x” to represent “don’t cares.”

Page 43: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Example 3-9

product of sums?

43

Page 44: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

3-7 NAND and NOR Implementation

Digital circuits are frequently constructed with NANDor NOR gates rather than with AND and OR gates

44

Page 45: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

NAND CircuitsNAND gate: a universal gate

– Any digital system can be implemented with it• including AND, OR and complement

=

45

Page 46: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Two-Level Implementation with NAND

sum of product expression and its equivalentNAND implementation

F = AB + CD

= [(AB + CD)’]’

= [(AB)’*(CD)’]’

46

Page 47: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Example 3-10Implement the following Boolean function with NAND gates

47

Page 48: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Procedures of Implementation withtwo levels of NAND gates

1. Express simplified function in sum of products

2. Draw a NAND gate for each product term thathas at least two literals to constitute a group offirst-level gates

3. Draw a singlegate using AND-invert or invert-OR in the second level

4. A term witha single literal requires an inverter inthe first level

48

Page 49: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Multilevel NAND Circuits1. Convert all AND gates to NAND gates with AND-invert graphic symbols

2. Convert all OR gates to NAND gates with invert-OR graphic symbols3. Check all the bubbles in the diagrams. For a single bubble, invert an

inverter (one-input NAND gate) or complement the input literal

49

Page 50: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Figure 3-23 Implementing F=(AB’ + A’B)(C+D’)

50

Page 51: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

NOR Circuite•The NOR operation is the dualof the NAND operation•The NOR gate is anothar universal gate to implement anyBoolean function

=

51

Page 52: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

NOR Implementation

Transformation from OR-ANDdiagram to NOR diagram•OR gates => OR-invert•AND gate => invert-AND

52

Page 53: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

3-8 Other Two-level Implementationswired logic: some NAND or NOR gates allow a cirect wire

connection between the outputs of two gates to provide aspecific logic function

– The wired-AND gate or wired-OR gate is not a physical second-levelgate, but only a symbol

53

Page 54: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Nondegeneratd Forms• 16 possible combinations of two-level forms with 4

types of gates: AND, OR, NAND, and NOR– 8 degenerate forms: degenerate to a single operation– 8 generate forms

• NAND-AND = AND-NOR = AND-OR-INVERT• OR-NAND = NOR-OR = OR-AND-INVERT

NOR x OR 3-6NOR

= NAND 3-6 AND

3-4 OR x NOR

NAND

OR

AND 3-4 NAND =

1 \ 2

AND

st nd NORNANDORAND

54

Page 55: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

AND-OR-INVERT ImplementationAND-NOR = NAND-AND = AND-OR-INVERT

F = (AB + CD + E)’

Similar to AND-OR, AND-OR-INVERT requires anexpression in sum of products

Given F, we can implement F’ with AND-OR-INVERT

55

Page 56: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

OR-AND-INVERT Implementation

OR-NAND = NOR-OR = OR-AND-INVERTF = [ (A+B) (C+D) E ] ’

Similar to OR-AND, OR-AND-INVERT requires anexpression in products of sumGiven F, we can implement F’ with OR-AND-INVERT

56

Page 57: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Exxmple 3-11Other Two-levelImplementations

F = x’y’z’ + xyz’

F’ = x’y + xy’ + z

F = (x’)’ = (x’y + xy’ + z)’

57

Page 58: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

XOR: x y = xy’ + x’y Exclusive-NOR = equivalenxe

(x y)’ = (xy’ + x’y)’= (x’ + y)(x + y’) = x’y’ + xy

Communtative: A B = B AAssociative: (A B) C = A(B C) = A B C

Only a limited number of Booleanfunctions can be expressed in terms of

XOR operations, but it is particularlyuseful in arithmetic operations and

error-detection and correction circuits

3-8 Exclusive-OR (XOR) Function

58

Page 59: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Odd Function• The 3-variable XOR function is equal to 1 if only one variable

is equal to 1 or if all three variables are equal to 1• Multiple-variable exclusive OR operation = odd function : odd

number of variables be equal to 1

59

Page 60: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

map for a 4-variable XOR Function

60

Page 61: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

Parity Generation and Checking

parity bit: an extra bit included with a binary messagetomake the number of 1’s either odd or even

3-bit even-parity-generatorP=xyz

61

Page 62: Chapter 3 Gate-level Minimization 1. Chapter3: Gate-level Minimization 3-2 The Map Method Two-variable map and Three-variable map 3-3 Four-Variable Map

4-bit Even-Parity-Checker

C = xyzP

P = 04-bit even parity checker= 3-bit even parity generator

62