Sie sind auf Seite 1von 84

K-MAP

Digital Electronics
BCA Sem II
JIMS

1
What is a K MAP ?
• A Karnaugh map (or K-map) is a graphic means of
depicting Boolean functions. K-maps are used to
simplify Boolean functions and expressions
without using algebra-based Boolean methods.
•  
Generally, a K-map is used for minimizing Boolean
expressions with less than six or seven variables.

2
• In an n-variable k-map, there are 2^n cells.
• Each cell corresponds to one combination
of n-variables.
Minimization as SOP using K-map
– Enter 1s in the K-map for each product term in
the function
– Group adjacent K-map cells containing 1s to
obtain a product with fewer variables.
• Groups must be in power of 2 (2, 4, 8,)

4
Two-Variable K-Map
a
b 0 1
0 m0 m2
A’B’ AB’

1 m1 m3
A’B AB
F=X'Y+XY

In this example we have the equation as


input, and we have one output function.
Draw the k-map for function F with marking 1
for X'Y and XY position. Now combine two
1's as shown in figure to form the single
term. As you can see X and X' get canceled
and only Y remains.
F=Y
6
F=X’Y +XY

X
Y 0 1

0
F=Y
1
1 1

7
F=X'Y+XY+XY'
In this example we have the equation as
input, and we have one output function. Draw
the k-map for function F with marking 1 for
X'Y, XY and XY position. Now combine two
1's as shown in figure to form the two single
terms.
F=X+Y

8
F=X'Y+XY+XY'

X
Y 0 1

1
0

1
1
F= X+ Y
1

9
• F(x,y)=SIGMA(0,2,3)
F(x,y)=SIGMA(0,2,3)

X
Y 0 1

1
0 1

1 F= X+ Y’
1

11
Three-Variable K-Map

ab
c 00 01 11 10

0 m0 m2 m6 m4
A’B’C’ A’BC ABC’ AB’C’

1 m1 m3 m7 m5
A’B’C A’BC ABC AB’C
Example
• Use a K-Map to simplify the following
Boolean expression:
• F(X,Y,Z)= SIGMA(0,2,4,5,6)
F(X,Y,Z)= SIGMA(0,2,4,5,6)

XY
Z 00 01 11 10

1 1 1
0 1

1
1

F=Z’ + XY’

14
Example
• Use a K-Map to simplify the following
Boolean expression:
• F(A,B,C)= A’B’C’+A’BC’+ABC’+A’BC+ABC

• F(A,B,C)=ABC’+ABC+A’BC+AB’C=
F(A,B,C)=
A’B’C’+A’BC’+ABC’+A’BC+ABC

AB
C 00 01 11 10

1 1
0 1

1
1 1

F = B + A’C’

16
F(A,B,C)=ABC’+ABC+A’BC+AB’C

AB
C 00 01 11 10

1
0

1
1 1 1

F = AB + BC + AC

17
F(A,B,C)=Sigma m (2,3,6,7)
Sigma m (2,3,6,7)
Step 1: Plot the K-map
ab
c 00 01 11 10

0 1 1

1 1 1
Three-Variable K-Map Example
Step 2: Circle ADJACENT CELLS
ab
c 00 01 11 10

0 1 1

1 1 1
Three-Variable K-Map Example
Step 5: Read the map.

ab b
c 00 01 11 10

0 1 1

1 1 1
AB
C 00 01 11 10

1 1
0

1 1
1

F= B'

23
• F(X,Y,Z)= SIGMA m(1,3,5,6)
• F(A,B,C) = SIGMA m (0,1,2,3,4,5,6)
F(X,Y,Z)= SIGMA m(1,3,5,6)

XY
Z 00 01 11 10

1
0

1 1 1
1

F= X'Z + Y'Z +XYZ'

25
SIGMA m (0,1,2,3,4,5,6)

F= C' + A' +B'


Four-variable K-Map
ab
cd 00 01 11 10

00 m0 m4 m12 m8
A’B’C’D' A’BC’D' ABC’D' AB'C’D'
01 m1 m5 m13 m9
A’B’C’D A’BC’D ABC’D AB'C’D

11 m3 m7 m15 m11
A’B’CD A’BCD ABCD AB'CD
m2 m6 m14
10 m10
A’B’CD' A’BCD' ABCD' AB'CD'
AB
CD 00 01 11 10

1 1
00
1
01 1

1 1
11

10 1
1
AB
CD 00 01 11 10

1 1
00
1
01 1
B'
1 1
11

10 1
1
• SIMPLIFY USING K MAP
A’B’C’D’+A’B’C’D+A’B’CD+A’BC’D’+A’BC’D
+A’BCD+ABC’D’+ABC’D+ABCD
AB AB AB

CD CD CD
• F= A'B'C'D' +A'BC'D+ A'BC'D' +AB'C'D' +
A'B'CD' + AB'CD' + A'B'C'D
AB
CD 00 01 11 10

1 1 1
00
1 1
01

11

10 1
1
AB
CD 00 01 11 10

1 1 1
00
1 1
01
F = B'.D' + A.'C'

11

10 1
1
AB
CD
• F(W,X,Y,Z)= SIGMA m
(0,2,3,4,7,8,9,10,11,12,13,15)
SIGMA m
(0,2,3,4,7,8,9,10,11,12,13,15)
TWO POSSIBLE SOLUTIONS
AB
CD 00 01 11 10

1 1
00
1 1
01

1
11 1

10 1 1
TWO POSSIBLE SOLUTIONS
AB
CD 00 01 11 10

1 1
00
1 1
01

1
11 1

10 1 1
K MAP FOR 2 VARIABLES FOR
POS
A
B 0 1
M0 M2
0 + B ’ + B
A A
1 M1 M3
B’
+ B’ A’ +
A

43
(A+B)(A+B’)(A’+B’)

A
B 0 1

0
0

1 (AB’)
0 0

44
K MAP FOR 3 VARIABLES
AB
C 00 01 11 10
M0 M6 M4
M2 C
C + +C
+ B+ B ’ ’ + C B
0 A A+ B A’+
A’+
1 M1 M3 ’ ’ M5 ’
M7 C
+C

B ’+ C + B ’ + B +C
A+
B A+ A’ A’+

45
(A+B+C)(A+B’+C)(A’+B’+C)
(A’+B+C)(A’+B’+C’)
AB A’+B’
C 00 01 11 10

C
0 0 0
0
0

1
0

C(A’+B’)

46
F(A,B,C)= ∏ M(0,1,2,4,5)
AB
C 00 01 11 10

0 0 0
0

1 0 0

(A+C)B

47
4 VARIABLE K MAP FOR POS
AB

CD 00 01 11 10
M0 2
+D M4 C+D M1 +C+D
00 B+
C
B ’+ B’ M8 +C+D
A+ A+ A’ + ’ +B
A
3 D’
01 M1 D’ M5 +D’ M1 + D’ 9
M +C+
+C+ C ’+C B
A+
B B ’ +
A’+
B A’+
A+
5 1
M3 M7 M1 ’+D M1
11 + D’ ’ + D’ ’+ C
’ +D’
’ B
B +C B ’+C A’ +
+B +C
A+ A+ ’ A’
0
M 2 +D M1
4 ’+D M1 D
M6 C’+D B’+
C
C’+
C’ +
B + B ’+ A ’ B +
10 A+ A+ A’+
48
PLOT POS ON K MAP
1)F(A,B,C,D)=(A’+B’+C’+D’)(A’+B+C’+D’)
(A’+B’+C’+D)(A’+B+C’+D)

2) F(A,B,C)=PIE M (1,5,7)
3) F(A,B,C,D)= PIE M (0,1,4,5,6,8,9,12,13,14)
4)F(A,B,C,D)= PIE M(3,4,6,7,11,12,13,14,15)
ANSWERS
1)F(A,B,C,D)=(A’+B’+C’+D’)(A’+B+C’+D’)
•(A’+B’+C’+D)(A’+B+C’+D) =(A’+C’)
2) F(A,B,C)=PIE M (1,5,7) =(A’+C’)(B+C')
3) F(A,B,C,D)= PIE M (0,1,4,5,6,8,9,12,13,14)
= C(B’+D)
4)F(A,B,C,D)= PIE M(3,4,6,7,11,12,13,14,15)
=(A’+B’)(C’+D’)(B’+D)
F(A,B,C,D)= PIE M
(0,1,4,5,6,8,9,12,13,14)
AB
CD 00 01 11 10

0 0 0 0
00 C

01 0 0 0 0

SOLUTION :
11 C(B’+D)

10 0 0

B’+D
51
F(A,B,C,D)= PIE
M(3,4,6,7,11,12,13,14,15)
AB
CD 00 01 11 10

0 0
00

01 0

SOLUTION :
0 0 (A’+B’)(C’+D’)(B’+D)
11 0 0

10 0 0

B’+D
52
POS from SoP
OBTAIN THE POS FROM SOP FOR F(A,B,C,D)=
Σm(0,1,2,5,8,9,10)

53
POS from SoP
OBTAIN THE POS FROM SOP FOR F(A,B,C,D)=
Σm(0,1,2,5,8,9,10)

= ∏ M(3,4,6,7,11,12,13,14,15)

54
= ∏ M(3,4,6,7,11,12,13,14,15)
F(A,B,C,D)= (A’ + B’)(C’ + D’)(B’ + D)
AB
CD 00 01 11 10

0 0
00
0
01

0
11 0 0 0

10 0
0
OBTAIN POS & SOP OF :
AB
CD 00 01 11 10

1 0
0 1
00

0 1 0
01 1

1
11 0 1 1

10 0 1 1
1
AB
CD 00 01 11 10

0 0
0 0
00

1 1 0
01 1

1 1
11 1
1

10 0 1 1 1
• Sometimes a situation arises in which some input
variable combinations are not allowed. For
example, recall that in the BCD code there are six
invalid combinations: 1010, 1011, 1100, 1101,
1110, and 1111. Since these unallowed states will
never occur in an application involving the BCD
code, they can be treated as "don't care" terms
with respect to their effect on the output. That is,
for these "don't care" terms either a 1 or a 0 may
be assigned to the output: it really does not matter
since they will never occur.
• The "don't care" terms can be used to advantage
on the Karnaugh map.
59
• Don’t cares are plotted as ‘X’ or ‘d’ in the K
map
• Sum of products: treat ‘X’ or ‘d’ as 1 if it
allows a larger group
• Product of sums: Treat ‘ X’ or ‘d’ as 0 of it
allows a larger group

• When grouping the 1 s, the Xs can be treated


as 1s to make a larger grouping or as 0s if
they cannot be used to advantage.

60
Example
• Use a K-Map to simplify the following
Boolean expression

F  a, b, c, d    m  0, 2, 6,8,12,13,15 
 d  3,9,10 
b'd' +ac' +ab
ab
cd 00 01 11 10

00
1 1 1
01
1 d
11
d 1
10
1 1 d
F(a,b,c,d)=sigma(2,3,4,5,13,15)
+d(8,9,10,11)
F(a,b,c,d)=sigma(2,3,4,5,13,15)
+d(8,9,10,11)
AB
CD 00 01 11 10

1 d
00
d
01 1 1

AD +B’C+A’BC’
11 1
1 d

10
1 d

64
Example
• Use a K-Map to simplify the following
Boolean expression

F  a, b, c, d    m  0, 2, 6,8,12,13,15   d  3, 4,9 
F  a, b, c, d    m  0, 2, 6,8,12,13,15   d  3, 4,9 

ab
cd 00 01 11 10

00
1 d 1 1
01
1 d
11
d 1
10
1 1
F  ac  ad  abd
ab
cd 00 01 11 10

00
1 d 1 1
01
1 d
11
d 1
10
1 1
FIND MINIMAL POS AND SOP FOR
F(A,B,C,D) = m(1,3,5,7,9) + d(6,12,13)
F(A,B,C,D)=m(1,3,5,7,9)+d(6,12,13
)
Don't
Don'tCares
Carescan
canbe
betreated
treatedas
as1's
1'sor
or0's
0'sififititisisadvantageous
advantageoustotodo
doso
so
A
AB
CD 00 01 11 10
00 0 0 X 0

01 1 1 X 1 C' D + A' D
D
11 1 1 0 0
C
10 0 X 0 0

69
F(A,B,C,D) = m(1,3,5,7,9) +
d(6,12,13)
Don't
Don'tCares
Carescan
canbe
betreated
treatedas
as1's
1'sor
or0's
0'sififititisisadvantageous
advantageoustotodo
doso
so

A
AB
CD 00 01 11 10
In Product of Sums form
00 0 0 X 0

01 1 1 X 1
D
: F = D (A' + C')
11 1 1 0 0
C
10 0 X 0 0

70
F(A,B,C,D)= SIGMA m
(2,4,8,10,12,13) +d(5,9)
BC' +AC' +B'CD'
AB
CD 00 01 11 10

1 1 1
00

d 1 d
01

11

10 1 1
Five Variable K-Maps
F  a,b,c, d ,e 
• 32 minterms require 32 squares in
the k-map
• Minterms 0-15 belong to the
squares with variable A=0, and
minterms 16-32 belong to the
squares with variable A=1
Use Two Four-variable K-Maps

A=0 map A=1 map

bc bc
00 01 11 10 de 00 01 11 10
de
00 00

01 01

11 11

10 10
Five variable example

F a,b,c,d ,e    m  5 , 7 , 1 3 , 1 5 , 2 1, 2 3 , 2 9 , 3 1 
Use Two Four-variable K-Maps

A=0 map A=1 map

bc bc
de 00 01 11 10 de 00 01 11 10

00 00

01
1 1 01
1 1
11 1 1 11 1 1
10 10

F a,b,c,d ,e    m  5 , 7 , 1 3 ,1 5 , 2 1, 2 3 , 2 9 , 3 1 
Use Two Four-variable K-Maps

A=0 map A=1 map

bc bc
de 00 01 11 10 de 00 01 11 10

00 00

01
1 1 01
1 1
11 1 1 11 1 1
10 10

F1  a  c e  F2  a  ce 
Five variable example

F  F1  F 2  a  c e   a  c e   c e
F(A,B,C,D,E)=sigma
m(0,2,4,6,7,8,10,12,14,
15,22,23,30,31)
sigma(0,2,4,6,7,8,10,12,14
,15,22,23,30,31)= a'e' +cd
A=0 map A=1 map

bc bc
00 01 11 10 de 00 01 11 10
de
00
00
1 1 1 1
01 01

11 11
1 1
1 1
10 1 1 1 1 10 1 1

Das könnte Ihnen auch gefallen