Verilog HDL
Chapter 3 Gate-Level
Minimization
Overview
Chap 3
bL1
Circuit Optimization
Chap 3
3
bL1
Literal Cost
Chap 3
F = BD + A BC + A C D
L=8
F = BD + A BC + A B D+ AB C
L = 11
F = (A + B)(A + D)(B + C + D)( B + C + D) L = 10
Which solution is best? (first verify the equality)
Example 1:
GN = G + 2 = 9
L= 5
F=A+ B C + BC
G= L+ 2 = 7
B
C
A
Example 2:
A
B
C
F = A B C + AB C
L = 6 G = 8 GN = 11
F = (A + C)( B + C)( A + B)
L = 6 G = 9 GN = 12
Chap 3
10
11
Function Table
Input
Function
Values
Value
(x,y)
F(x,y)
00
a
01
b
10
c
11
d
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
K-Map
y=0
x=0 a
x=1 c
y=1
b
d
12
Example: F(x,y) = x
x=1
F( x , y ) x y x y x
13
Example: G(x,y) = x + y
G = x+y y = 0 y = 1
x=0
x=1
reduce y
reduce x
G( x , y ) x y x y xy x y x y
Duplicate xy
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
14
A three-variable K-map:
yz=00
yz=01
yz=11
yz=10
x=0
m0
m1
m3
m2
x=1
m4
m5
m7
m6
yz=01
yz=11
yz=10
x=0 x y z
xyz
xyz
xyz
xyz
xyz
xyz
x=1
xyz
Note that if the binary value for an index differs in one bit
position, the minterms are adjacent on the K-Map
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
15
x
x
00 01 11 10
0 0
x 1
yz
z
Logic & Computer Design Fundamentals
16
Example Functions
Chap 3
F(x, y, z) m(2,3,4,5)
x 41
Example:
G(a, b, c) m(3,4,6,7)
Learn the locations of the 8
indices based on the variable
order shown (x, most significant
and z, least significant) on the
map boundaries
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
x 41
1
7
1
2
6
z
17
Combining Squares
Chap 3
On a 3-variable K-Map:
One square represents a minterm with three variables
Two adjacent squares represent a product term with two
variables (apply identities 7,14 one time)
Four adjacent terms represent a product term with
one variable (apply identities 7,14 three times)
Eight adjacent terms is the function of all ones (no
variables) = 1. (apply identities 7,14 seven times)
18
Example: Let
F m(2,3,6,7)
0
x1
00
01
1
7
1
11
1
6
1
10
F ( x, y , z ) x y z x y z x y z x y z
yz y z
y
19
Three-Variable Maps
Chap 3
20
Three-Variable Maps
Chap 3
Venn Diagram
0
Cylinder
4 X
6 7 5
Y 3 Z
1
2
21
Three-Variable Maps
Chap 3
YZ
00
01
0
0
XY
4
11
10
2
XZ
YZ
5
7
z
Read off the product terms for the
rectangles shown
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
22
Three-Variable Maps
Chap 3
YZ
00
01
11
Y
4
Z
5
10
Z
6
z
Read off the product terms for the
rectangles shown
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
23
xy
1 1 1
x
1 1
z
F(x, y, z)
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
zxy
24
YZ 00
0
01
11
1 XY 1
1
10
Z
1 XY 1
F = XY + XY + Z
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
25
01
00
Variable Order
11
W
10
10
12
13
15
14
11
10
00
01
11
Z
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
26
corresponding to:
A single 1 = 4 variables, (i.e. Minterm)
Two 1s = 3 variables,
Four 1s = 2 variables
Eight 1s = 1 variable,
Sixteen 1s = zero variables (i.e.
Constant "1")
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
27
Four-Variable Maps
Chap 3
YZ
01
00
00
01
11
10
4
12
8
11
10
WY
7
XZ
5
XZ
13
15
14
10
11
Z
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
28
Four-Variable Maps
Chap 3
YZ
Y
01
00
00
01
11
W
10
4
Y
12
8
11
10
W
5
X Z
13
15
14
10
11
ZX
X
Z
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
29
YZ
01
00
00
01
1 4
12
11
W
10
11
5
1 WX
17
XZ 15
13
1
1
9
11
10
2 XZ
1
1
6
14
10
Z
Logic & Computer Design Fundamentals
30
F(W, X, Y, Z) m(3,4,5,7,9,13,14,15)
WX
YZ
00
01
11
W
10
01
00
11
10
2
3
1
WYZ
6
4
1WXY
15
17
XZ
13
12
15
14
1 WXY1
1
WYZ
9
8
11
10
1
Z
Logic & Computer Design Fundamentals
31
Systematic Simplification
Chap 3
32
BD
1
BD
BD
BD
AB
1
B
B
1
D
AD
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
BC
33
B
1
D
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
34
Another Example
Chap 3
G(A, B, C, D) m(0,2,3,4,7,12,13,14,15)
Hint: There are seven prime implicants!
C
1
1
B
D
Logic & Computer Design Fundamentals
35
XX
W
W
W
Z
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
Z
ZZ
Logic & Computer Design Fundamentals
36
37
1
1
A
1
1
1
B
1
Essential
Selected
1
B
A
1
1
D
38
Essential
C
1
39
Product-of-Sums Simplification
Chap 3
Concept: mi = Mi
How to derive a POS using SOP derivation:
Derive F = mi+mj +mn F = Mi Mj Mn
C
F = AB + CD + BD
B
F = (A+B)(C+D)(B+D)
D
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
40
Product-of-Sums Simplification
Chap 3
F = AB + CD + AD + BC
F = AC + BD
F = (A+C)(B+D)
D
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
41
42
and a single output Z. The circuit that receives the output Z observes it
only for (A,B,C) = (1,1,1) and otherwise ignores it. Thus, Z is
specified only for the combinations (A,B,C,Y) = 1110 and 1111. For
these two combinations, Z = Y. For all of the 14 remaining input
combinations, Z is a dont care.
Ultimately, each x entry may take on either a 0 or 1 value in
resulting solutions
For example, an x may take on value 0 in an SOP solution and
value 1 in a POS solution, or vice-versa.
Any minterm with value x need not be covered by a prime implicant.
Y
A
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
X
X
X
X
X
X
X
X
X X
X X
B
1 0
X X
C
43
X12 X13
18 19
z
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
44
B
A
F = CD + AD
F = CD + AB
F = D + AC
F = D ( A+C)
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
45
1
A
Essential
Selected
B
x
1
B
46
F(A, B, C, D) m(3,9,11,12,13,14,15)
d (1,4,6)
Hint: Use F and complement it to get the result.
C
F = AB + BD
F = (A + B) (B + D)
D
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
47
Universal
Chap 3
48
Why?
Implementation feasibility and low cost
Power in implementing Boolean functions
Convenient conceptual representation
Gate classifications
Primitive gate - a gate that can be described using a
single primitive operation type (AND or OR) plus an
optional inversion(s).
Complex gate - a gate that requires more than one
primitive operation type for its description
49
Buffer
Chap 3
50
NAND Gate
Chap 3
AND-Invert (NAND)
X
Y
Z
F( X , Y, Z ) X Y Z
51
F( X , Y , Z ) X Y Z
52
x
y
xy
x
y
xy=x+y
53
54
Converting procedures
Simplify the function and express it in sum-ofproducts form,
For each line connecting to the 2-level OR gate,
insert two inverters the its two ends,
Transform the invert-OR gate to NAND gate.
F = XY + XY + Z
1
F = XY + XY + Z
F = XY XY Z
55
56
C
D
B
B
A
B
C
A
B
A
B
C
D
D
57
NOR Gate
Chap 3
OR-Invert (NOR)
X
Y
Z
F(X, Y, Z) X +Y Z
58
59
x
y
x+y
x
y
x+y=xy
60
A
B
A
A
B
C
D
61
62
Definitions
The XOR function is: X Y X Y X Y
The eXclusive NOR (XNOR) function, otherwise
known as equivalence is: X Y X Y X Y
63
XNOR
Y XY
0
0
1
1
0
1
0
1
0
0
1
1
0
1
1
0
Y (XY)
or X Y
0
1
1
0
0
0
1
1
64
XOR/XNOR (Continued)
Chap 3
X0 X
X 1 X
XX 0
XX 1
XY YX
( X Y) Z X ( Y Z ) X Y Z
65
XOR symbol:
XNOR symbol:
66
XOR Implementations
Chap 3
= x(x+y)
Y
= xxy
A NAND only implementation is:
X
X Y
Y
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
67
01
11
1O
00
01
11
10
O E O E
E O E O
O E O E
68
F
F
W
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
69
70
Add odd parity bit to generate code words with even parity
Add even parity bit to generate code words with odd parity
Use odd parity circuit to check code words with even parity
Use even parity circuit to check code words with odd parity
0
Example: n = 3. Generate even
X
parity code words of length 4 with Y 0
odd parity generator:
1
Z
Check even parity code words of X 0
length 4 with odd parity checker: Y 0
Operation: (X,Y,Z) = (0,0,1) gives
1
Z
(X,Y,Z,P) = (0,0,1,1) and E = 0.
1
If Y changes from 0 to 1 between P
generator and checker, then E = 1 indicates an error.
2004 Pearson Education, Inc.
Modified by Y. L. Li, CIS/NCTU
71
Terms of Use
Chap 3
72