Chapter 3-P1-KMap
Chapter 3-P1-KMap
Some of the figures and tables in this set of slides are obtained from material
supplied by Pearson Prentice Hall and is copyrighted. Use of this material is
permitted for academic purposes only.
Karnaugh Maps (K-map)
• A K-map is a collection of squares
• Each square represents a minterm
• The collection of squares is a graphical representation of a Boolean function
• Adjacent squares differ in the value of one variable
• Alternative algebraic expressions for the same function are derived by recognizing
patterns of squares
• The K-map can be viewed as
• A reorganized version of the truth table
• A topologically-warped Venn diagram as used to visualize sets in algebra of sets
• Provides a means for:
• Finding optimum or near optimum
• SOP and POS standard forms, and
• two-level AND/OR and OR/AND circuit implementations
for functions with small numbers of variables
Two Variable Maps
• A 2-variable Karnaugh Map: y=0 y=1
• Note that minterm m0 and
minterm m1 are “adjacent” m0 = m1 =
x=0
and differ in the value of the xy xy
variable y
x = 1 m2 = m3 =
• Similarly, minterm m0 and xy xy
minterm m2 differ in the x variable.
• Also, m1 and m3 differ in the x variable as well.
• Finally, m2 and m3 differ in the value of the variable y
K-Map and Truth Tables
• The K-Map is just a different form of the truth table.
• Example – Two variable function: We choose a,b,c and d from the set {0,1} to
implement a particular function, F(x,y).
• For function F(x,y), the two adjacent cells containing 1’s can be combined
using the Minimization Theorem:
F( x , y ) = x y + x y = x
K-Map Function Representation
• Example: G(x,y) = x + y G = x+y y = 0 y = 1
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 + x y )+ (xy + x y )= x + y
Duplicate xy
Three Variable Maps
• A three-variable K-map:
yz=00 yz=01 yz=11 yz=10
x=0 m0 m1 m3 m2
x=1 m4 m5 m7 m6
• Note that if the binary value for an index differs in one bit position, the minterms
are adjacent on the K-Map
Alternative Map Labeling
• Map use largely involves:
• Entering values into the map, and
• Reading off product terms from the map.
• Alternate labelings are useful:
y y yz y
0 3 2 x 00 01 11 10
x 1
x 4 5 7 6 0 0 1 3 2
z z z x 1 4 5 7 6
z
Example Functions
• By convention, we represent the minterms of F by a "1" in the map and leave the
minterms of F blank
• Example:
y
F(x, y, z) = m(2,3,4,5)
0 1 3 2
1 1
x 41 5
1 7 6
• Example:
z
G(a, b, c) = m(3,4,6,7) y
0 1 3 2
1
x 41 5 7
1 6
1
z
Combining Squares
• By combining squares, we reduce number of literals in a product term,
reducing the literal cost, thereby reducing the other two cost criteria
• On a 3-variable K-Map:
• One square represents a minterm with three variables
• Two adjacent squares represent a product term with two variables
• Four “adjacent” terms represent a product term with one variable
• Eight “adjacent” terms is the function of all ones (no variables) = 1.
Three Variable Maps
K-Maps can be used to simplify Boolean functions by systematic methods.
Terms are selected to cover the “1s”in the map.
Example: Simplify F(x, y, z) = m(1,2,3,5,7)
z xy
y
1 1 1
x 1 1
z
F(x, y, z) = z+xy
Rules for Grouping squares in a K-map
• No zeros allowed in any group.
• No diagonal grouping.
• Only powers of 2 number of squares in any group.
• Groups should be as large as possible.
• All the 1s in the map must belong in some group.
• Groups can overlap.
• Groups can wrap around.
• Fewest number of groups to cover all the 1s.
Three-Variable K-Maps
f = (0,4) = B C f = (4,5) = A B f = (0,1,4,5) = B f = (0,1,2,3) = A
BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1
1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 1 0 0 0 0
BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1
1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1
Four Variable Maps
Map and location of minterms:
Y
0 1 3 2
4 5 7 6
12 13 15 14 X
W 11 10
8 9
Z
Four Variable Terms
CD CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 1 0 0 0 00 0 0 0 0 00 0 0 0 0 00 0 0 0 0
01 0 0 0 0 01 0 1 0 0 01 0 0 0 0 01 1 0 0 1
11 0 0 0 0 11 0 1 0 0 11 0 1 1 0 11 0 0 0 0
10 1 0 0 0 10 0 0 0 0 10 0 0 0 0 10 0 0 0 0
CD CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 0 0 1 1 00 0 0 0 0 00 0 0 1 1 00 1 0 0 1
01 0 0 1 1 01 1 0 0 1 01 0 0 0 0 01 0 0 0 0
11 0 0 0 0 11 1 0 0 1 11 0 0 0 0 11 0 0 0 0
10 0 0 0 0 10 0 0 0 0 10 0 0 1 1 10 1 0 0 1
CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
00 0 0 0 0 00 0 0 1 0 00 1 0 1 0 00 0 1 0 1
01 1 1 1 1 01 0 0 1 0 01 0 1 0 1 01 1 0 1 0
11 0 0 0 0 11 0 0 1 0 11 1 0 1 0 11 0 1 0 1
10 0 0 0 0 10 0 0 1 0 10 0 1 0 1 10 1 0 1 0
CD CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 0 1 1 0 00 1 0 0 1 00 0 0 0 0 00 1 1 1 1
01 0 1 1 0 01 1 0 0 1 01 1 1 1 1 01 0 0 0 0
11 0 1 1 0 11 1 0 0 1 11 1 1 1 1 11 0 0 0 0
10 0 1 1 0 10 1 0 0 1 10 0 0 0 0 10 1 1 1 1
1 1 1 1
1 1 1 1 1 1 1 1
B B
1 1
A A
1 1 1 1
D D
Minterms covered by essential prime implicants
Selection Rule Example with Don't Cares
1 x 1 x
1 x x 1 1 x x 1
B B
x x
A A
1 1 x 1 1 x
D D
Minterms covered by essential prime implicants
POS Simplification
• Group the 0s in the K-map to obtain the SOP for the complemented
function.
• Complement the SOP obtain to get the POS form of the required function.
• Include Don’t Cares while grouping the 0s.
X X
W W
Z Z
NAND and NOR Gates
NAND Gate as a Universal gate
NOR Gate as a Universal Gate
NOR Gate using NAND Gates
NAND Gate using NOR Gates
NAND and NOR Gates using DeMorgan’s Laws
Implementation of SOP (AND–OR) using NAND
x y z x y z
0 0 0 0 0 1
Truth Table
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 1
XOR Operation XNOR Operation
XOR using NAND and NOR
XNOR using NAND and NOR
XOR Operation
-- Rules
XꚚY=YꚚX
X Ꚛ Y’ = X’ Ꚛ Y = (X Ꚛ Y)’
(X Ꚛ Y) Ꚛ Z = X Ꚛ (Y Ꚛ Z)
Odd Function – Multivalued XOR
Parity Generator and Checker
If A=B, output = 1
Otherwise output = 0.