Gate-Level Minimization - Princess Sumaya University for Technology

advertisement
Princess Sumaya Univ.
Computer Engineering Dept.
Chapter 3:
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Karnaugh Map
 Adjacent Squares
● Number of squares = number of combinations
♦ Each square represents a minterm
♦ 2 Variables  4 squares
♦ 3 Variables  8 squares
♦ 4 Variables  16 squares
● Each two adjacent squares differ in one variable
♦ Two adjacent minterms can be combined together
Example:
F = x y + x y’
= x ( y + y’ )
=x
1 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Two-variable Map
x y
Minterm
0
0 0
m0
xy
1
0 1
m1
2
1 0
m2
3
1 1
m3
xy
xy
xy
m1
m2
m3
0
1
y
x
Note: adjacent squares
horizontally and vertically
NOT diagonally
m0
0 xy
xy
1 xy
xy
2 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Two-variable Map
 Example
x y
F
Minterm
0
0 0
0
m0
xy
1
0 1
0
m1
2
1 0
0
m2
3
1 1
1
m3
xy
xy
xy
m0
m1
m2
m3
0
1
y
y
x
x
0
0
0 xy
xy
0
1
1 xy
xy
3 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Two-variable Map
 Example
x y
F
Minterm
0
0 0
0
m0
xy
1
0 1
1
m1
2
1 0
1
m2
3
1 1
1
m3
xy
xy
xy
m0
m1
m2
m3
y
y
x
0
1
1
1
F  x yxyxy
( x  x) y x ( y  y )
F  yx
x
0
1
0 xy
xy
1 xy
xy
4 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Three-variable Map
x y z
Minterm
0
0 0 0
m0 x y z
1
0 0 1
m1
xyz
2
0 1 0
m2
3
0 1 1
m3
4
1 0 0
m4
x yz
x yz
xyz
5
1 0 1
m5
xyz
6
1 1 0
m6
7
1 1 1
m7
xyz
xyz
m0
m1
m3
m2
m4
m5
m7
m6
00
01
11
10
yz
x
0 x yz x yz x yz x yz
1 xyz xyz xyz xyz
5 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Three-variable Map
 Example
x y z
F Minterm
m0
m4
m1
m5
m3
m7
m2
m6
00
01
11
10
yz
0 0 0 0
0 m0 x y z
1 0 0 1
0 m1 x y z
0 x yz x yz x yz x yz
2 0 1 0
1 m2 x y z
3 0 1 1
1 m3 x y z
1 xyz xyz xyz xyz
4 1 0 0
1 m4 x y z
5 1 0 1
1 m5 x y z
6 1 1 0
0 m6 x y z
7 1 1 1
0 m7 x y z
x
y
x
0
0
1
1
1
1
0
0
z
F xy  xy
6 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Three-variable Map
 Example
x y z
F Minterm
m0
m4
m1
m5
m3
m7
m2
m6
00
01
11
10
yz
0 0 0 0
0 m0 x y z
1 0 0 1
0 m1 x y z
0 x yz x yz x yz x yz
2 0 1 0
0 m2 x y z
3 0 1 1
1 m3 x y z
1 xyz xyz xyz xyz
4 1 0 0
1 m4 x y z
5 1 0 1
0 m5 x y z
6 1 1 0
1 m6 x y z
7 1 1 1
1 m7 x y z
x
y
x
0
0
1
0
1
0
1
1
z
F  xz  y z  x y
Extra
7 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Three-variable Map
y
 Example
x y z
F Minterm
0 0 0 0
0 m0 x y z
1 0 0 1
1 m1 x y z
2 0 1 0
0 m2 x y z
3 0 1 1
1 m3 x y z
4 1 0 0
0 m4 x y z
5 1 0 1
1 m5 x y z
6 1 1 0
0 m6 x y z
7 1 1 1
1 m7 x y z
x
0
1
1
0
0
1
1
0
z
F  x yzx yzxyzxyz
x z ( y  y)
xz
x z ( y  y)
xz
z
x
y
0
1
1
0
0
1
1
0
z
8 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Three-variable Map
 Example
x y z
F Minterm
m0
m4
m1
m5
m3
m7
m2
m6
00
01
11
10
yz
0 0 0 0
1 m0 x y z
1 0 0 1
0 m1 x y z
0 x yz x yz x yz x yz
2 0 1 0
1 m2 x y z
3 0 1 1
0 m3 x y z
1 xyz xyz xyz xyz
4 1 0 0
1 m4 x y z
5 1 0 1
1 m5 x y z
6 1 1 0
1 m6 x y z
7 1 1 1
0 m7 x y z
x
y
x
1
0
0
1
1
1
0
1
z
F z  xy
9 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Four-variable Map
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
w
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
x
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
y
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
z
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
Minterm
m0 w x y z
m1
wxyz
m2
wx yz
m3
wx yz
m4
wxyz
m5
wxyz
m6
wxyz
m7
wxyz
m8
wx y z
m9
wx y z
m10 w x y z
m11 w x y z
m12 w x y z
m13 w x y z
m14 w x y z
m15 w x y z
m0 m1 m3 m2
m4 m5 m7 m6
m12 m13 m15 m14
m8 m9 m11 m10
yz
wx
00
01
11
10
00 w xyz w xyz w x yz w xyz
01 w xyz w xyz w xyz w xy z
11 wxyz wxyz wxyz wxy z
10 wx yz wx yz wx yz wx yz
10 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Four-variable Map
yz
 Example
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
w
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
x
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
y
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
z
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
wx
F
1
1
1
0
1
1
1
0
1
1
0
0
1
1
1
0
Minterm
m0 w x y z
m1 w x y z
m2 w x y z
m3 w x y z
m4 w x y z
m5 w x y z
m6 w x y z
m7 w x y z
m8 w x y z
m9 w x y z
m10 w x y z
m11 w x y z
m12 w x y z
m13 w x y z
m14 w x y z
m15 w x y z
00
00
01
11
10
01
11
10
w xyz w xyz w x yz
w xyz w xyz w xyz
wxyz wxyz wxyz
wx yz wx yz wx yz
w xyz
w xy z
wxy z
w x yz
y
w
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
0
x
z
F  y  wz  xz
11 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Four-variable Map
Example
Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’
C
B
A
D
12 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Four-variable Map
Example
Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’
C
1
1
B
A
D
13 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Four-variable Map
Example
Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’
C
1
B
A
1
D
14 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Four-variable Map
Example
Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’
C
1
B
A
D
15 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Four-variable Map
Example
Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’
C
B
A
1
1
D
16 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Four-variable Map
Example
Simplify: F = A’ B’ C’ + B’ C D’ + A’ B C D’ + A B’ C’
C
1
A
1
1
1
1
1
B
1
D
F  B D  B C  A CD
17 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Five-variable Map
DE
BC
00
01
11
10
00 m0
m1
m3
m2
00 m16 m17 m19 m18
01 m4
m5
m7
m6
01 m20 m21 m23 m22
11 m12 m13 m15
m14
10 m8
m10
B
D
m9
m11
DE
BC
00
C
B
D
01
11
10
C
11 m28 m29 m31 m30
10 m24 m25 m27 m26
E
E
A=0
A=1
18 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Five-variable Map
A=0
A=1
19 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Implicants
Implicant:
Gives F = 1
C
1
1
1
1
B
1
1
1
A
1
D
20 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Prime Implicants
Prime Implicant:
Can’t grow
beyond this size
C
1
1
1
1
B
1
1
1
A
1
D
21 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Essential Prime Implicants
Not essential
Essential Prime
Implicant:
No other choice
C
1
1
1
1
B
1
1
1
A
1
D
8 Implicants
5 Prime implicants
4 Essential prime implicants
22 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Product of Sums Simplification
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
w
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
x
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
y
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
z
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
y
F F
1
1
1
0
1
1
1
0
1
1
0
0
1
1
1
0
0
0
0
1
0
0
0
1
0
0
1
1
0
0
0
1
w
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
0
z
y
w
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
0
z
F  ( y  z )  (w  x  y )
x
y
w
z
x
z
F
F  y w z x z
F  y z w x y
x F  y z  wx y
y
z
w
x
y
F
23 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Don’t-Care Condition
Example
1 if a quarteris deposited
A
0 otherwise
{
1
B
0
1
C
0
{
{
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
if a dime is deposited
otherwise
if a nicleis deposited
otherwise
$ Value
$ 0.00
$ 0.05
$ 0.10
Not possible
$ 0.25
Not possible
Not possible
Not possible
You can only
drop one coin at
a time.
Used as
“don’t care”
24 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Don’t-Care Condition
Example
A
B
Logic
Circuit
F
C
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
0
1
0
x
1
x
x
x
F ( A, B, C )   (1, 4)
d ( A, B, C )   (3, 5, 6, 7)
Don’t care
what value
F may take
25 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Don’t-Care Condition
Example
A
F
B
C
B
A
0
1
x
0
1
x
x
x
C
F  A B C  AB C
F  AC
26 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Don’t-Care Condition
 Example
F (w, x, y, z) = ∑(1, 3, 7, 11, 15)
d (w, x, y, z) = ∑(0, 2, 5)
x=0
y
x
x=1
x=1
1
1
x
1
x
y
x
0
x=0
x
x
0
x
x
1
w
0
0
0
0
0
0
w
1
z
F  yzwz
z
F  z wy
27 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Universal Gates
 One Type
● Use as many as you need (quantity), but one type only.
 Perform Basic Operations
● AND, OR, and NOT
 NAND Gate
● NOT-AND functions
● OR function can be obtained from AND by Demorgan’s
 NOR Gate
● NOT-OR functions (AND by Demorgan’s)
28 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Universal Gates
 NAND Gate
● NOT:
● AND:
● OR:
A
F=A
A
B
F=A•B
DeMorgan’s
A
F=A+B
B
29 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Universal Gates
 NOR Gate
● NOT:
A
● OR:
A
B
● AND:
F=A
F=A+B
DeMorgan’s
A
F=A•B
B
30 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
NAND & NOR Implementation
 Two-Level Implementation
A
B
A
B
A
B
F
C
D
F
C
D
A
B
F
C
D
A
B
F
F
C
D
C
D
A
B
F
C
D
31 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
NAND & NOR Implementation
 Two-Level Implementation
A
B
A
B
A
B
F
C
D
F
C
D
A
B
F
C
D
A
B
F
F
C
D
C
D
A
B
F
C
D
32 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
NAND & NOR Implementation
 Multilevel NAND Implementation
C
D
B
A
B
C
F
C
D
B
A
B
C
C
D
B
A
B
C
F
F
33 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
NAND & NOR Implementation
 Multilevel NOR Implementation
A
B
A
B
C
D
F
A
B
A
B
F
C
D
A
B
A
B
F
C
D
34 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Gate Shapes
 AND
 OR
 NAND
 NOR
35 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Other Implementations
 AND-OR-Invert
 OR-AND-Invert
36 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Implementations Summary
 Sum Of Products:
● AND-OR
● AND-OR-Invert = AND-NOR = NAND-AND
Products Of Sums
● OR-AND
● OR-AND-Invert = OR-NAND = NOR--OR
37 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Exclusive-OR
 XOR
F=xy=xy+xy
x
x
F
F
y
y
 XNOR
F=xy=xy=xy+xy
x
x
F
y
F
y
38 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Exclusive-OR
 Identities
●x0=x
●x1=x
●xx=0
●xx=1
x
0
0
1
1
y
0
1
0
1
XOR
0
1
1
0
●xy=xy=xy
Commutative & Associative
●xy=yx
●(xy)z=x(yz)=xyz
39 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Exclusive-OR Functions
 Odd Function
F=xyz
F = ∑(1, 2, 4, 7)
x
y
z
F
 Even Function
F=xyz
y
z
XOR
XNOR
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
1
0
1
0
0
1
1
0
0
1
0
1
1
0
yz
F = ∑(0, 3, 5, 6)
x
y
z
x
x
F
00
01
11
10
0
0
1
0
1
1
1
0
1
0
40 / 50
4241 – Digital Logic Design
Princess Sumaya University
Computer Engineering Dept.
Parity
1
0
1
0
1
0
0
0
1
0
1
0
1
Parity
Generator
1
0
0
0
1

Parity
Checker
41 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Parity Generator
 Odd Parity
1
0
1
0
1
0
1
0
1
Odd number of ‘1’s
 Even Parity
1
0
1
0
1
0
1
0
0
Even number of ‘1’s
42 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Parity Checker
 Odd Parity
1
0
1
0
1
Error
Check
 Even Parity
1
0
1
0
0
Error
Check
43 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Homework
 Mano
● Chapter 3
♦ 3-1
♦ 3-3
♦ 3-5
♦ 3-7
♦ 3-9
♦ 3-15
♦ 3-16
♦ 3-18
♦ 3-22
44 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Homework
 Mano
3-1
Simplify the following Boolean functions, using threevariable maps:
(a) F (x, y, z) = ∑(0, 2, 6, 7)
(b) F (A, B, C) = ∑(0, 2, 3, 4, 6)
(c) F (a, b, c) = ∑(0, 1, 2, 3, 7)
(d) F (x, y, z) = ∑(3, 5, 6, 7)
45 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Homework
3-3
Simplify the following Boolean functions, using threevariable maps:
(a) xy + x’y’z’ + x’yz’
(b) x’y’ + xz + x’yz’
(c) A’B + BC’ + B’C’
3-5
Simplify the following Boolean functions, using fourvariable maps :
(a) F (w, x, y, z) = ∑(1, 4, 5, 6, 12, 14, 15)
(b) F (A, B, C, D) = ∑(0, 1, 2, 4, 5, 7, 11, 15)
(c) F (w, x, y, z) = ∑(2, 3, 10, 11, 12, 13, 14, 15)
(d) F (A, B, C, D) = ∑(0, 2, 4, 5, 6, 7, 8, 10, 13, 15)
46 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Homework
3-7
Simplify the following Boolean functions, using fourvariable maps:
(a) w’z + xz + x’y + wx’z
(b) B’D + A’BC’ + AB’C + ABC’
(c) AB’C + B’C’D’ + BCD + ACD’ + A’B’C + A’BC’D
(d) wxy + yz + xy’z + x’y
3-9
Find the prime implicants for the following Boolean
functions, and determine which are essential:
(a) F (w, x, y, z) = ∑(0, 2, 4, 5, 6, 7, 8, 10, 13, 15)
(b) F (A, B, C, D) = ∑(0, 2, 3, 5, 7, 8, 10, 11, 14, 15)
(c) F (A, B, C, D) = ∑(1, 3, 4, 5, 10, 11, 12, 13, 14, 15)
47 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Homework
3-15 Simplify the following Boolean function F, together with
the don’t-care conditions d, and then express the
simplified function in sum of products:
(a) F (x, y, z) = ∑(0, 1, 2, 4, 5)
d (x, y, z) = ∑(3, 6, 7)
(b) F (A, B, C, D) = ∑(0, 6, 8, 13, 14)
d (A, B, C, D) = ∑(2, 4, 10)
(c) F (A, B, C, D) = ∑(1, 3, 5, 7, 9, 15)
d (A, B, C, D) = ∑(4, 6, 12, 13)
48 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Homework
3-16 Simplify the following expressions, and implement them
with two-level NAND gate circuits:
(a) AB’ + ABD + ABD’ + A’C’D’ + A’BC’
(b) BD + BCD’ + AB’C’D’
3-18 Draw a logic diagram using only two-input NAND gates
to implement the following expression:
(AB + A’B’) (CD’ + C’D)
49 / 50
Princess Sumaya University
4241 – Digital Logic Design
Computer Engineering Dept.
Homework
3-22 Convert the logic diagram of the circuit shown in Fig. 4-4
into a multiple-level NAND circuit.
z
D
C
y
B
x
A
w
50 / 50
Download