Professional Documents
Culture Documents
CS301Y22 - Chapter 3 - Gate-Level Minimization
CS301Y22 - Chapter 3 - Gate-Level Minimization
OUTLINE OF CHAPTER 3
• Logic minimization
– Algebraic approaches: lack of specific rules
– Product of sums
– Four minterms 0 m0 m1
– xy x 1 xy’ xy
– xy = m3 0
• Fig. 3.2(b): x 1 1
0 1
x 1 1 1
(b) x+y
Figure 3.2 Two-variable Map
November, 2022 LOGIC DESIGN
10
the next.
z
xz
z
yz y
x F = x’y + xy’
00 01 11 10
m0 m1 m3 m2
0
1 1
m4 m5 m7 m6
x 1
1 1
yz y
x F = yz + xz’
00 01 11 10
m0 m1 m3 m2
0
1
m4 m5 m7 m6
x 1
1 1 1
• Any such combination represents the logical sum of four minterms and
results in an expression of only one literal.
– 1,2,4 and 8.
z
November, 2022 LOGIC DESIGN
17
yz y
x F = z’ + xy’
00 01 11 10
m0 m1 m3 m2
0
1 1
m4 m5 m7 m6
x 1
1 1 1
BC B F = C + A’B
A 00 01 11 10
m0 m1 m3 m2
0
1 1 1
m4 m5 m7 m6
A 1
1 1
F O U R - VA R I A B L E M A P
• 16 minterms
• Combinations of 2, 4, 8, and 16 adjacent squares
yz y yz y
wx 00 01 11 10 wx 00 01 11 10
m0 m1 m3 m2 m0 m1 m3 m2
00 00
w’x’y’z’ w’x’y’z w’x’yz w’x’yz’
m4 m5 m7 m6 m4 m5 m7 m6
01 01
w’xy’z’ w’xy’z w’xyz w’xyz’
x x
m12 m13 m15 m14 m12 m13 m15 m14
11 11
wxy’z’ wxy’z wxyz wxyz’
w w
m8 m9 m11 m10 m8 m9 m11 m10
10 10
wx’y’z’ wx’y’z wx’yz wxyz’
z z
F O U R - VA R I A B L E M A P
• Minimization of four-variable • 2 adjacent squares
Boolean function is similar to – A term of 3 literals.
three-variable functions. • 4 adjacent squares
• Adjacent squares are defined to – A term of 2 literal.
F O U R - VA R I A B L E M A P
• Example 3.5: simplify F(w, x, y, z) = S(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)
yz y
wx 00 01 11 10 F = y’ + w’z’ + xz’
m0 m1 m3 m2
00
1 1 1
m4 m5 m7 m6
01
1 1 1
x
m12 m13 m15 m14
11
1 1
w
m8 m9 m11 m10
10
1 1
F O U R - VA R I A B L E M A P
• Example 3-6: simplify F = A B C + B C D + A B C D + A B C
CD C
AB 00 01 11 10 F = B’ C’ + A’CD’ + B’D’
m0 m1 m3 m2
00
1 1 1
m4 m5 m7 m6
01
1
B
m12 m13 m15 m14
11
A
m8 m9 m11 m10
10
1 1 1
F O U R - VA R I A B L E M A P
• Prime implicant is a product term obtained by combining the
maximum possible number of adjacent squares in the map.
F O U R - VA R I A B L E M A P
• Simplify F (A, B, C, D) = (0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15)
CD C CD D
AB 00 01 11 10 AB 00 01 11 10
m0 m1 m3 m2 m0 m1 m3 m2
00 00
1 1 1 1 1 1
m4 m5 m7 m6 m4 m5 m7 m6
01 01
1 1 1 1
B B
m12 m13 m15 m14 m12 m13 m15 m14
11 11
1 1 1 1
A A
m8 m9 m11 m10 m8 m9 m11 m10
10 10
1 1 1 1 1 1 1 1
D D
Essential prime implicants BD and B’D’ Prime implicants CD, B’C, AD and AB’
November, 2022 LOGIC DESIGN
28
F O U R - VA R I A B L E M A P
• Essential prime implicants BD and B’D’.
• Prime implicants CD, B’C, AD and AB’.
• Logical sum of two essential prime implicants and any two prime
implicants. There are four possible ways that the function can be
expressed with four product terms of two literals each:
– F = BD + B’D’ + CD + AD
= BD + B’D’ + CD + AB’
= BD + B’D’ + B’C + AD
= BD + B’D’ + B’C + AB’
F I V E - VA R I A B L E M A P
• Maps for more than four variables becomes complicated.
• Five-variable map: two four-variable map (one on the top of the other).
F I V E - VA R I A B L E M A P
A=0 A=1
DE D DE D
BC 00 01 11 10 BC 00 01 11 10
m0 m1 m3 m2 m16 m17 m19 m18
00 00
E E
November, 2022 LOGIC DESIGN
32
F I V E - VA R I A B L E M A P
• Each four-variable map retains the previously defined adjacency when
taken separately.
F I V E - VA R I A B L E M A P
Number
of Number of Literals in a Term in an n-variable
Adjacent Map
Squares
K 2k n=2 n=3 n=4 n=5
0 1 2 3 4 5
1 2 1 2 3 4
2 4 0 1 2 3
3 8 0 1 2
4 16 0 1
5 32 0
Table 3.1 shows the relationship between the number of adjacent squares and the number of literals in
the term.
F I V E - VA R I A B L E M A P
• Example 3.7: simplify F = S(0, 2, 4, 6, 9, 13, 21, 23, 25, 29, 31)
A=0 A=1
DE D DE D
BC 00 01 11 10 BC 00 01 11 10
m0 m1 m3 m2 m16 m17 m19 m18
00 00
1 1
m4 m5 m7 m6 m20 m21 m23 M22
01 01
1 1 1 1
C C
m12 m13 m15 m14 m28 m29 m31 m30
11 11
1 1 1
B B
m8 m9 m11 m10 m24 m25 m27 m26
10 10
1 1
F I V E - VA R I A B L E M A P
P R O D U C T O F S U M S S I M P L I F I C AT I O N
• The 1’s placed in the squares of the map represent the
minterms of the function.
P R O D U C T O F S U M S S I M P L I F I C AT I O N
• Simplify the following function in (a) sum of product and (b) product of
sums:F (A, B, C, D) = (0,1, 2, 5, 8, 9, 10)
CD C
AB 00 01 11 10 F = B’D’ + B’C’ + A’C’D
m0 m1 m3 m2
00
1 1 0 1 F’ = AB + CD + BD’
m4 m5 m7 m6
01
0 1 0 0
Apply DeMorgan’s
B theorem
m12 m13 m15 m14
11
0 0 0 0
A (F’ = (AB + CD + BD’))’
m8 m9 m11 m10
10
1 1 0 1 F = (A’ + B’) (C’ + D’) (B’ + D)
P R O D U C T O F S U M S S I M P L I F I C AT I O N
B’ A’
D’ B’
C’
F F
C’ D’
A’
D D
P R O D U C T O F S U M S S I M P L I F I C AT I O N
• Consider the function defined in x y z F
Table 3.2. 0 0 0 0
• Sum of minterms: 0 0 1 1
– F (x, y, z) = (1, 3, 4, 6)
0 1 0 0
• Product of maxterms:
– F (x, y, z) = (0,2,5,7) 0 1 1 1
BC B 1 0 0 1
A 00 01 11 10
1 0 1 0
m0 m1 m3 m2
0
0 1 1 0 1 1 0 1
m4 m5 m7 m6
A 1 1 1 1 0
1 0 0 1
P R O D U C T O F S U M S S I M P L I F I C AT I O N
yz y
• Sum of minterms:
x 00 01 11 10
– F (x, y, z) = (1, 3, 4, 6) m0 m1 m3 m2
0
– Sum of products: x’z + xz’ 0 1 1 0
m4 m5 m7 m6
• Product of maxterms: x 1
1 0 0 1
– F (x, y, z) = (0, 2, 5, 7)
– Product of sums: (x’+z’) (x+z)
z
D O N ’ T C A R E CO N D I T I O N S
• The value of a function is not specified for certain combinations of
variables
– BCD; 1010-1111: don't care
D O N ’ T C A R E CO N D I T I O N S
• It cannot be marked with a 1 in the map
– It would require that the function always be a 1 for such combination.
D O N ’ T C A R E CO N D I T I O N S
• Simplify the Boolean function F (w, x, y, z) = (1, 3, 7, 11, 15)
– Don’t care conditions d(w, x, y, z) = (0, 2, 5).
yz y yz y
wx 00 01 11 10 wx 00 01 11 10
m0 m1 m3 m2 m0 m1 m3 m2
00 00
X 1 1 X X 1 1 X
m4 m5 m7 m6 m4 m5 m7 m6
01 01
0 X 1 0 0 X 1 0
x x
m12 m13 m15 m14 m12 m13 m15 m14
11 11
0 0 1 0 0 0 1 0
w w
m8 m9 m11 m10 m8 m9 m11 m10
10 10
0 0 1 0 0 0 1 0
F = yz + w’x’ F = yz + w’z
z z
November, 2022 LOGIC DESIGN
46
D O N ’ T C A R E CO N D I T I O N S
• Don’t care minterms in the map are initially marked with X’s.
• The choice between 0 and 1 is made depending on the way the incompletely
specified function is simplified.
• Once the choice is made,
– the simplified function obtained will consist of a sum of minterms
– including those minterms that were initially marked with X’s and
– have been chosen to be included with 1’s.
N A N D A N D N O R I M P L E M E N TAT I O N S
NAND Circuits:
Inverter x x’
• The NAND gate is a universal
gate.
– Can implement any digital
system. x
AND xy
– Complement operation is y
obtained from one-input NAND
gate.
– AND operation requires two
NAND gates x
– OR operation is achieved
through NAND gate with OR (x’y’)’ = x + y
additional inverters in each
input y
N A N D A N D N O R I M P L E M E N TAT I O N S
NAND Circuits:
• Two graphic symbols for NAND gate
x x
y (xyz)’ y (x’ + y’ + z’) = (xyz)’
z z
N A N D A N D N O R I M P L E M E N TAT I O N S
• The implementation of Boolean functions with NAND gates
– Require that the function be in sum of products form.
– F = A.B + C.D
A A A
B B B
F F F
C C C
D D D
N A N D A N D N O R I M P L E M E N TAT I O N S
• Implement the following Boolean function F = (x ,y, z) = (1, 2, 3, 4, 5, 7).
– Simplify the function in sum of products using K-map.
yz y
x F = z + xy’+ x’y
00 01 11 10
m0 m1 m3 m2
0
1 1 1
m4 m5 m7 m6
x 1
1 1 1
N A N D A N D N O R I M P L E M E N TAT I O N S
yz y
x 00 01 11 10 F = z + xy’+ x’y
m0 m1 m3 m2
0
1 1 1
m4 m5 m7 m6
x 1
1 1 1
z
x x x
y’ y y’
x’ x’ x
F F F
y y y
z z z’
N A N D A N D N O R I M P L E M E N TAT I O N S
• The procedure
– Simplify in the form of sum of products;
– A single NAND gate for the second sum term (the second level);
– A term with a single literal requires an inverter in the first level if the
single literal is not complemented. Otherwise it can be connected
directly.
N A N D A N D N O R I M P L E M E N TAT I O N S
• General procedure for converting multilevel AND-OR diagram into all
NAND diagram:
– Convert all AND gates to NAND gates with AND-invert graphic symbol.
N A N D A N D N O R I M P L E M E N TAT I O N S
• F = A (CD + B) + BC’
C
B F
C’
B F
C’
N A N D A N D N O R I M P L E M E N TAT I O N S
• F = (AB’ + A’B) (C + D’)
A
B’
A’
B F
D’
B’
A’
B F
C’
N A N D A N D N O R I M P L E M E N TAT I O N S
• NOR function is the dual of
Inverter x x’
NAND function.
N A N D A N D N O R I M P L E M E N TAT I O N S
NAND Circuits:
• Two graphic symbols for NAND gate
x x
y (x+y+z)’ y (x’ y’ z’) = (x + y + z)’
z z
N A N D A N D N O R I M P L E M E N TAT I O N S
• Example: Implementing F = (A + B) (C + D) E
A
B’
F
E’
F
A
B’
D’
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
• NAND and NOR gates most often found in integrated circuits.
• NAND and NOR are the most important gates from a practical point of
view.
• Some NAND or NOR gates allow the possibility of a wire connection
between the outputs of two gates to provide a specific logic function.
• This type of logic is called wired logic.
• Example:
– Open-collector TTL NAND gates when tied together performs wired-AND
logic.
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
• Example:
– Open-collector TTL NAND gates when tied together performs wired-AND
logic.
– The wired – AND gate is not a physical gate, but only a symbol to designated
the function obtained from the indicated wired connection.
B B
C C
D D
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
Nondegenerate Forms
• Assign one type of gate for the first level and one type of gate for the
second level.
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
degenerate forms = a single operation
Logic Operation Circuit Diagram
A A.B
AND-AND
F=A.B.C.D
D C.D
A A.B
AND-NAND
F=(A.B.C.D)’
=A+B+C+D
C
D C.D
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
degenerate forms = a single operation
Logic Operation Circuit Diagram
A A+B
OR-OR F=A+B+C+D
D C+D
A A+B
OR-NOR
F=(A+B+C+D)’
=A.B.C.D
C
D C+D
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
degenerate forms = a single operation
Logic Operation Circuit Diagram
A (A.B)’
NAND-OR F=(A.B)’+(C.D)’
=A+B+C+D
C
D (C.D)’
A (A.B)’
NAND-NOR
F=((A.B)’+(C.D)’)’
=A.B.C.D
C
D (C.D)’
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
degenerate forms = a single operation
Logic Operation Circuit Diagram
A (A+B)’
NOR-AND F=(A+B)’.(C+D)’
=A.B.C.D
C
D (C+D)’
A (A+B)’
NOR-NAND
F=((A+B)’.(C+D)’)’
=A+B+C+D
C
D (C+D)’
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
– The eight non-degenerate forms
• AND-OR, OR-AND, NAND-NAND, NOR-NOR, NOR-OR, NAND-AND, OR-
NAND, AND-NOR.
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
AND – OR – INVERT Implementation
• F = (AB + CD + E)’
• F’ = AB + CD + E (sum of product)
A A.B A A.B A A.B
B B B
C.D C.D C.D
F F F
C C C
D D D
E E E
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
OR – AND – INVERT Implementation
B B B
C+D C+D (C+D)’
F F F
C C C
D D D
E E E
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
Equivalent Implements the Simplify To get
Nondegenerate Function F’ an output
Form in of
(a) (b)*
AND- NAND-AND AND-OR-INVERT Sum of products F
NOR by combining 0’s
in the map
OR- NOR-OR OR-AND-INVERT Product of sums F
NAND by combining 1’s
in the map and
then
complementing
*Form (b) requires and inverter for a single literal term.
November, 2022 LOGIC DESIGN
72
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
yz y
• Example 3-11: F' = x'y+xy'+z x 00 01 11 10
(F': sum of products) m0 m1 m3 m2
0
1 0 0 0
– Step1: x’y (z + z’) = x’yz + x’yz’
m4 m5 m7 m6
x 1
– Step2: xy’(z + z’) = xy’z + xy’z’ 0 0 0 1
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
• Example 3-11: F' = x'y+xy'+z (F': sum of products)
x’ x’
y y
F F
x x
y’ y’
z z
AND-NOR NAND-NAND
• AND-OR-INVERT
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
yz y
• AND-OR-INVERT form require a
x 00 01 11 10
simplified expression of the m0 m1 m3 m2
0
1 0 0 0
complement of the function in
m4 m5 m7 m6
product of sums. x 1
0 0 0 1
• F = [(x+y+z) (x’+y’+z)]’
(a) OR-NAND (c) NOR-OR
OT H E R T WO L E V E L I M P L E M E N TAT I O N S
• Summary
– F' = x'y+xy'+z (F': sum of products)
– F = (x'y+xy'+z)' (F: AOI implementation)
E XC LU S I V E - O R F U N C T I O N
• Exclusive-OR (XOR)
– x y = x y‘ + x‘ y
E XC LU S I V E - O R F U N C T I O N
• Some identities • Commutative and associative
– x0=x – AB=BA
– x 1 = x' – (A B) C = A (B C)
– xx=0 =ABC
– x x' = 1
– x y' = (x y)'
– x‘ y = x’ y = (x y)'
E XC LU S I V E - O R F U N C T I O N
x
• Implementations
x⊕y
x⊕y
E XC LU S I V E - O R F U N C T I O N
• The XOR operation with three or more variables can be converted into
an ordinary Boolean function by replacing symbol with its equivalent
Boolean expression.
= AB'C'+A'BC'+ABC+A'B'C
= S(1, 2, 4, 7)
E XC LU S I V E - O R F U N C T I O N
yz y yz y
x 00 01 11 10 x 00 01 11 10
m0 m1 m3 m2 m0 m1 m3 m2
0 0
1 1 1 1
m4 m5 m7 m6 m4 m5 m7 m6
x 1 x 1
1 1 1 1
z z
(a) Odd Function (b) Even Function
F=AC F = (A B C)’
A A
B x⊕y B (x ⊕ y)’
C C
(a) 3-input odd function (b) 3-input even function
E XC LU S I V E - O R F U N C T I O N
• Four-variable Exclusive-OR function
– ABCD = (AB'+A'B)(CD'+C'D) = (AB'+A'B)(CD+C'D')+(AB+A'B')(CD'+C'D)
yz y yz y
wx 00 01 11 10 wx 00 01 11 10
m0 m1 m3 m2 m0 m1 m3 m2
00 00
1 1 1 1
m4 m5 m7 m6 m4 m5 m7 m6
01 01
1 1 1
x x
m12 m13 m15 m14 m12 m13 m15 m14
11 11
1 1 1 1
w w
m8 m9 m11 m10 m8 m9 m11 m10
10 10
1 1 1 1
z z
F = ABCD F = (ABCD)’
November, 2022 LOGIC DESIGN
83
E XC LU S I V E - O R F U N C T I O N
• Parity Generation and Checking
– A parity bit: P = x y z
– Parity check: C = x y z P
• C=1: one bit error or an odd number of data bit error
x x
y P y C
z
z
P
E XC LU S I V E - O R F U N C T I O N
Three-Bit Message Parity Bit
x y Z P
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
E XC LU S I V E - O R F U N C T I O N
Three-Bit Message Parity Error Check
x y Z P C
0 0 0 0 0
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0
H A R DWA R E D E S C R I P T I O N L A N G UAG E
• Describe the design of digital systems in a textual form
– Hardware structure
– Function/behavior
– Timing
H A R DWA R E D E S C R I P T I O N L A N G UAG E
Specification
FPGA
ASIC Layout
Implementation
LOGIC DESIGN
89
H A R DWA R E D E S C R I P T I O N L A N G UAG E
• Documentation language
• Examples of keywords:
– module, end-module, input, output, wire, and, or, and not
H A R DWA R E D E S C R I P T I O N L A N G UAG E
A
g1 w1
B g3 x
C g2 y
H A R DWA R E D E S C R I P T I O N L A N G UAG E
• Boolean expressions are specified in Verilog HDL with a
– continuous assignment statement consisting of the keyword assign
followed by a Boolean expression.
H A R DWA R E D E S C R I P T I O N L A N G UAG E
C g2 y assign x = (A & B) | ~C
assing y = ~C
endmodule
• Boolean expression:
– x = A.B + C’
– y = C’