Professional Documents
Culture Documents
K Map
K Map
Design ( 210243)
Unit II –
Combinational Logic Design
Logic Function Simplification
Logic Function Simplification
Why simplify?
Simpler expression uses less logic gates
Thus: cheaper, less power, faster (sometimes)
Simplification techniques:
Algebraic Simplification
Simplify Boolean functions by means of basic identities and theorems
Requires skill and it lacks specific rules to predict each succeeding step in
the minimization process
Karnaugh Maps - A graphical technique for simplifying an expression
Advantages
A more orderly process with well-defined steps compared with the trial-
4
Minterms (Cont.)
Each minterm is true for exactly one
combination of inputs:
Minterm Is true when… Shorthand
x’y’z’ x=0, y=0, z=0 m0
x’y’z x=0, y=0, z=1 m1
x’yz’ x=0, y=1, z=0 m2
x’yz x=0, y=1, z=1 m3
xy’z’ x=1, y=0, z=0 m4
xy’z x=1, y=0, z=1 m5
xyz’ x=1, y=1, z=0 m6
xyz x=1, y=1, z=1 m7
5
Sum of Minterms Form
Every function can be written as a sum of minterms, which
is a special kind of sum of products form
The sum of minterms form for any function is unique
If you have a truth table for a function, you can write a
sum of minterms expression just by picking out the rows of
the table where the function output is 1
x y z f(x,y,z) f’(x,y,z) f = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’
0 0 0 1 0 = m0 + m1 + m2 + m3 + m6
0 0 1 1 0 = m(0,1,2,3,6)
0 1 0 1 0 f’ = xy’z’ + xy’z + xyz
0 1 1 1 0
= m4 + m 5 + m 7
1 0 0 0 1
= m(4,5,7)
1 0 1 0 1
1 1 0 1 0
f’ contains all the minterms not in f
1 1 1 0 1 6
Re-arranging the Truth Table
A two-variable function has four possible minterms. We can re-
arrange these minterms into a Karnaugh map
x y minterm Y
0 0 x’y’ 0 1
0 1 x’y 0 x’y’ x’y
X
1 0 xy’ 1 xy’ xy
1 1 xy
Now we can easily see which minterms contain common literals
Minterms on the left and right sides contain y’ and y respectively
Minterms in the top and bottom rows contain x’ and x respectively
Y
0 1 Y’ Y
0 x’y’ x’y X’ x’y’ x’y
X
1 xy’ xy X xy’ xy
7
Re-arranging the Truth Table
(Cont.)
For a three-variable expression with inputs x, y, z,
the arrangement of minterms is more tricky:
YZ YZ
00 01 11 10 00 01 11 10
0 x’y’z’ x’y’z x’yz x’yz’ 0 m0 m1 m3 m2
X X
1 xy’z’ xy’z xyz xyz’ 1 m4 m5 m7 m6
8
3 Variables K-Maps
There are 8 minterms for 3 variables (a, b, c). Therefore, there
are 8 cells in a 3 variable
b
K-map b
bc bc
a
00 01 11 10 a 00 01 11 10
0 a'b'c' a'b'c a'bc a'bc' 0 m0 m1 m3 m2
OR
a 1 ab'c' ab'c abc abc' a 1 m4 m5 m7 m6
c c
1 m4 m5 m7 m6
10
Remark for 3 Variables K-Maps
It is possible to arrange the 8 minterms for 3
variables (a, b, c) in this way!
a
a
a a
b 0 1
c
b 0 1
c
a'b'c' ab'c'
00 00 m m
0 4
01 a'b'c ab'c 01 m m
c OR 1 5
c
11 m m
11 a'bc abc
3 7
b b
10
10
m m
a'bc' abc' 2 6
11
4 Variable K-maps
There are 16 cells in a 4-variable (w, x, y, z)
K-map
y
yz
wx 00 01 11 10
00 m0 m1 m3 m2
m4 m5 m7 m6
01
x
m12 m13 m15 m14
11
w
m8 m9 m11 m10
10
z
12
4 Variable K-maps (Cont.)
There are 2 wrap-arounds: a horizontal wrap-around
and a vertical wrap-around
Every cell thus has 4 neighbours. For example, the
cell corresponding to minterm m0 has neighbours
m1, m2, m4 and m8
yz y
wx
m0 m1 m3 m2
m4 m5 m7 m6
x
m12 m13 m15 m14
w
m8 m9 m11 m10
13
Adjacencies
Adjacencies on three and four-variable maps
14
Why the Funny Ordering?
With this ordering, any group of 2, 4 or 8 adjacent squares on
the map contains common variables that can be factored out
Y x’y’z + x’yz
x’y’z’ x’y’z x’yz x’yz’ = x’z(y’ + y)
X xy’z’ xy’z xyz xyz’ = x’z 1
Z = x’z
"Adjacency" includes wrapping around the left and right sides:
Y x’y’z’ + xy’z’ + x’yz’ +
xyz’
x’y’z’ x’y’z x’yz x’yz’
= z’(x’y’ + xy’ + x’y + xy)
X xy’z’ xy’z xyz xyz’
= z’(y’(x’ + x) + y(x’ + x))
Z = z’(y’+y)
We’ll use this property of adjacent squares
= z’ to do our
simplifications
15
Simplification using K-map
In a K-map, each cell containing a '1' corresponds to a minterm
of a given function F
Based on the Unifying Theorem:
A+A=1
Pairs of adjacent 1's
Remember that adjacent squares differ by only one variable
Hence the combination of 2 adjacent squares has the form
P ( A + A)
This can be simplified (from before) to just P
Each group of adjacent cells containing ‘1’ then corresponds to
a simpler product term of F
Grouping 2 adjacent squares eliminates 1 variable, grouping 4
squares eliminates 2 variables, grouping 8 squares eliminates 3
variables, and so on. In general,
grouping 2n squares eliminates n variables
16
Remarks about Groups
Groups of minterms must be:
(1) Rectangular, and
(2) Have size in powers of 2’s (i.e. 1, 2, 4, 8, 16 etc.)
Otherwise they are invalid groups. Some examples of
invalid groups are:
1 1 1 1
1 1 1 1
1 1 1
1 1 1 1 1
17
PIs AND EPIs (1/3)
To find the simplest (minimal) SOP expression from a K-
map, you need to obtain:
Minimum number of literals per product term; and
Minimum number of product terms.
Achieved through K-map using
Bigger groupings of minterms (prime implicants) where possible;
and
No redundant groupings (look for essential prime implicants)
Implicant: a product term that could be used to cover
minterms of the function.
PIs AND EPIs (2/3)
Prime implicant (PI): a product term obtained by
combining the maximum possible number of minterms
from adjacent squares in the map. (That is, it is the
biggest grouping possible.)
Always look for prime implicants in a K-map.
1 1 1 1 1 1
1
1 1 1 1 1
PIs AND EPIs (3/3)
No redundant groups:
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
11 1 1
B changes
10 1 1
C changes
X 21
Examples of Looping Pairs of
Adjacent 1s
In example (c) the top row and bottom row of squares are
considered to be adjacent in a K map
Similarly in example (d) the leftmost column and the rightmost
column of squares are also considered to be adjacent in a K map
Looping a pair of
adjacent 1s in a K map
eliminates the variable
that appears in
complemented and
uncomplemented form
22
Examples of Looping Groups of
Fours 1s (Quads)
Looping a quad of
adjacent 1s
eliminates the two
variables that
appears in both
complemented and
uncomplemented
form
23
Examples of Looping Groups of
Eight 1s (Octets)
Looping an octet of
adjacent 1s
eliminates the three
variables that
appears in both
complemented and
uncomplemented
form
24
Complete Simplification Process
1. Construct the K map and place 1s and 0s in the squares
according to the truth table
2. Looping the isolated 1s which are not adjacent to any other 1s
(single loops)
3. Looping any pair which contains a 1 adjacent to only one other 1
(double loops)
4. Loop any group of eight even if it contains one or more 1s that
have already been grouped
5. Looping any group of four that contains one or more 1s that
have not already been grouped, making sure to use the
minimum number of groups
6. Group any pairs necessary to include any 1s that have not yet
been grouped, making sure to use the minimum number of
groups
7. Form the OR sum of all the terms generated by each group
25
K-Map Simplification of SOP
Expression - Example 1
Determine the product terms for the Karnaugh map in Figure
below and write the resulting minimum SOP expression for X
27
K-Map Simplification of SOP
Expression - Example 2
Determine the product terms for the Karnaugh map in Figure
below and write the resulting minimum SOP expression for X
29
K-Map Simplification of SOP
Expression - Example 3
Determine the product terms for the Karnaugh map in Figure
below and write the resulting minimum SOP expression for X
30
Example 3 (Cont.)
Step 3:The 1 in square 2 is adjacent only to the 1 in
square 6. This pair is looped to produce ACD.
Similarly, square 9 is adjacent only to square 10.
Looping this pair produces ABC. Likewise, loop 7, 8 and
loop 11, 15 produce the terms and
ABC , ACD
respectively
Step 4: There are no octets (group of 8)
Step 5: There is one quad (group of 4) formed by
squares 6, 7, 10 and 11. This quad, however is not
looped because all the 1s in the quad have been
included in other loops
Step 6: All 1s have already been looped
Step 7: The expression for X is shown in the figure
31
The Same K-Map with Two
Equally Good Solutions
Consider the K map in Figure
For this map, there are two possible loopings, which require
only four looped pairs. Figure (a) shows one solution and Figure
(b) shows the other. Both expressions are of the same
complexity, and so neither is better than the other
32
Converting to Minterms Form
The K-map of a function is easily drawn when
the function is given in standard sum-of-
products, or sum-of-minterms form
What if the function is not in sum-of-
minterms?
Convert it to sum-of-products (SOP) form
Expand the SOP expression into sum-of-minterms
expression, or fill in the K-map directly based on
the SOP expression
33
y = A BC D + C D + A BC + D
Example
Use a K map to simplify y = C ( A B D + D) + A BC + D
Solution:
Step 1: Multiply out the first term to get
y = ABC D + C D + ABC + D
Step 2: For the ABC D term, simply put a 1 in the ABC D square
of the K map. For the C D term, place a 1 in all squares with C D
in their labels, that is, ABCD, ABCD, ABC D, ABCD . For the A BC
term, place a 1 in all squares that haveA BCan in their labels,
ABis,
that C D, ABCD . ForDthe term, place a 1 in all squares
that haveD a in their labels, that is all squares in the leftmost
and rightmost columns
34
Example (Cont.)
The K map is now filled and can looped for simplification
For proper looping produces y = AB + C + D
35
Don’t-Care Conditions
x y z f(x,y,z)
You don’t always need all 2n
input combinations in an n- 0 0 0 0
variable function 0 0 1 1
If you can guarantee that 0 1 0 X
certain input combinations
never occur. For example, when 0 1 1 0
dealing with Binary-coded 1 0 0 0
decimal (BCD), the inputs for
1010 - 1111 (10-15) will never 1 0 1 1
occur 1 1 0 X
When a certain input(s) will 1 1 1 1
occur, but we don’t care what
the output will be in response
to them as we are not going to
Don’t-care conditions can be used
use them in our circuit to help simplify Boolean
expression further in K-maps
We mark don’t-care outputs in They could be chosen to be either
truth tables and K-maps with Xs '1' or '0', depending on which
value will help the minimization
36
Example of Don’t Care Condition
Simplification
Don't-care conditions should be changed to either 0 or 1 to
produce K-map looping that yields the simplest expression
37
Don’t Care Condition Example 1
C
For comparison: AB
CD
00 01 11 10
WITHOUT Don’t-cares: 00 1 1
P = A'B'C'D’ + A'B'CD + A'BC'D 01 1 1
+ A'BCD' + AB'C'D 11
B
A
10 1
Note: Cells with ‘0’ are not D
38
Example 2
Simplify the Boolean function represented by the following truth table.
Note don’t care conditions are marked as X’s in the truth table
39
Example 2 (Cont.)
1. Place 1’s in the squares for minterms (1,3,7,11,15)
2. Place X’s in the squares for don’t cares (0,2,5)
3. Place 0’s in the remaining squares (4,6,8,9,10,12,13,14)
4. Group the adjacent 1’s (including any applicable X’s) into the
largest 2n groupings. One minimum solution uses the X in the
second row to yield the term W Z . The other grouping of 4
yields the term YZ
WZ
Thus, the solution is:
YZ F = W Z + YZ
40
K-Map using Product-of-Sum
(POS) Form
Recall an expression in standard POS form would look like
( A + B + C )( A + B + C )( A + B + C )
The output values placed in each cell are derived from the
"maxterm" of a Boolean function
A maxterm is a sum term that contains all of the function’s
variables exactly once, either complemented or not complemented
42
Getting POS Expression from K-
Map Example
Example:
(a) Use K-Map to find a minimum product of sums expression for
the given function F(A,B,C,D) = m(0,1,2,3,5,7,8,9,10,11)
(b) Implement the minimized function by using only-NOR gates
43
Example (Cont.)
(b) As F = (A + B)(B + D)
= (A + B)(B + D)
= (A + B) + (B + D)
DeMorgan
Thus, we have the circuit has shown below
A
A
A + B
B
B F
B+D
D
44
Checkerboard Pattern in K-Map
When we rearrange the Exclusive-OR truth table to a K-Map as
shown below, we would observe Karnaugh map displays a
checkerboard pattern (every other square) of 0s and 1s and we
cannot form any groups on the map
On a Karnaugh map diagonally adjacent terms can be simplified
by using either XOR or XNOR functions as functional elements
46
Odd and Even Function Examples
47
MORE EXAMPLES (1/6)
Example #2:
F(A,B,C,D) = ABC + B'CD' + AD + B'C'D'
A
AB
CD 00 01 11 10
00 1 1
Fill in the 1’s.
01 1 1
D
11 1 1
C
10 1 1 1
B
MORE EXAMPLES (2/6)
Example #2:
F(A,B,C,D) = ABC + B'CD' + AD + B'C'D'
A
AB
CD 00 01 11 10
00 1 1
01 1 1
1
D
Find all PIs:
11 1
C
10 1 1 1
A
AB
CD 00 01 11 10
00 X 1
Fill in the 1’s and X’s.
01 X
D
11 X X 1
C
10 1 1
B
MORE EXAMPLES (4/6)
Example #3 (with don’t-cares):
F(A,B,C,D) = m(2,8,10,15) + d(0,1,3,7)
A
AB
CD 00 01 11 10 Do we need to have an
00 X 1 additional term A'B' to
01 X cover the 2 remaining X’s?
D
11 X X 1
C
10 1 1
Answer: F(A,B,C,D) =
MORE EXAMPLES (5/6)
Find the simplest POS expression for example #2:
F(A,B,C,D) = ABC + B'CD' + AD + B'C'D'
Draw the K-map of the complement of F, that is, F'.
A
AB
CD 00 01 11 10
From K-map,
00 1 1
01 1 1
F' =
D
11 1 1 Using DeMorgan’s theorem,
C
10 1 F=
B
MORE EXAMPLES (6/6)
Find the simplest POS expression for example #3:
F(A,B,C,D) = m(2,8,10,15) + d(0,1,3,7)
Draw the K-map of the complement of F, that is, F'.
F'(A,B,C,D) = m(4,5,6,9,11,12,13,14) +
d(0,1,3,7)
A
AB
CD 00 01 11 10 From K-map,
00 X 1 1
F'=
01 X 1 1 1
X X 1
D
Using DeMorgan’s theorem,
11
C
10 1 1 F=
B