k-map simplification - kfupm · k-map method provides a straightforward procedure for simplifying...
Post on 25-Sep-2020
4 Views
Preview:
TRANSCRIPT
K-Map Simplification
COE 202
Digital Logic Design
Dr. Abdulaziz Tabbakh
College of Computer Sciences and Engineering
King Fahd University of Petroleum and Minerals
COE 202– Digital Logic Design – KFUPM slide 2
Outline
K-Map Method
Two-, Three-, and Four-variable K-Map
Prime Implicants and Essential Prime Implicants
SOP Simplification
POS Simplification
Don’t Care Conditions
Five-variables K-maps
Six-variables K-Maps
COE 202– Digital Logic Design – KFUPM slide 3
Introduction
The design task of finding an optimal gate-level
implementation of the Boolean functions.
COE 202– Digital Logic Design – KFUPM slide 4
The Map Method The complexity of the digital circuit that implements a Boolean
function is related to the complexity of the algebraic expression from
which the circuit is implemented.
Although Boolean expressions can be simplified by algebraic
manipulation, such an approach lacks clear regular rules for each
succeeding step and it is difficult to determine whether the simplest
expression has been achieved.
Each Boolean function has:
Unique truth table
Many different, but equivalent, algebraic expression
The map is pictorial form of a truth table
It is known as the Karnaugh map or K-map
K-map method provides a straightforward procedure for simplifying
Boolean functions.
COE 202– Digital Logic Design – KFUPM slide 5
K-map
A K-Map is a diagram made up of squares, with each
square representing one minterm of the function to be
minimized.
Adjacent minterms are combined to form simpler terms.
The map presents a visual diagram of all possible ways
a function may be expressed in standard form.
The distance between two binary codes is the number of
bit positions in which the two code have different values.
0011 and 0100 have a distance of 3 (called Hamming distance)
Any 2 adjacent squares in the k-map should have a
distance of exactly 1
COE 202– Digital Logic Design – KFUPM slide 6
K-map
The simplified expressions produced either SOP or POS
The simplest algebraic expression means:
Minimum number of terms ( minimum number of gates)
Smallest number of literals in each term ( less inputs to gates)
the simplest expression is not unique
COE 202– Digital Logic Design – KFUPM slide 7
2-Variable K-Maps
Two K-map squares are considered adjacent if the input
codes they represent have a Hamming distance of 1.
A K-map square with a function value of 1 will be
referred to as a 1-Square.
A K-map square with a function value of 0 will be
referred to as a 0-Square.
The simplification procedure is summarized below:
Step 1: Draw the map according to the number of input
variables of the function.
Step 2: Fill “1’s” in the squares for which the function is true.
COE 202– Digital Logic Design – KFUPM slide 8
2-Variable K-Maps Step 3: Form as big group of adjacent 1-squares as possible.
There are some rules for this which you will learn with bigger
maps.
Step 4: Find the common literals for each group and write the
simplified expression in SOP.
In an n-variable map each square is adjacent to “n” other
squares, e.g., in a 2-variable map each square is
adjacent to two other squares.
COE 202– Digital Logic Design – KFUPM slide 9
2-variable K-map
(a) F=m3 = xy(b) F=m1+m2+m3
= x’y+xy’+xy
= x+x’y
= (x+x’)(x+y)
= x+y
COE 202– Digital Logic Design – KFUPM slide 10
3-variable K-map
Three-variable map consists of 8 squares (8 minterms)
To maintain adjacent columns physically adjacent on the map, the
column coordinates do not follow the binary count sequence. This
choice yields unit distance between codes of one column to the next
(00 – 01—11 – 10), like Grey Code.
There are cases where two squares in the map are considered to be
adjacent even though they do not physically touch each other.
m0 is adjacent to m2 and m4 is adjacent to m6 because the minterms differ by only
one variable.
COE 202– Digital Logic Design – KFUPM slide 11
3-variable K-map
The number of adjacent squares that may be combined
must always represent a number that is a power of two
More adjacent squares product term with fewer
literals
One square represents one minterm (a term with three literals.)
Two adjacent squares represent a term with two literals
Four adjacent squares represent a term with one literal
Eight adjacent squares cover the entire map and produce a
function F=1.
Members of a group must have a closed loop adjacency,
i.e., L-Shaped 4 squares do not form a valid group.
COE 202– Digital Logic Design – KFUPM slide 12
Example
Simplify
F(x,y,z)= Ʃ(2,3,4,5)
F = xy’+x’y
Simplify :F(x,y,z)= Ʃ(3,4,6,7)
COE 202– Digital Logic Design – KFUPM slide 13
Example
Simplify
F(x,y,z)= Ʃ(3,4,6,7)
F = xz’+yz
yz
x 00 01 11 10
0 1
1 1 1 1
ZY
X
COE 202– Digital Logic Design – KFUPM slide 14
Example
Simplify
F(x,y,z)= Ʃ(0,2,4,5,6)
F = z’+xy’
yz
x 00 01 11 10
0 1 1
1 1 1 1
Z
Y
X
COE 202– Digital Logic Design – KFUPM slide 15
Example
Let the Boolean function
F = AB + A’C + A’BC’
Express in Sum-Of-minterms
Minimize.
Convert to Canonical form
F = ABC + ABC’ + A’BC + A’B’C + A’BC’
Fill in the map
F= (1,2,3,6,7)
= B + A’C
Solve Example 3.4 page 95
bc
a 00 01 11 10
0 1 1 1
1 1 1
c
b
a
COE 202– Digital Logic Design – KFUPM slide 16
4-variable K-map One square represents one minterm, giving a term with four literals.
Two adjacent squares represent a term with three literals.
Four adjacent squares represent a term with two literals.
Eight adjacent squares represent a term with one literal.
Sixteen adjacent squares produce a function that is always equal to
1
COE 202– Digital Logic Design – KFUPM slide 17
Example
Simplify
F (w, x, y, z) = Ʃ(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)
F = y’+w’z’+xz’
yz
wx 00 01 11 10
00 1 1 1
01 1 1 1
11 1 1 1
10 1 1
Z
Y
X
W
COE 202– Digital Logic Design – KFUPM slide 18
Example
F = A’B’C’ + B’CD’ + A’BCD’ + AB’C’ = B’D’ + B’C’ + A’CD’
COE 202– Digital Logic Design – KFUPM slide 19
Prime Implicants
In choosing adjacent squares in a map, we must ensure
that:
All minterms of the function are covered when we combine
squares
The number of terms in the expression is minimized
No redundant terms
Sometimes there might be two or more expressions
that satisfy the simplification criteria.
COE 202– Digital Logic Design – KFUPM slide 20
Prime Implicant
The procedure for combining squares in the map may be
made more systematic if we understand the meaning of
two special types of terms
A product term of a function is said to be an implicant.
A prime implicant is a product term obtained by
combining the maximum possible number of adjacent 1-
squares in a map.
If a minterm is covered by only one prime implicant, that
prime implicant is said to be essential prime implicant.
The prime implicants of a function can be obtained from
the map by combining all possible maximum numbers of
squares (i.e. we cannot remove any of its literals)
COE 202– Digital Logic Design – KFUPM slide 21
SOP Simplification procedure
1. Identify all prime implicants covering 1’s
Example: For a function of 3 variables, group all possible groups
of 4, then groups of 2 that are not contained in groups of 4, then
minterms that are not contained in a group of 4 or 2.
2. Identify all essential prime implicants and select them.
3. Check all minterms (1’s) covered by essential prime
implicants
4. Repeat until all minterms (1’s) are covered:
Select the prime implicant covering the largest uncovered
minterms (1’s).
COE 202– Digital Logic Design – KFUPM slide 22
Example
F(A, B, C, D) = ∑(0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15)
cd
ab 00 01 11 10
00 1 1 1
01 1 1
11 1 1
10 1 1 1 1
d
c
b
a
COE 202– Digital Logic Design – KFUPM slide 23
Example
COE 202– Digital Logic Design – KFUPM slide 24
Example
The simplified expression is obtained from the logical
sum of the two essential prime implicants and any two
prime implicants that cover minterms m3, m9, and m11
The simplified expression is obtained from the logical sum of
all the essential prime implicants, plus other prime
implicants that may be needed to cover any remaining
minterms not covered by the essential prime implicants.
COE 202– Digital Logic Design – KFUPM slide 25
Product of Sums Simplification
When combining minterms, we get SOP out of the K-
MAP simplification process.
If we combine maxterms (0 squares) we get the
compliment of F (F’).
Using DeMorgan’s Theorems, we can get F as a product
of sums (POS)
COE 202– Digital Logic Design – KFUPM slide 26
Example
F(A, B, C, D) = Σ(0, 1, 2, 5, 8, 9, 10)
F(A, B, C, D) = B’D’ + B’C’ + A’C’D
F’ = AB + CD + BD’
F’’= F = (A’ + B’)(C’ + D’)
(B’ + D)
COE 202– Digital Logic Design – KFUPM slide 27
Gate-Level Implementation
the implementation of a function in a standard form is
said to be a two-level implementation. The two-level
implementation may not be practical, depending on the
number of inputs to the gates.
COE 202– Digital Logic Design – KFUPM slide 28
The 1’s of the function represent the minterms and the
0’s represent the maxterms. The map for this function
For the sum of products,
we combine the 1’s to obtain:
F= x’z + xz’
For the product of sums,
we combine the 0’s to obtain:
F’=xz+x’z’ F = (x’+z’)(x+z)
Convert PO Maxterms to K-map
COE 202– Digital Logic Design – KFUPM slide 29
K-map from POS
To enter a function expressed in product-of-sums form
into the map, use the complement of the function to find
the squares that are to be marked by 0’s.
Marking 0’s in the squares representing the minterms of
F’. The remaining squares are marked with 1’s.
COE 202– Digital Logic Design – KFUPM slide 30
Don’t Care Conditions
Functions that have unspecified outputs for some input
combinations are called incompletely specified functions.
We DON’T CARE what value is assumed by the function
for the unspecified minterm.
call the unspecified minterms of a function don’t-care
conditions.
can be used on a map to provide further simplification of the
Boolean expression.
Don’t cares cannot be marked with ‘1’ or ‘0’ so they are
marked with ‘x’
Don’t cares can be assumed ‘1’ or ‘0’ to simplify the
function.
COE 202– Digital Logic Design – KFUPM slide 31
Example
Simplify the Boolean Function
F(w, x, y, z) = (1, 3, 7, 11, 15)
Which has the don’t care conditions: d(w, x, y, z) = (0, 2, 5)
Sol: F = yz + w’x’
Or F = yz + w’z
yz
wx 00 01 11 10
00 x 1 1 x
01 x 1
11 1
10 1
Z
Y
X
W
COE 202– Digital Logic Design – KFUPM slide 32
Simplification with Don’t Cares
To get the simplified expression in sum-of-products form,
we must include all 1’s in the map, but we may or may
not include any of the X’s
The two functions obtained are not algebraically equal,
but both cover the specified minterms but different
don’t care conditions (Both are VALID SOLUTIONS)!
It is also possible to obtain a simplified product-of-sums
expression.
COE 202– Digital Logic Design – KFUPM slide 33
SOP Simplification procedure using Don’t Cares
1. Identify all prime implicants covering 1’s & X’s
Each prime implicant must contain at least a single 1
2. Identify all essential prime implicants and select them.
An essential prime implicant must be the only implicant covering
at least a 1.
3. Check all 1’s covered by essential prime implicants
4. Repeat until all 1’s are covered:
Select the prime implicant covering the largest uncovered 1’s.
COE 202– Digital Logic Design – KFUPM slide 34
Five-Variable K-Maps
There are 32 minterms (squares) for a Boolean function
with five-variables.
It consists of 2 four-variable maps. Variable A
distinguishes between the two maps. The left-hand four-
variable map represents the 16 squares where A=0, and
the other four-variable map represents the squares
where A=1.
COE 202– Digital Logic Design – KFUPM slide 35
Five-Variable K-Maps
Minterms 0 through 15 belong to the four-variable map
with A=0 and minterms 16 through 31 belong to the four-
variable map with A=1.
Each four-variable map retains the previously defined
adjacency when taken separately.
In addition, each square in the A=0 map is adjacent to
the corresponding square in the A=1 map.
For example, minterm 4 is adjacent to minterm 20 and minterm
15 to 31.
The best way to visualize this new rule for adjacent
squares is to consider the two half maps as being one on
top of the other. Any two squares that fall one over the
other are considered adjacent.
COE 202– Digital Logic Design – KFUPM slide 36
Five-Variable K-Map Example
COE 202– Digital Logic Design – KFUPM slide 37
Six-Variable K-Maps
There are 64 minterms (squares)
for a Boolean function with six-
variables.
By following the procedure used
for the five-variable map, it is
possible to construct a six-
variable map with 4 four-variable
maps to obtain the required 64
squares.
COE 202– Digital Logic Design – KFUPM slide 38
Six-Variable K-Map Example
top related