Professional Documents
Culture Documents
and K-Maps
Summary so far
So far:
A bunch of Boolean algebra trickery for simplifying expressions and
circuits
The algebra guarantees us that the simplified circuit is equivalent
to the original one
Next:
An alternative simplification method
Well start using all this stuff to build and analyze bigger, more
useful, circuits
We can write expressions in many ways, but some ways are more useful than
others
A sum of products (SOP) expression contains:
Only OR (sum) operations at the outermost level
Each term that is summed must be a product of literals
f(x,y,z) = y + xyz + xz
The advantage is that any sum of products expression can be implemented using
a two-level circuit
literals and their complements at the 0th level
AND gates at the first level
a single OR gate at the second level
This diagram uses some shorthands
NOT gates are implicit
literals are reused
this is not okay in LogicWorks!
Minterms
f(x,y,z)
f(x,y,z)
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
0
0
1
0
0
0
0
0
1
1
0
1
Maxterms
x + y + z
x + y + z
Maxterm
x+y+z
x + y + z
x + y + z
x + y + z
x + y + z
x + y + z
x + y + z
x + y + z
x + y + z
x + y + z
x + y + z
x + y + z
x+ y + z
x+y+z
f(x,y,z)
f(x,y,z)
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
0
0
1
0
0
0
0
0
1
1
0
1
f = (x + y + z)(x + y + z)(x + y + z)
= M4 M 5 M 7
= M(4,5,7)
f = (x + y + z)(x + y + z)(x + y + z)
(x + y + z)(x + y + z)
= M 0 M 1 M2 M 3 M 6
= M(0,1,2,3,6)
f contains all the maxterms not in f
Minterm Shorthand
Maxterm Shorthand
xyz
m0
x+y+z
M0
xyz
m1
x + y + z
M1
xyz
m2
x + y + z
M2
xyz
m3
x + y + z
M3
xyz
m4
x + y + z
M4
xyz
m5
x + y + z
M5
xyz
m6
x + y + z
M6
xyz
m7
x + y + z
M7
For example, m4 = M4 because (xyz) = x + y + z
From before
and
complementing
so
f
f
=
=
=
(f) =
f =
=
m(0,1,2,3,6)
m(4,5,7)
m 4 + m5 + m 7
(m4 + m5 + m7)
m4 m5 m7
[ DeMorgans law ]
M4 M5 M7
[ By the previous page ]
= M(4,5,7)
In general, just replace the minterms with maxterms, using maxterm numbers
that dont appear in the sum of minterms:
f = m(0,1,2,3,6)
= M(4,5,7)
The same thing works for converting from a product of maxterms to a sum of
minterms
10
Karnaugh maps
11
minterm
xy
xy
xy
xy
0
1
0
xy
xy
1
xy
xy
0
1
xy
xy
xy
xy
X
X
xy
xy
xy
xy
12
Both of these minterms appear in the top row of a Karnaugh map, which
means that they both contain the literal x.
xy
xy
Y
xy
xy
xy
+ xy
= x(y
+ y)expression
[ Distributive
]
What happens if
you
simplify
this
using Boolean
algebra?
= x 1
[ y + y = 1 ]
= x
[x1=x]
13
xy
xy
Y
xy
xy
xy
xy
xy
xy
14
0
1
00
xyz
xyz
YZ
01
xyz
xyz
YZ
11
xyz
xyz
10
xyz
xyz
0
1
00
m0
m4
01
m1
m5
11
m3
m7
xyz
xyz
xyz
xyz
xyz
xyz
xyz
xyz
m0
m4
m1
m5
10
m2
m6
m3
m7
m2
m6
15
Y
X
xyz
xyz
xyz
xyz
xyz
xyz
xyz
xyz
xyz + xyz
= xz(y + y)
= xz 1
= xz
xyz
xyz
xyz
xyz
xyz
xyz
Z
xyz
xyz
=
=
=
=
16
f(x,y,z)
0
0
0
0
0
0
1
1
0
1
0
1
0
1
0
0
1
1
1
1
0
0
1
1
0
1
0
1
0
1
1
1
17
Unsimplifying expressions
You can also convert the expression to a sum of minterms with Boolean
algebra.
Apply the distributive law in reverse to add in missing variables.
Very few people actually do this, but its occasionally useful.
18
f(x,y,z) = m1 + m5 + m6 + m7
Y
X
xyz
xyz
xyz
xyz
xyz
xyz
Y
xyz
xyz
m0
m4
m1
m5
m3
m7
m2
m6
Z
CS231 Boolean Algebra
19
You can also fill in the K-map directly from a truth table.
The output in row i of the table goes into square mi of the K-map.
f(x,y,z)
0
0
0
0
0
0
1
1
0
1
0
1
0
1
0
0
0
0
1
1
0
1
0
1
0
1
1
1
m1
m5
m3
m7
m2
m6
Y
X
1
1
1
1
m0
m4
0
0
1
1
0
1
0
1
20
0
0
1
1
0
1
0
1
Each group corresponds to one product term. For the simplest result:
Make as few rectangles as possible, to minimize the number of products
21
0
0
1
1
0
1
0
1
Z
Y
X
xyz
xyz
xyz
xyz
xyz
xyz
xyz
xyz
For our example, we find that xy + yz + xz = yz + xy. (This is one of the additional
algebraic laws from last time.)
22
Practice K-map 1
Y
X
m0
m4
m1
m5
m3
m7
m2
m6
23
0
0
1
1
1
0
0
1
24
Four-variable K-maps
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
Y
wxyz
wxyz
X
wxyz
wxyz
m0
m4
m12
m8
m1
m5
m13
m9
m3
m7
m15
m11
m2
m6
X
m14
m10
25
1
0
0
1
0
1
1
0
0
0
0
0
Y
1
0
0
1
X
W
m0
m4
m12
m8
m1
m5
m13
m9
m3
m7
m15
m11
m2
m6
m14
m10
0 the
0 following
1
wxyz wxyz
wxyzxzwxyz
We can1 make
groups, resulting
in the MSP
+ xyz.
W
0
0
1
1
1
0
0
0
0
0
0
1
X
W
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
wxyz
26
Y
0
0
1
1
0
1
1
1
Z
Y
X
0
0
1
1
0
1
Y
1
1
0
0
1
1
0
1
yz + yz + xy
yz + yz + xz
1
1
27