You are on page 1of 48

Chapter 3

Gate-Level Minimization

 原編者 : 嚴茂旭 副教授


 修改 : 盧晃瑩
3-1 Introduction

• Gate-level minimization is the design task of finding an optimal g


ate-level implementation of Boolean functions describing a digita
l circuit.

• Example: F1 = x’y + xy = (x’ + x)y = y

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


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

Gate-Level Minimization 3-2


3-2 The Map Method
• The complexity of the digital logic gates
– the complexity of the algebraic expression

• Logic minimization
– (1) algebraic approaches: lack specific rules
– (2) the Karnaugh map (or K-map)
» a pictorial form of a truth table
» applicable if the # of variables < 7

• A K-map is made up of squares


– each square represents one minterm

Gate-Level Minimization 3-3


Any two adjacent squares in the
Two-Variable Map map differ by only on variable

• A two-variable map
– four minterms
– x' = row 0; x = row 1
– y' = column 0;
y = column 1
– a truth table in square diagram X ’Y + XY = Y
– xy
– x+y=

Gate-Level Minimization 3-4


Three-variable map
– eight minterms
– the Gray code sequence
– any two adjacent squares in the map differ by only on variable

Gate-Level Minimization 3-5


Adjacencies of three-variable maps

Gate-Level Minimization 3-6


Example 3-1

Gate-Level Minimization 3-7


Example 3-2

Gate-Level Minimization 3-8


Example 3-3

Gate-Level Minimization 3-9


Example 3-4
– F = A'C + A'B + AB'C + BC
– express it in sum of minterms
– find the minimal sum of products expression

Gate-Level Minimization 3-10


3-3 Four-Variable Map
X ’Y + XY = Y
• The K-map
– 16 minterms
– combinations of 2, 4, 8, and 16 adjacent squares
– F(w, x, y, z)

Gate-Level Minimization 3-11


Example 3-5

Gate-Level Minimization 3-12


Example 3-6

F = ABC + BCD +
ABCD + ABC

Gate-Level Minimization 3-13


K-map
• In choosing adjacent squares in a map, we must ensure th
at
1. all the minterms of the function are covered when we combine the
squares,
2. the number of terms in the expression is minimized, and
3. there are no redundant terms (i.e., minterms already covered by ot
her terms).
• Prime Implicant:
– a product term obtained by combining the maximum possible number of ad
jacent squares (combining all possible maximum numbers of squares)
• Essential Prime Implicant:
– a minterm is covered by only one prime implicant
– the essential P.I. must be included

Gate-Level Minimization 3-14


K-map F ( A, B, C , D )   (0, 2,3,5,7,8, 9,10,11,13,15)

– the simplified expression may not be unique


– F = BD + B'D‘ + CD + AD = BD + B'D‘ + CD + AB
= BD + B'D‘ + B'C + AD = BD + B'D‘ + B'C + AB'
Gate-Level Minimization
3-15
Five-Variable Map
• Map for more than four variables becomes complicated
– five-variable map: two four-variable map (one on the top of the other)

Gate-Level Minimization 3-16


• Example 補充題
– F = S(0, 2, 4, 6, 9, 13, 21, 23, 25, 29, 31)

F = A'B'E’ + BD'E + ACE

Gate-Level Minimization 3-17


3-4 Product of Sums Simplification

• Approach #1
– Simplified F' in the form of sum of products
– Apply DeMorgan's theorem F = (F')'
– F': sum of products => F: product of sums
• Approach #2: duality (X ’+Y )(X + Y) = Y
– combinations of maxterms (it was minterms)
– M0M1 = (A + B + C + D)(A + B + C + D‘) = (A + B +
C) + (DD’) =A+B+C
CD
AB 00 01 11 10
00 M0 M1 M3 M2
01 M4 M5 M7 M6
11 M12 M13 M15 M14
10 M8 M9 M11 M10

Gate-Level Minimization 3-18


Example 3-7
F = S(0, 1, 2, 5, 8, 9, 10)

– F' = AB + CD + BD'
– Apply DeMorgan's theorem; F = (A‘ + B‘ )(C‘ + D‘ )( B‘ + D )

Gate-Level Minimization 3-19


Gate implementation of the function of Example 3-7

• F = S(0, 1, 2, 5, 8, 9, 10)

Gate-Level Minimization 3-20


Consider the function defined in Table 3.1.

In sum-of-
minterm:
F ( x, y , z )   (1, 3, 4, 6)

In product-of-maxterm:

Gate-Level Minimization
3-21
Consider the function defined in Table 3.1.

Combine the 1’s:


F ( x, y , z )   (1,3, 4,6)

F ( x, y , z )  x z  xz 

Combine the 0’s :

F ( x, y , z )  ( x   z )( x  z )

Gate-Level Minimization
3-22
3-5 Don't-Care Conditions

• The value of a function is not specified for certain combinations


of variables
– BCD; 1010-1111: don't care

• The don't care conditions can be utilized in logic minimization


– can be implemented as 0 or 1

• Example 3-8
– F(w, x, y, z) = S(1, 3, 7, 11, 15)
– d(w, x, y, z) = S(0, 2, 5) <= Don't-Care

Gate-Level Minimization 3-23


Example 3-8 F(w, x, y, z) = S(1, 3, 7, 11, 15)
d(w, x, y, z) = S(0, 2, 5)

F = S(0, 1, 2, 3, 7, 11, 15) F = S(1, 3, 5, 7, 11, 15)

Gate-Level Minimization 3-24


3-6 NAND and NOR Implementation
• NAND gate is a universal gate
– can implement any digital system

x x’

Gate-Level Minimization 3-25


Two graphic symbols for a NAND gate

Gate-Level Minimization 3-26


Two-level Implementation
– two-level logic
– NAND-NAND = sum of products
– Example: F = AB + CD
– F = ((AB)' (CD)' )' = AB + CD

Gate-Level Minimization 3-27


Example 3-9 F ( x, y , z )   (1, 2,3, 4,5, 7)
F ( x, y, z )  xy   xy  z

• The procedure
– simplified in the form of sum of products
– a NAND gate for each product term; the inputs to
each NAND gate are the literals of the term
– a single NAND gate for the second sum term
– A single literal requires an inverter in the first level
Gate-Level Minimization
3-28
Multilevel NAND Circuits
• Boolean function implementation
– AND-OR logic => NAND-NAND logic
» AND => NAND + inverter
» OR: inverter + OR = NAND

Gate-Level Minimization 3-29


NAND Implementation

Gate-Level Minimization 3-30


NOR Implementation
• NOR function is the dual of NAND function
• The NOR gate is also universal

x x’

Gate-Level Minimization 3-31


• Two graphic symbols for a NOR gate

Example: F = (A + B )(C + D )E

Gate-Level Minimization 3-32


• Two graphic symbols for a NOR gate

Example: F = (AB + AB )(C + D )

Gate-Level Minimization 3-33


3-7 Other Two-level Implementations
• Wired logic
– a wire connection between the outputs of two gates
– open-collector TTL NAND gates: wired-AND logic
– the NOR output of ECL gates: wired-OR logic

F  ( AB )  (CD )  ( AB  CD )  ( A  B)(C   D) AND-OR-INVERT function


F  ( A  B )  (C  D )  [( A  B )(C  D )] OR-AND-INVERT function

Gate-Level Minimization
3-34
Nondegenerate Forms
• 16 possible combinations of two-level forms (AND, OR, NAND, N
OR)
– eight of them: degenerate forms = a single operation
» AND-AND, AND-NAND, OR-OR, OR-NOR
» NAND-OR, NAND-NOR, NOR-AND, NOR-NAND

– The eight nondegenerate forms


» AND-OR, OR-AND, NAND-NAND, NOR-NOR, NOR-OR, NAND-AND,
OR-NAND, AND-NOR
» AND-OR and NAND-NAND = sum of products
» OR-AND and NOR-NOR = product of sums
» NOR-OR, NAND-AND, OR-NAND, AND-NOR = ?

Gate-Level Minimization 3-35


AND-OR-Invert (AND-NOR ) Implementation
• AND-OR-INVERT (AOI) Implementation
– NAND-AND = AND-NOR = AOI
– F = (AB + CD + E)'
– F' = AB + CD + E (sum of products)

Gate-Level Minimization 3-36


– simplify F' in sum of products
OR-AND-INVERT (OAI) Implementation
• OR-AND-INVERT (OAI) Implementation
– OR-NAND = NOR-OR = OAI
– F = ((A + B)(C + D)E)'
– F' = (A + B)(C + D)E (product of sums)

Gate-Level Minimization 3-37


Tabular Summary and Examples

Gate-Level Minimization 3-38


Example 3-10

– F' = x'y + xy' + z (F': sum of products)


– F = (x’y + xy’ + z)’ (F: AOI implementation)

Gate-Level Minimization 3-39


Example 3-10

– F = x‘y’z’ + xyz’ (F: sum of products)


– F' = (x + y + z)(x’ + y’ + z) (F': product of sums)
– F = ((x + y + z)(x’ + y’ + z))' (F: OAI)

Gate-Level Minimization 3-40


3-8 Exclusive-OR Function
• Exclusive-OR (XOR)
– x Å y = xy’ + x'y
• Exclusive-NOR (XNOR)
– (x Å y)' = xy + x'y'
• Some identities
–xÅ 0=x
– x Å 1 = x'
–xÅ x=0
– x Å x' = 1
– x Å y' = (x Å y)'
– x‘ Å y = (x Å y)'
• Commutative and associative
–AÅ B=BÅ A
– (A Å B) Å C = A Å (B Å C) = A Å B Å C

Gate-Level Minimization 3-41


• Implementations
– (x‘ + y')x + (x‘ + y')y = xy‘ + x'y = x Å y

Gate-Level Minimization 3-42


Odd and Even functions
– A Å B Å C = (AB’ + A’B)C’ + (AB + A’B’)C
= AB’C’ + A’BC’ + ABC + A’B’C = S(1, 2, 4,
7)
– an odd number of 1's

Gate-Level Minimization 3-43


Logic diagram of odd and even functions

Gate-Level Minimization 3-44


• Four-variable Exclusive-OR function
– A Å B Å C Å D = (AB’ + A’B) Å (CD’ + C’D) =
(AB’ + A’B)(CD + C’D’) + (AB + A’B’)(CD’ + C’D)

Gate-Level Minimization 3-45


Parity Generation and Checking
• Parity Generation and Checking
• Messages x, y, z => x, y, z , P ….. parity check: C = x Å y Å z Å P
– a even parity bit: P=xÅ yÅ z

– even parity check: C = x Å y Å z Å P


» C = 1: an odd number of bit error
» C = 0: correct or an even number of bit error

Gate-Level Minimization 3-46


Parity Generation and Checking

Gate-Level Minimization 3-47


Parity Generation and Checking

Gate-Level Minimization 3-48

You might also like