Lecture 08
Lecture 08
Circuit optimization
Circuit implementation cost
Boolean function optimization
Karnaugh maps
– Two variable
– Three variable
– Four variable
Gate input costs - the number of inputs to the gates in the implementation
corresponding exactly to the given equation or equations. (G - inverters not counted,
GN - inverters counted)
For SOP and POS equations, it can be found from the equation(s) by finding the sum of:
– all literal appearances
– the number of terms excluding terms consisting only of a single literal,
(G) and
– optionally, the number of distinct complemented single literals (GN).
Example:
L = 5
Example 1: G = L + 2 = 7
F = A + BC + B'C' GN = G + 2 = 9
B
C
A F
L (literal count) counts the AND inputs and the single literal OR input.
G (gate input count) adds the remaining OR gate inputs
GN(gate input count with NOTs) adds the inverter inputs
A
Example 2: B
F = A B C + A'B'C' C
F
– L = 6, G = 8, GN = 11
F = (A + C')(B' + C)(A' + B)
– L = 6, G = 9, GN = 12
Same function and same literal
cost A
B
But first circuit has better gate input C
count and better gate input count F
with NOTs
Select it!
Minimizing the gate input (or literal) cost of a (a set of) Boolean equation(s)
reduces circuit cost.
We choose gate input cost.
Boolean Algebra and graphical techniques are tools to minimize cost
criteria values.
Some important questions:
– When do we stop trying to reduce the cost?
– Do we know when we have a minimum cost?
Treat optimum or near-optimum cost functions for two-level (SOP
and POS) circuits first.
Introduce a graphical technique using Karnaugh maps (K- maps, for short)
• Example:
F(x,y) = (2,3) F(x,y) y = 0 y=1
F(x,y) = xy' + xy
x=0 0 0
x=1 1 1
Example:
G(x,y) = (1,2,3) G(x,y) y=0 y=1
G(x,y) = x'y + xy' + xy
x=0 0 1
x=1 1 1
For G(x,y), two pairs of adjacent cells containing 1’s can be combined
using the Minimization Theorem:
G(x,y) = x'y + xy' + xy
G(x,y) = (x'y + xy) + (xy' + xy) = (x' + x)y + x(y' + y) = x + y
Duplicate xy
0 1 3 2
0 1 1
4 5 7 6
Example: 1 1 1
G(a,b,c) = (3,4,6,7)
Learn the locations of the 8 bc
00 01 11 10
indices based on the variable a
order shown (x, ms 0 0 1 3 1 2
and z, ls) on the
7 6
map boundaries 1 4 1 5 1 1
0 1 3 2
4 5 7 6
X
yz
x
Z
0 1 3 2
4 5 7 6
X
Example: x'y
Simplify yz
Z
x
F(x,y,z) = (1,2,3,5,7)
0 1 3 2
1 1 1
4 5 1 7 1 6
X
F = x'y + z
z Y
00 0 1 3 2
01 4 5 7 6
x
11 12 13 15 14
w
10 8 9 11 10
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 24
Four variable terms
0 1 3 2
4 5 7 6
x
12 13 15 14
w
8 9 11 10
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 26
Four variable maps
0 1 3 2
4 5 7 6
x
12 13 15 14
w
8 9 11 10
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 27
Four variable maps
0 1 3 2
4 5 7 6
x
12 13 15 14
w
8 9 11 10
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 28
Four variable maps
0 1 3 2
4 5 7 6
x
12 13 15 14
w
8 9 11 10
y
CEN203, Fall 2024 2024, Dr. Mohanad Alayedi (Haliç University) 29
Four variable map simplification 1
F(w,x,y,z) = (0,2,4,5,6,7,8,10,13,15)
0 1 3 2
4 5 7 6
12 13 15 14
8 9 11 10
F(w,x,y,z) = (3,4,5,7,9,13,14,15)
0 1 3 2
4 5 7 6
12 13 15 14
8 9 11 10