Karnaugh map

chandkec 923 views 42 slides Jun 25, 2019
Slide 1
Slide 1 of 42
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42

About This Presentation

K Map


Slide Content

Karnaugh Map

2
What is K-map?
•A K-map is similar to a truth table
➢All possible values of inputs + corresponding outputs
•A K-map is different from a truth table
➢Not rows and columns, but an array of cells
•Each cell within the K-map corresponds to a
particular combination of the input variables
➢Cells are arranged such that there is only a single-
variable change between adjacent cells, e.g. 010 cell
is adjacent to 011 cell

3
K-map Simplification for SOP
Expressions
•The process that results in an expression
containing the fewest possible terms with
fewest possible variables is called minimization
•After mapping an SOP expression, perform the
following 3 steps:
➢Group the 1’s
➢Determining product term for each group
✓Each group creates one product term that composed of all
variables that occur in only one form within the group
➢Summing the resulting product terms
✓Sum all product terms together to form the Minimum SOP
Expression

Karnaugh Mapping or K-Mapping
This presentation will demonstrate how to
•Create and label two, three, & four variable K-Maps.
•Use the K-Mapping technique to simplify logic designs
with two, three, and four variables.
•Use the K-Mapping technique to simplify logic design
containing don’t careconditions.
Boolean Algebra Simplification K-Mapping Simplification

4

K-Map Format
•Each minterm in a truth table
corresponds to a cell in the K-Map.
•K-Map cells are labeled such that both
horizontal and vertical movement differ
only by one variable.
•Since the adjacent cells differ by only
one variable, they can be grouped to
create simpler terms in the sum-of-
products expression.
•The sum-of-products expression for the
logic function can be obtained by OR-ing
together the cells or group of cells that
contain 1s.
5

Adjacent Cells = Simplification
VV
10
10X W W X X W XW X W W X X
V
10
10( )XWWX X WX W =+=+
6

Truth Table to K-Map Mapping
V
WXF
WX
Minterm–0001
Minterm–1010
Minterm–2101
Minterm–3110
V
0 1
2 3X W W X
10
10
Two Variable K-Map
7

V
0 0
0 0B A A
Groups of One –4
Two Variable K-Map GroupingsB A
1BA
1 1A B BA
1B
8

V
0 0
0 0B A A
Groups of Two –4
Two Variable K-Map GroupingsB A
1 1A
1 1
1B
1
1B
1
9

V
1 1
1 1B A A
Group of Four –1
Two Variable K-Map Groupings1 B
10

K-Map Simplification Process
1.Construct a label for the K-Map. Place 1s in cells
corresponding to the 1s in the truth table. Place 0s in the
other cells.
2.Identify and group all isolated 1’s. Isolated 1’s are ones that
cannot be grouped with any other one, or can only be
grouped with one other adjacent one.
3.Group any hex.
4.Group any octet, even if it contains some1s already grouped
but not enclosed in a hex.
5.Group any quad, even if it contains some1s already grouped
but not enclosed in a hex or octet.
6.Group any pair, even if it contains some1s already grouped
but not enclosed in a hex, octet, or quad.
7.OR together all terms to generate the SOP equation. 11

Example #1: 2 Variable K-Map
Example:
After labeling and transferring the truth table data into the K-Map,
write the simplified sum-of-products (SOP) logic expression for the
logic function F
1.
V
JKF
1
001
011
100
110
12

Example #1: 2 Variable K-Map
Example:
After labeling and transferring the truth table data into the K-Map,
write the simplified sum-of-products (SOP) logic expression for the
logic function F
1.
V
1 1
0 0K J J K
Solution: J JF=
1
JKF
1
001
011
100
110
13

Truth Table to K-Map Mapping
WXYF
WXY
Minterm–0000 1
Minterm–1001 0
Minterm–2010 0
Minterm–3011 0
Minterm–4100 0
Minterm–5101 1
Minterm–6110 1
Minterm–7111 0
V
0 1
2 3
6 7
4 5Y X W Y
1
Three Variable K-MapX W X W X W
0
00
01
10
Only one
variable changes
for every row
change
14

Three Variable K-Map Groupings
V
0 0
0 0
0 0
0 0C C B A B A BA BA B A
1 1B A
1 1B A
1 1B A
1 1
1C A
1
1C A
1
1C A
1
1C B
1
1C B
1
1C A
11C B
1
1C B
1
Groups of One –8 (not shown)
Groups of Two –12
15

Groups of Four –6
Three Variable K-Map Groupings
V
0 0
0 0
0 0
0 0C C B A B A BA BA
1C
1
1
1
1C
1
1
1A
1 1
1 1B 1 1
1 1A 1 1
1 1B
1 1
1 1
16

Group of Eight -1
Three Variable K-Map Groupings
V
1 1
1 1
1 1
1 1C C B A B A BA BA 1
17

Example #2: 3 Variable K-Map
Example:
After labeling and transferring the truth table data into the K-Map,
write the simplified sum-of-products (SOP) logic expression for the
logic function F
2.
EFGF
2
0000
0011
0101
0110
1000
1011
1101
1110
18

Example #2: 3 Variable K-Map
Example:
After labeling and transferring the truth table data into the K-Map,
write the simplified sum-of-products (SOP) logic expression for the
logic function F
2.
V
0 1
1 0
1 0
0 1G G F E F E F E F E
Solution:G F G FF +=
2 G F G F
EFGF
2
0000
0011
0101
0110
1000
1011
1101
1110
19

Four Variable K-Map Groupings
V
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0B A B A BA BA D C D C D C D C
Groups of One –16 (not shown)
Groups of Two –32 (not shown)
Groups of Four –24 (seven shown)C B
1 1
1 1D B
1 1
1 1D A 1
1
1
1C B
1 1
1 1D B
1
1
1
1D A 1
1
1
1D B 11
11
20

Four Variable K-Map Groupings
V
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0B A B A BA BA D C D C D C D C
Groups of Eight –8 (two shown)B
1 1 1 1
1 1 1 1D
1
1
1
1
1
1
1
1
21

Four Variable K-Map Groupings
V
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1B A B A BA BA D C D C D C D C
Group of Sixteen –11
22

Example #3: 4 Variable K-Map
Example:
After labeling and transferring the truth table data into the K-Map, write the
simplified sum-of-products (SOP) logic expression for the logic function
F
3.
R S T U F
3
0 0 0 0 0
0 0 0 1 1
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 1
1 1 1 1 1
V
23

Don’t CareConditions
•A don’t carecondition, marked by (X) in the truth
table, indicates a condition where the design
doesn’t care if the output is a (0) or a (1).
•A don’t carecondition can be treated as a (0) or
a (1) in a K-Map.
•Treating a don’t careas a (0) means that you do
not need to group it.
•Treating a don’t care as a (1) allows you to make
a grouping larger, resulting in a simpler term in
the SOP equation.
24

Some You Group, Some You Don’t
V
X 0
1 0
0 0
X 0C C B A B A BA BA C A
This don’t carecondition was treated as a (1).
This allowed the grouping of a single one to
become a grouping of two, resulting in a simpler
term.
There was no advantage in treating this
don’t carecondition as a (1), thus it was
treated as a (0) and not grouped.
25

Example #4: Don’t CareConditions
Example:
After labeling and transferring the truth table data into the K-Map, write the
simplified sum-of-products (SOP) logic expression for the logic function
F
4. Be sure to take advantage of the don’t careconditions.
R S T U F
4
0 0 0 0 X
0 0 0 1 0
0 0 1 0 1
0 0 1 1 X
0 1 0 0 0
0 1 0 1 X
0 1 1 0 X
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1
1 0 1 0 1
1 0 1 1 X
1 1 0 0 X
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
V
26

Grouping 1s
•Goal:
➢Maximize the size of groups
➢Minimize the number of groups
•Rules:
➢A group must contain 2
n
cells
➢Each cell in a group must be
adjacent to one or more cells in
that same group
➢Always include the largest
possible number of 1’s in a group
➢Each 1 must be included in at
least one group
1 1
11 1
11 1
1 11
00
01
11
10
00 01 11 10
4-variable K-map
AB
CD

Grouping 1s
•Goal:
➢Maximize the size of groups
➢Minimize the number of groups
•Rules:
➢A group must contain 2
n
cells
➢Each cell in a group must be
adjacent to one or more cells in
that same group
➢Always include the largest
possible number of 1’s in a group
➢Each 1 must be included in at
least one group
1 1
11 1
11 1
1 11
00
01
11
10
00 01 11 10
4-variable K-map
AB
CD

Example -K-map Simplification for SOP
1001
1101
1101
1011
00
01
11
10
00 01 11 10
AB
CD
Only variable D
remains ‘0’ in this
group of orange cells
=> Product term = D
Variable A, B and C
remains as ‘1’, ‘0’ and ‘1’
respectively in this group
of cells
=> Product term = ABC
Product term = BCCBACBDX ++= CBADCDCBDCX ...... +++=

1
1
11
Mapping a Standard SOP Expression
•A ‘1’ is placed on the K-map for each product
term in the expression.
•Fill ‘0’ into the blanks.CBACBACBACBAX ........ +++=
Example:
Map
00
01
11
10
0 1
3-variable K-map
AB
C
00
0
0

1
1
11
Example-K-map Simplification for SOPCBACBACBACBAX ........ +++=
00
01
11
10
0 1
3-variable K-map
AB
C
00
0
0
Only A, B variables are unchanged
A’.B’
Only A, C variables are unchanged
A.C’
X = A’.B’ + A.C’

K-map Simplification for POS
Expressions
•After mapping an POS expression, perform
the following 3 steps:
➢Group the 0’s
➢Determining sum term for each group
✓Each group creates one sum term that composed of all
variables that occur in only one form within the group
➢Multiplying the resulting sum terms
✓Multiply all sum terms together to form the Minimum POS
Expression

Grouping 0’s
•Goal:
➢Maximize the size of groups
➢Minimize the number of groups
•Rules:
➢A group must contain 2
n
cells
➢Each cell in a group must be
adjacent to one or more cells in
that same group
➢Always include the largest
possible number of 0’s in a
group
➢Each 0 must be included in at
least one group
0 0
00 0
00 0
0 00
00
01
11
10
00 01 11 10
4-variable K-map
AB
CD

0 0
00 0
00 0
0 00
00
01
11
10
00 01 11 10
AB
CD
Only variable D
remains ‘0’ in this
group of orange cells
=> Sum term = D
Sum term = CB+
Variable A, B and C
remains as ‘1’, ‘0’ and ‘1’
respectively in this group
of cells
=> Sum term =CBA++ )).(.( CBACBDX +++= )).().().(( DCCBADCBDCX ++++++=
Example-K-map Simplification for POS

0
0
Mapping a Standard POS Expression
•A ‘0’ is placed on the K-map for each sum
term in the expression.
•Fill ‘1’ into the blanks.))()()(( CBACBACBACBAX ++++++++=
Example:
Map
00
01
11
10
0 1AB
C
0
0
1
1
1
1

0
0
Example-K-map Simplification for POS)).().().(( CBACBACBACBAX ++++++++=
00
01
11
10
0 1AB
C
0
0
1
1
1
1
Only A, C variables are unchanged
A+C
Only B, C variables are unchanged
B’+C
X = (A+C).(B’+C).(A’+B+C’)
Only A, B, C variables are unchanged
A’+B+C’

Make a Choice
•Given no restrictions on the structure of the designed
circuit, choose the optimized SOP structure or optimized
POS structure based on the hardware cost
0110
0010
0010
0100
00
01
11
10
00 01 11 10
AB
CDBCDDBADCBY ++=
Minimum SOP Expression
Minimum POS Expression)).(.( CBACBDX +++=
-Six 2-input AND
-Two 2-input OR
-Three NOT
-Two 2-input AND
-Three 2-input OR
-Three NOT
In this case, POS structure would be
chosen!!
Example:

SOP Example: Segment b
Minimal SOP expression:
b = I
2’ + I
1’.I
0’+ I
1.I
0
In this case, the X’s (highlighted) are chosen to be logic 1’s amd 0’s to
obtain the most simplified SOP hardware structure!!

















1 1 1 1
1 0 1 0
1 0 1 0
1 1 1 1
I
3
I
2

I
1I
0

00
01
11
10
00 01 11 10 I0I1
b

•K-map basics
•http://www.ee.surrey.ac.uk/Projects/Labview/
minimisation/karnaugh.html
•http://www.allaboutcircuits.com/vol_4/chpt_8
/5.html
•K-map SOP/POS demonstration
•http://www.youtube.com/watch?v=5UUOTHq
bXpE
•http://www.youtube.com/watch?v=d8OxGyaq
QPM
Tags