You are on page 1of 17

Lecture 7: K-maps with multiple solutions

K-map to Product of Sum Minimization

CSE 140: Components and Design Techniques for


Digital Systems

Diba Mirza
Dept. of Computer Science and Engineering
University of California, San Diego
1
Definition: Essential Prime
1. Prime Implicant: A group of adjacent ones that cannot be fully covered
by any other large group of ones
2. Essential Prime Implicant or Essential Prime: Prime implicants covering
elements in the onset that contain at least one element that cannot be
covered by any other prime implicant

Y
AB
Q: Are the corner four essential
CD 00 01 11 10
prime implicants?
00 1 0 0 1
A. Yes
01 0 1 0 1
B. No
11 1 1 0 0

10 1 1 0 1

2
Include all essential prime implicants!

Y
AB
CD 00 01 11 10

00 1 0 0 1

01 0 1 0 1

11 1 1 0 0

10 1 1 0 1

Y = AC + ABD + ABC + BD

If all prime implicants are essential then we have a unique reduction

3
Reducing Canonical expressions

Given F(a,b,c,d) = Σm (0, 1, 2, 8, 14)


D(a,b,c,d) = Σm (9, 10)
1. Draw K-map
ab
00 01 11 10
cd
00

01

11

10

4
Reducing Canonical Expressions

Given F(a,b,c,d) = Σm (0, 1, 2, 8, 14)


D(a,b,c,d) = Σm (9, 10)
1. Draw K-map
ab
00 01 11 10
cd
0 4 12 8

00
1 5 13 9
01
3 7 15 11
11

2 6 14 10
10

5
Reducing Canonical Expressions
Given F(a,b,c,d) = Σm (0, 1, 2, 8, 14)
D(a,b,c,d) = Σm (9, 10)
1. Draw K-map
ab
00 01 11 10
cd
0 4 12 8

00 1 0 0 1
1 5 13 9
01 1 0 0 X
3 7 15 11
11 0 0 0 0
2 6 14 10
10 1 0 1 X

6
Reducing Canonical Expressions
1. Draw K-map Are all the Prime implicants
2. Identify Prime implicants also essential?
A. Yes
B. No
ab
00 01 11 10
cd
0 4 12 8

00 1 0 0 1
1 5 13 9
01 1 0 0 X
3 7 15 11
11 0 0 0 0
2 6 14 10
10 1 0 1 X

7
Reducing Canonical Expressions
1. Prime implicants: Σm (0, 1, 8, 9), Σm (0, 2, 8, 10), Σm (10, 14)
2. Essential Primes: Σm (0, 1, 8, 9), Σm (0, 2, 8, 10), Σm (10, 14)

ab
00 01 11 10
cd
0 4 12 8 PI Q: Do the E-primes
00 1 0 0 1 cover the entire on set?
1 5 13 9 A. Yes
01 1 0 0 X B. No
3 7 15 11
11 0 0 0 0
2 6 14 10
10 1 0 1 X
8
Reducing Canonical Expressions
1. Prime implicants: Σm (0, 1, 8, 9), Σm (0, 2, 8, 10), Σm (10, 14)
2. Essential Primes: Σm (0, 1, 8, 9), Σm (0, 2, 8, 10), Σm (10, 14)
3. Min exp: Σ (Essential Primes)=Σm (0, 1, 8, 9) + Σm (0, 2, 8, 10) + Σm (10, 14)
f(a,b,c,d) = b’c’ + b’d’+ acd‘

ab
00 01 11 10
cd
0 4 12 8

00 1 0 0 1
1 5 13 9
01 1 0 0 X
3 7 15 11
11 0 0 0 0
2 6 14 10
10 1 0 1 X
9
Procedure for finding the minimal function
via K-maps (formal terms)

Y
AB
CD 00 01 11 10
1. Convert truth table to K-map
00 1 0 0 1
2. Include all essential primes
3. Include non essential primes as 01 0 1 0 1

needed to completely cover the on-set 11 1 1 0 0


(all cells of value one)
10 1 1 0 1

10
Definition: Non-Essential Prime
Non Essential Prime Implicant : Prime implicant that has no element that
cannot be covered by other prime implicant

Q: Is the blue group a non-essential prime implicant?

ab
00 01 11 10
cd A. Yes
00 1 1 1 B. No
01 1 1

11 1 1

10 1 1 1

Example 1 11
Example 2
A B C D Y Y
0 0 0 0 1
AB
0 0 0 1 0 CD 00 01 11 10
0 0 1 0 1
0 0 1 1 1 00
0 1 0 0 0
0 1 0 1 X
0 1 1 0 1 01
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1 11
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X 10
1 1 0 1 X
1 1 1 0 X
1 1 1 1 X

12
Example 2
A B C D Y
0 0 0 0 1 Y
0 0 0 1 0 AB
0 CD 00 01 11 10
0 1 0 1
0 0 1 1 1
00 1 0 X 1
0 1 0 0 0
0 1 0 1 X
0 1 1 0 1
01 0 X X 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1
11 1 1 X X
1 0 1 0 X
1 0 1 1 X
1 1 0 0 X
10 1 1 X X
1 1 0 1 X
1 1 1 0 X
1 1 1 1 X

13
Example 2
Y
A B C D Y AB
0 0 0 0 1 CD 00 01 11 10
0 0 0 1 0
0 0 1 0 1 00 1 0 X 1
0 0 1 1 1
0 1 0 0 0
0 1 0 1 X 01 0 X X 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1 11 1 1 X X
1 0 0 1 1
1 0 1 0 X
1 0 1 1 X 10 1 1 X X
1 1 0 0 X
1 1 0 1 X
1 1 1 0 X Y = A + BD + C
1 1 1 1 X

14
ab
Example 2 c 00 01 11 10
0 2 6 4
• Find all possible 0 X 1 0 0
reduced expressions 1 3 7 5
1 0 1 1 X
1. Find all primes
2. Pick any cell that contains a 1. If the cell is covered by multiple primes,
create multiple trees. The root of each tree corresponds to the prime
covering that cell.
3. For each leaf node (N) of each tree, find all ‘1-cells’ that are not covered by
the primes in the root to node path.
i. If no such cell exist (i.e. all 1’s are covered by the primes in the root to
node path), do not extend the tree down that path.
ii. Else, pick one of the cells that is not covered so far (say C). Create
children to the leaf node (N), each corresponding to primes that cover
the cell (C)
Repeat step 3 until all solutions are found.
A possible solution consists of primes in the shortest root to leaf path with
the minimum number of literals 15
ab
Example 2 c 00 01 11 10
0 2 6 4
• Find all possible 0 X 1 0 0
reduced expressions 1 3 7 5

1. The primes are: 1 0 1 1 X

The possible solutions should also have the minimum number of literals (in total). 16
In this case the number of literals in all of S1 to S3 is the same (4), so all of them are equally reduced.
Reading

[Harris] Chapter 2, 2.7

17

You might also like