Professional Documents
Culture Documents
Isaac Hanson
Eng Dept/GTUC
A. Cost Models
B. Reduction Techniques -
i. Karnaugh Map Method
The Simplification Problem: Requirements
Simplification of complex circuits, starting from their
equivalent representation as complex Boolean expressions,
requires an understanding of cost.
x f(x)
0 f(0) Truth Table
1 f(1)
Karnaugh Maps
1 variable map
Literal
x f(x)
0 f(0) Truth Table
1 f(1)
Function Values
Binary Values
Karnaugh Maps
1 variable map
Literal
Literal x
x f(x) 0 1 Binary Values
0 f(0) Truth Table f(0) f(1) Function Values
1 f(1)
Function Values
Binary Values
Karnaugh Maps
1 variable map
x
x f(x) 0 1
0 f(0) Truth Table f(0) f(1)
1 f(1)
x y f(x,y)
0 0 f(0,0)
0 1 f(0,1)
Truth Table
1 0 f(1,0)
1 1 f(1,1)
Karnaugh Maps
2 variable map
y
x y f(x,y) 0 1
0 0 f(0,0)
0 1 f(0,1) f(0,0) f(0,1)
Truth Table 0
1 0 f(1,0)
x
1 1 f(1,1) 1 f(1,0) f(1,1)
x y z f(x,y,z)
yz
0 0 0 f(000) 00 01 11 10
0 0 1 f(001)
0 1 0 f(010) f(000) f(001) f(011) f(010)
0 1 1 f(011) 0
1 0 0 f(100) x
1 0 1 f(101) 1 f(100)
1 1 0 f(110)
f(101) f(111) f(110)
1 1 1 f(111)
x y z f(x)
yz
0 0 0 f(000) 00 01 11 10
0 0 1 f(001)
0 1 0 f(010) f(000) f(001) f(011) f(010)
0 1 1 f(011) 0
1 0 0 f(100) x
1 0 1 f(101) 1 f(100)
1 1 0 f(110)
f(101) f(111) f(110)
1 1 1 f(111)
x y z f(x,y,z)
y
0 0 0 f(000) 00 01 11 10
0 0 1 f(001)
0 1 0 f(010) f(000) f(001) f(011) f(010)
0 1 1 f(011) 0
1 0 0 f(100) x
1 0 1 f(101) 1 f(100)
1 1 0 f(110)
f(101) f(111) f(110)
1 1 1 f(111)
z
An alternative
labelling scheme is
2x4 Karnaugh Map
based on which
literal has value 1.
Karnaugh Maps
3 variable map
x y z f(x,y,z)
y
0 0 0 f(000) 00 01 11 10
0 0 1 f(001)
0 1 0 f(010) 0 1 3 2
0 1 1 f(011) 0
1 0 0 f(100) x
1 0 1 f(101) 1
1 1 0 f(110)
4 5 7 6
1 1 1 f(111)
One final alternative
z
labelling scheme
replaces the function
value by the decimal 2x4 Karnaugh Map
minterm index value.
Karnaugh Maps
4 variable map
w x y z f(w,x,y,z)
0 0 0 0 f(0000)
0 0 0 1 f(0001)
0 0 1 0 f(0010)
0 0 1 1 f(0011)
0 1 0 0 f(0100)
0 1 0 1 f(0101)
0 1 1 0 f(0110)
0 1 1 1 f(0111)
1 0 0 0 f(1000)
1 0 0 1 f(1001)
1 0 1 0 f(1010)
1 0 1 1 f(1011)
1 1 0 0 f(1100)
1 1 0 1 f(1101)
1 1 1 0 f(1110)
1 1 1 1 f(1111)
Karnaugh Maps
4 variable map yz
00 01 11 10
w x y z f(w,x,y,z)
f(0000) f(0001) f(0011) f(0010)
0 0 0 0 f(0000)
0 0 0 1 f(0001) 00
0 0 1 0 f(0010) f(0100) f(0101) f(0111) f(0110)
0 0 1 1 f(0011) 01
0 1 0 0 f(0100) wx
0 1 0 1 f(0101) 11 f(1100) f(1101) f(1111) f(1110)
0 1 1 0 f(0110)
0 1 1 1 f(0111) 10
1 0 0 0 f(1000)
f(1000) f(1001) f(1011) f(1010)
1 0 0 1 f(1001)
1 0 1 0 f(1010)
1 0 1 1 f(1011)
1 1 0 0 f(1100)
1 1 0 1 f(1101)
1 1 1 0 f(1110)
1 1 1 1 f(1111)
Karnaugh Maps
4 variable map yz
00 01 11 10
w x y z f(w,x,y,z)
0 0 0 0 f(0000) 0 1 3 2
0 0 0 1 f(0001) 00
0 0 1 0 f(0010)
01 4 5 7 6
0 0 1 1 f(0011)
0 1 0 0 f(0100) wx
0 1 0 1 f(0101) 11 12 13 15 14
0 1 1 0 f(0110)
0 1 1 1 f(0111) 10
1 0 0 0 f(1000) 8 9 11 10
1 0 0 1 f(1001)
1 0 1 0 f(1010)
1 0 1 1 f(1011)
Note the way that
1 1 0 0 f(1100)
both the row and
1 1 0 1 f(1101)
column indices
1 1 1 0 f(1110)
change by only 1 bit
1 1 1 1 f(1111)
at a time.
Karnaugh Maps
4 variable map yz
00 01 11 10
w x y z f(w,x,y,z)
0 0 0 0 f(0000) 0 1 3 2
0 0 0 1 f(0001) 00
0 0 1 0 f(0010)
01 4 5 7 6
0 0 1 1 f(0011)
0 1 0 0 f(0100) wx
0 1 0 1 f(0101) 11 12 13 15 14
0 1 1 0 f(0110)
0 1 1 1 f(0111) 10
1 0 0 0 f(1000) 8 9 11 10
1 0 0 1 f(1001)
1 0 1 0 f(1010)
1 0 1 1 f(1011)
1 1 0 0 f(1100)
1 1 0 1 f(1101)
1 1 1 0 f(1110)
This implies that two rows, or columns, whose
1 1 1 1 f(1111)
indices differ by only 1 bit value, are adjacent.
Karnaugh Maps
4 variable map yz
00 01 11 10
w x y z f(w,x,y,z)
0 0 0 0 f(0000) 0 1 3 2
0 0 0 1 f(0001) 00
0 0 1 0 f(0010)
01 4 5 7 6
0 0 1 1 f(0011)
0 1 0 0 f(0100) wx
0 1 0 1 f(0101) 11 12 13 15 14
0 1 1 0 f(0110)
0 1 1 1 f(0111) 10
1 0 0 0 f(1000) 8 9 11 10
1 0 0 1 f(1001)
1 0 1 0 f(1010)
1 0 1 1 f(1011)
1 1 0 0 f(1100)
WRAP-AROUND!
1 1 0 1 f(1101)
1 1 1 0 f(1110)
This implies that two rows, or columns, whose
1 1 1 1 f(1111)
indices differ by only 1 bit value, are adjacent.
Karnaugh Maps
4 variable map y
00 01 11 10
w x y z f(w,x,y,z)
0 0 0 0 f(0000) 0 1 3 2
0 0 0 1 f(0001) 00
0 0 1 0 f(0010)
01 4 5 7 6
0 0 1 1 f(0011)
0 1 0 0 f(0100) x
0 1 0 1 f(0101) 11 12 13 15 14
0 1 1 0 f(0110)
0 1 1 1 f(0111) 10 w
1 0 0 0 f(1000) 8 9 11 10
1 0 0 1 f(1001)
1 0 1 0 f(1010)
1 0 1 1 f(1011) z
1 1 0 0 f(1100)
1 1 0 1 f(1101)
An alternative row/column
1 1 1 0 f(1110)
labelling, highlighting the literal
1 1 1 1 f(1111)
with value 1.
Karnaugh Maps
Case Study: 1 variable map
Ex.
x
X F(X)
0 1
0 0 0 1
1 1
DEFINITION:
When constructing SOP forms, a 2N -subcube is a
rectangular region of a Karnaugh map consisting of
2N adjacent cells, each containing the same value 1
(or 0 for POS forms), and where N must be an
integer greater or equal to zero.
Karnaugh Maps
Case Study: 1 variable map
x
0 1
0 1
0 1 1 0
0
x
1 1 0 1 0
X YZ F(X,Y,Z)
0 0 0 0
0 0 1 1
0 1 0 0
•Circle all 1 entries that, taken together, form a
subcube (i.e. rectangle).
0 1 1 1
•Start with the largest subcubes, then proceed to
1 0 0 1 smaller subcubes
1 0 1 0 •Generally speaking, there will be more than one
1 1 0 0 independent subcube, each reflecting a different
prime implicant.
1 1 1 1
Karnaugh Maps
3 variable map y’ z’
yz
00 01 11 10
0 1 1 0
0
x
x 1 1 0 1 0
x’ 0 1 1 0
0
x
1 1 0 1 0
0 1 1 0
0
x+x’ = 1 x
1 1 0 1 0
0 1 1 0
0
x+x’ = 1 x
1 1 0 1 0
0 1 1 0
0
Each subcube (rectangle) x
corresponds to a prime 1
implicant term. 1 0 1 0
f = xy’z’ + x’z + yz
Karnaugh Maps
3 variable map
yz
00 01 11 10
f = xy’z’ + x’z + yz
0 1 1 0
0
x
1 1 0 1 0
Karnaugh Maps
3 variable map
yz
00 01 11 10
f = xy’z’ + x’z + yz
0 1 1 0
0
x
1 1 0 1 0
xy’z’ ( xy’z’ )
Essential 1-cell (essential prime implicant).
Each subcube contains at least one 1-cell that can ONLY
be included within that subcube. Such 1-cells are called
essential 1-cells and their corresponding prime implicant is
called an essential prime implicant.
Karnaugh Maps
3 variable map
yz
00 01 11 10
f = xy’z’ + x’z + yz
0 1 1 0
0
x
1 1 0 1 0
x’y’z ( x’z )
Essential 1-cell (essential prime implicant).
Each subcube contains at least one 1-cell that can ONLY
be included within that subcube. Such 1-cells are called
essential 1-cells and their corresponding prime implicant is
called an essential prime implicant.
Karnaugh Maps
3 variable map
yz
00 01 11 10
f = xy’z’ + x’z + yz
0 1 1 0
0
x
1 1 0 1 0
xyz ( yz )
Essential 1-cell (essential prime implicant).
Each subcube contains at least one 1-cell that can ONLY
be included within that subcube. Such 1-cells are called
essential 1-cells and their corresponding prime implicant is
called an essential prime implicant.
Karnaugh Maps
3 variable map - 2nd variation
yz
00 01 11 10
1 1 1 1
0
x
1 1 0 0 1
Karnaugh Maps
3 variable map - 2nd variation
yz
00 01 11 10
1 1 1 1
0
x
1 1 0 0 1
1 1 1 1
0
x
1 1 0 0 1
1 1 1 1
The “wrap-around” 0
technique. x
1 1 0 0 1
1 1 1 1
0
x’[yz + y’z + yz’ + y’z’] x
= x’[(y+y’)z + (y+y’)z’] 1 1 0 0 1
= x’[z+z’]
= x’
x’y’z’+x’yz’+xy’z’+xyz’
= x’(y’+y)z’ +x(y’+y)z’ Circle all 1 entries that,
= (x’+x)(y’+y)z’ taken together, form a
= z’ subcube (i.e. rectangle) of
the largest size, but
containing 2N squares (for
all possible N).
Karnaugh Maps
3 variable map - 2nd variation
yz
00 01 11 10
1 1 1 1
0
x
1 1 0 0 1
Collecting
literals into a
product Circle all 1 entries that,
gives: taken together, form a
x’ + z’ subcube (i.e. rectangle) of
the largest size, but
containing 2N squares (for
all possible N).
Karnaugh Maps
Case Study: 4 variable map
yz
00 01 11 10
1 0 0 1
00
01 1 1 0 0
wx Place function values
11 1 1 1 0 in the map positions.
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map
yz
00 01 11 10
Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map
yz Identify 2N subcubes
00 01 11 10 by decreasing
N=4,3,2,1,0; using
wraparound.
1 0 0 1
00
1 1 0 0 There are no subcubes
01
of sizes:
wx
24 =16 or 23 = 8.
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map
yz
Identify 2N subcubes
00 01 11 10
by decreasing
N=4,3,2,1,0; using
1 0 0 1 wraparound.
00
01 1 1 0 0
Subcubes of size:
wx 22 =4.
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map
yz Identify 2N subcubes
00 01 11 10 by decreasing
N=4,3,2,1,0; using
1 0 0 1 wraparound.
00
01 1 1 0 0
Subcubes of size:
wx 22 =4.
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map
yz
00 01 11 10 Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx
Subcubes of size:
11 1 1 1 0
21 =2.
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map Identify 2N subcubes
by decreasing
N=4,3,2,1,0; using
yz
wraparound.
00 01 11 10
1 0 0 1
00
01 1 1 0 0
wx
Subcubes of size:
11 1 1 1 0
21 =2.
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map
yz
00 01 11 10 Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx No more subcubes!
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps
Case Study: 4 variable map Identify 2N subcubes
by decreasing
N=4,3,2,1,0; using
yz
wraparound.
00 01 11 10
1 0 0 1
00
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1 Now to identify the
prime implicants:
yz
00 01 11 10 Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1 Now to identify the
prime implicants:
yz
00 01 11 10
Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1 Now to identify the
prime implicants:
yz
00 01 11 10
Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1 Now to identify the
prime implicants:
yz
00 01 11 10 Identify 2N subcubes
by decreasing
N=4,3,2,1,0; using
1 0 0 1
wraparound.
00
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1 Now to identify the
prime implicants:
yz
00 01 11 10 Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1 Now to identify the
prime implicants:
yz
00 01 11 10
Previously, we had
presented this
1 0 0 1
example.
00
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1
yz
00 01 11 10
Consider these
1 0 0 1 subcubes ...
00
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1
yz
00 01 11 10 Now, choose the other,
alternative subcube
1 0 0 1 containing these 1-cells
00 …
…thereby, minimizing
01 1 1 0 0 the number of subcubes,
wx hence the number of
11 1 1 1 0 product terms in the
function.
10
1 0 1 1
10
1 0 1 1
Karnaugh Maps – Summary for SOP
For a function of N variables (literals) draw the Karnaugh
map consisting of 2N cells
1x2, 2x2, 2x4, 4x4, and so on
we have not considered the cases of N=5, or 6 (See Textbook).
yz
00 01 11 10
1 0 0 1
00
01 1 1 0 0
wx
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps - POS
Case Study: 4 variable map
yz
Identify 2N subcubes
00 01 11 10
by decreasing
N=4,3,2,1,0; using
1 0 0 1 wraparound.
00
01 1 1 0 0
No subcubes of
wx sizes 16, 8 or 4.
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps - POS
Case Study: 4 variable map
yz
Identify 2N subcubes
00 01 11 10
by decreasing
N=4,3,2,1,0; using
1 0 0 1 wraparound.
00
01 1 1 0 0
Subcubes of size
wx 2.
11 1 1 1 0
10
1 0 1 1
Karnaugh Maps - POS
Case Study: 4 variable map
yz
00 01 11 10 Identify 2N subcubes
by decreasing
1 0 0 1 N=4,3,2,1,0; using
00 wraparound.
01 1 1 0 0
wx
11 1 1 1 0 Note the
essential 0-cells
10 that denote
1 0 1 1 essential prime
implicates.
Karnaugh Maps - POS
Case Study: 4 variable map Identify 2N subcubes
by decreasing
N=4,3,2,1,0; using
yz
wraparound.
00 01 11 10
1 0 0 1
00
This subcube contains
1 1 0 0 0-cells that may be
01
associated with other
wx
subcube choices,
11 1 1 1 0
hence they are not
essential 0-cells.
10
1 0 1 1 This choice minimizes
the number of
subcubes.
Karnaugh Maps - POS
Case Study: 4 variable map
Identify 2N subcubes
yz by decreasing
00 01 11 10 N=4,3,2,1,0; using
wraparound.
1 0 0 1
00 Note there are no
smaller subcubes.
01 1 1 0 0
The subcube
wx choices reflect a
11 1 1 1 0 minimal POS
expression.
10
1 0 1 1
Karnaugh Maps - POS
Case Study: 4 variable map Identify 2N subcubes
by decreasing
N=4,3,2,1,0; using
yz
wraparound.
00 01 11 10
1 0 0 1
00 Note there are no
smaller subcubes.
01 1 1 0 0
The subcube
wx choices reflect a
11 1 1 1 0 minimal POS
expression.
10
1 0 1 1
f(w,x,y,z) = (x+y+z’)(x’+y’+z)(w+y’+z’)
Karnaugh Maps
Case Study: 4 variable map
SOP: f(w,x,y,z) = xy’ + x’z’ + wxz
the 7 literals provide input to the and gates (operators)
the 3 terms provide input to the or gates
there are 7+3=10 gate inputs for this expression (circuit)
Karnaugh Maps
Case Study: 4 variable map
SOP: f(w,x,y,z) = xy’ + x’z’ + wxz
the 7 literals provide input to the and gates (operators)
the 3 terms provide input to the or gates
there are 7+3=10 gate inputs for this expression (circuit)
yz
00 01 11 10
1 0 - 1
00
01 0 1 - 0
wx
11 1 1 1 0
10
- 0 0 1
Karnaugh Maps
When an incompletely specified function is given, for which there exist “don’t care conditions”, we indicate those terms by a hyphen (or other dc token).
yz
00 01 11 10
1 0 -? 1
00
01 0 1 -? 0
wx
11 1 1 1 0
10
- ? 0 0 1
Karnaugh Maps
When an incompletely specified function is given, for which there exist “don’t care conditions”, we indicate those terms by a hyphen (or other dc token).
yz
00 01 11 10
1 0 - 1
00
01 0 1 - 0
1
wx
11 1 1 1 0
10
- 0 0 1
1
Karnaugh Maps
When an incompletely specified function is given, for which there exist “don’t care conditions”, we indicate those terms by a hyphen (or other dc token).
yz
00 01 11 10
1 0 - 1
00
01 0 1 - 0
1
wx
11 1 1 1 0
10
- 0 0 1
1
Karnaugh Maps
When an incompletely specified function is given, for which there exist “don’t care conditions”, we indicate those terms by a hyphen (or other dc token).
PRIME IMPLICATES
yz
00 01 11 10
1 0 0- 1
00
01 0 1 - 0
wx
11 1 1 1 0
10
- 0 0 1
Karnaugh Maps
When an incompletely specified function is given, for which there exist “don’t care conditions”, we indicate those terms by a hyphen (or other dc token).
PRIME IMPLICATES
yz
00 01 11 10
1 0 0- 1
00
01 0 1 - 0
wx
11 1 1 1 0
10
- 0 0 1
Karnaugh Maps
When an incompletely specified function is given, for which there exist “don’t care conditions”, we indicate those terms by a hyphen (or other dc token).
PRIME IMPLICATES
yz
00 01 11 10
1 0 0- 1
00
01 0 1 - 0
wx
11 1 1 1 0
10
- 0 0 1
Summary
We have studied and developed several techniques for
simplifying Boolean expressions.