03 Clii
03 Clii
Part 2:
F = m 0 + m2 + m5 + m7
F = X’Y’Z’ + X’YZ’+
XY’Z + XYZ
2
Sum of Products Implementation
3
Product of Maxterms Implementation
F X (Y Z )( X Y Z )
5
Karnaugh Map
• Graphical depiction of truth table
• A box for each minterm
♦ So 2 variables, 4 boxes
♦ 3 variable, 8 boxes
♦ And so on
• Useful for simplification
♦ by inspection
♦ Algebraic manipulation harder
6
K-Map from Truth Table
Examples The number of ones needs to add up to
2^0 or 2^1 or 2^2 ect
There's an OR between
each rectangle/ square
7
Function from K-Map
• Can generate function from K-map
F XY F XY XY XY
Simplifies to X + Y (in a moment)
8
In Practice:
• Karnaugh maps were mildly useful
when people did simplification
• Computers now do it!
• We’ll cover Karnaugh maps as a way
for you to gain insight,
♦ not as real tool
9
Three-Variable Map
• Eight minterms
• Look at encoding of columns and
ﺑﻜﻮﻧﻮ ﺟﲑان ﳌﺎ اﻟﻔﺮق ﺑﲔ ﻛﻞ ﺟﺎر )اﻟﲇ ﻓﻮق ﺗﺤﺖ ﳝﲔ او ﴰﺎل( ﻣﺘﻐﲑ واﺣﺪ/رﻗﻢ واﺣﺪ /ﺑﺮاﱘ واﺣﺪ
rows
10
Simplification
• Adjacent squares (horizontally or
vertically) are minterms that vary
by single variable
• Draw rectangles on map to simplify
function
• Illustration next
11
Example
ﻋﱯ ١ﻣﺤﻞ اﻟﻮاﺣﺪات اﳌﺸﱰﻛﻪ
)اﻟﺘﻘﺎﻃﻊ( ﺑﻨﺎﲥﻢ
13
Covering 4 Squares
is
16
Slight Variation
• Overlap is OK.
• No need to use full m5-- waste of input
17
4-variable map
• At limit of K-map
18
Also Wraps (toroidal topology)
19
Systematic Simplification
A Prime Implicant is a product term obtained by combining
the maximum possible number of adjacent squares in the map
into a rectangle with the number of squares a power of 2.
A prime implicant is called an Essential Prime Implicant if it is
the only prime implicant that covers (includes) one or more
minterms.
Prime Implicants and Essential Prime Implicants can be
determined by inspection of a K-Map.
A set of prime implicants "covers all minterms" if, for each
minterm of the function, at least one prime implicant in the
set of prime implicants includes the minterm.
Chapter 2 - Part 2 20
Example of Prime Implicants
Find ALL Prime Implicants
CD B’D’ and BD are ESSENTIAL Prime Implicants
C C
BD BD
1 1 1 1 1 1
BD 1 1 BD 1 1
B B
1 1 1 1
A A
1 1 1 1 An invalid 1 1 1 1
AB rectangle
bcs it has 3 D
D minterms
AD Minterms covered by single prime implicant
BC
Chapter 2 - Part 2 21
Prime Implicant Practice
Chapter 2 - Part 2 22
Prime Implicant Practice
B
1 1 1 1
A
1 1 1 1
A D
BC Chapter 2 - Part 2 23
Algorithm to Find An Optimal
Expression for A Function
Find all prime implicants.
Include all essential prime implicants in the
solution
Select a minimum cost set of non-essential
prime implicants to cover all minterms not yet
covered.
The solution consists of all essential prime and
the selected minimum cost set of non-essential
prime implicants
Chapter 2 - Part 2 24
The Selection Rule
Obtaining a good simplified solution:
Use the Selection Rule
Chapter 2 - Part 2 25
Prime Implicant Selection Rule
Minimize the overlap among prime
implicants as much as possible.
Chapter 2 - Part 2 26
Selection Rule Example
Simplify F(A, B, C, D) given on the K-
map. Selected Essential
C First step is outlining
C
ALL the prime implcnts
The second step is
1 1 outlining the essential 1 1
prime implicants
1 1 1 1 Third step is
picking prime
1 1 1 1
B
implicints to cover B
all the 1s while
1 keeping note of one
1
A A
thing THE BIGGER
THE TRIANGLE
1 1 THE BETTER 1 1
D D
Minterms covered by essential prime implicants
Chapter 2 - Part 2 27
Don’t Care
• So far have dealt with functions
that were always either 0 or 1
• Sometimes we have some
conditions where we don’t care
what result is
• Example: dealing with BCD
♦ Only care about first 10
28
Mark With an X
• In a K-map, mark don’t care with X
• Simpler implementations
• Can select an X either as 1 or 0
29
Example
or
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
Chapter 2 - Part 2 31
Product of Sums Example
Find the optimum POS solution:
F(A, B, C, D) m(3,9,11,12,13,14,15)
d (1,4,6)
• Hint: Use F and complement it to get the
result.
32