Download as ppsx, pdf, or txt
Download as ppsx, pdf, or txt
You are on page 1of 33

ITBP205

Digital Design and Computer


Organization
Unit 5
Karnaugh Map
Prof. Walid Ibrahim

Outline
Introduction
2, 3, and 4 inputs K-map
Grouping rules
Selection Rules
Dont Care Conditions

Introduction
A K-map provides a systematic method for simplifying
Boolean expressions
If properly used, it will produce the simplest SOP
expression possible, known as the minimum
expression.

K-map is similar to truth table; instead of being


organized into columns and rows, K-map is an array of
cells in which each cell represents a minterm.

Cells are arranged in a way so that simplification of a


given expression is simply a matter of properly
grouping the cells.
3

Introduction
The K-map process has several advantages over
the algebraic method
K mapping is a more orderly process
Usually requires less steps
Always produces a minimum expression (need
to try both SOP and POS)
K-maps can be used for expressions with 2, 3, 4,
and 5 variables.
There are other techniques that designers use to
minimize logic circuits with more than four
inputs. Most of these techniques can be
translated into a computer program that will
perform the minimization
4

Two Variables K-map

B
0
0
A
1

1
m0

AB

m1

AB
m3

m2

AB

AB

Three Variables K-map

BC
00
0
A
1

01
m0

ABC

m1

ABC

m4

AB C

11
m3

A BC

m2

A BC
m7

m5

AB C

10

ABC

m6

ABC

Four Variables K-map

CD
00
0
0
0
1
AB
1
1
1
0

01
m1

m0

m4

m6

m15

m9

m2

m7

m13

m8

10
m3

m5

m12

11

m14

m11

m10

Mapping SOP to K-map


F (A, B, C, D) = m0 + m1 + m6 + m7 + m9 + m11+ m13
CD
00
0
0
AB

0
1
1
1
1
0

01
m0

11

10

m1

m3

m2

m5

m7

m6

m4

m12

m13

m15

m14

m9

m11

m10

m8

Exercise
Draw the k-Map for the following
functions:

Grouping 1s
You can group 1s on the K-map by enclosing
those adjacent cells containing 1s.
The goal is to maximize the size of the groups
and to minimize the number of groups
according to the following rules:
A group must contain either 1,2,4,8,or 16
cells
Each cell in a group must be adjacent to
one or more cells in that same group, but
all cells in the group do not have to be
adjacent to each other.
Always include the largest possible number
of 1s in a group in accordance with rule 1.
Each 1 on the map must be included in at
least one group. The 1s already in a group
can be included in another group as long as

Cell Adjacency

11

Example
F (A, B, C) = m2 + m3 + m4 + m7
BC
00
0
A
1

01

11

m0

m1

m4

m5

1
1

10
m3
m7

m2
m6

12

Example

F (A, B, C, D) = m0 + m1 + m4 + m5 + m6 + m7+ m9 + m
CD
00
0
0
AB

0
1
1
1
1
0

01
m0

1
1

m4
m12

1
1

11
m1

m3

m2

m5

m7

m6

m13

m9

m8

10

m15
m11

m14
m10

1
13

Example
F (A, B, C, D) = m0 + m2 + m4 + m5 + m6 + m8 +
m10+ m11 + m13 + m14
CD
00
0
0
AB

01
m1

m0

0
1

1
1

1
0

m4
m12
m8

11
m3

m5

1
1

10

m7

m13

m15

m9

m11

m2

1
1
1

m6
m14
m10

1
14

Why Grouping

(A, B, C) = m1 + m2 + m3 + m5 + m7
BC

00

0
A
1

01
m0

11
m1

1
m4

10
m3

1
m5

15

m2

1
m7

m6

Example
B, C, D) = m0 + m1 + m4 + m5 + m6 + m7+ m9 + m11
CD

00
0
0

AB

0
1
1
1
1
0

01
m0

1
1

m4
m12

1
1

11
m1

m3

m2

m5

m7

m6

m13

m9

m8

10

m11

1
16

m15

m14
m10

Definitions
Implicant - a single
minterm or group of
minterms that can be
combined together on
the K-map.
Prime Implicant Implicant that can not
be combined with
another one to remove
a literal.
Essential Prime
Implicant - A prime
imlpicant that includes
a minterm not covered
by any other prime
implicant.

BC
00
0
A
1

01
m0

11

10

m1

m3

m2

m5

m7

m6

1
m4

17

Example

,Essential
00

0
0
0
1
AB
1
1
1
0

CD

01

11
m1

m0

1
m4

1
1

m12
m8

m3

m2

m7

m6

1
m5

10

m13

m9

m15
m11

1
1

m14
m10

,notessential
18

,Essential

Selection Rules
All 1s should be covered by prime implicants

Select all essential prime implicants first

If some of the 1s are still not covered


Select from the remaining prime implicants
in such a way to minimize the overlap among
selected implicants
19

Example

,Essential

CD

00
0
0
0
1
AB
1
1
1
0

01

11

,Essential
10

m0

m1

m3

m2

m4

m5

m7

m6

1
1
1

m12
m8

1
1

m13
m9

m15

m14

m11

m10

20

,Essential

Example

,Essential

CD

00
0
0
0
1
AB
1
1
1
0

01

11
m1

m0

,Essential
10

m3

m2

m7

m6

1
m4

m12
m8

m5

m13
m9

1
1

m15
m11

1
1

m14
m10

21

,Essential

Example

,NotEssential

,NotEssential
CD
00

0
0
0
1
AB
, Essential 1
1
1
0

01

11
m1

m0

10
m3

m12
m8

m2

1
m4

1
1

m5

m7

m6

m13

m15

m14

m9

m11

m10

22

,Essential

Example

CD
00
0
0
0
1
AB
1
1
1
0

01

11
m1

m0

10
m3

1
m4
m12

m8

m5

1
1

m13
m9

m2

1
m7

m6

m15

m14

m11

m10

23

Exercise
Use k-map to simplify the following
problems

24

Dont care conditions


Some logic circuits can be designed so that
there are certain input conditions for which
there are no specified output levels
This is the case because these input
conditions will never occur
Therefore, we dont care whether the
output is HIGH or LOW
Hence, we choose the dont care as either 1
or 0 depending on which helps the K-map
minimization
25

Example
Simplify the following function
CD
00
0
0
0
1
AB
1
1
1
0

01

11
m1

m0

m3

m2

m7

m6

X
m4

10

m5
m13

m12
m8

1
1

m9

X
X
X

m15
m11

1
X

m14
m10

26

Exercise
Simplify the following k-maps with and
without dont the care conditions
CD
00
0
0
0
1
AB
1
1
1
0

01
m1

m0

1
1

10
m3

1
m4

11

m12

1
m5

m13
m9

m8

m2

X
1
1

m7

m6

m15

m14

m11

1
1

m10

Exercise
Simplify the following k-maps with and
without dont the care conditions
CD
00
0
0
0
1
AB
1
1
1
0

01

11
m1

m0

1
m4

m12

m13

m2

X
m7

m9

m8

m3

m5

10

m15
m11

m6

1
X
X

m14
m10

Exercise
Use K-Map to simplify the following function
F (A, B, C, D) = m0 + m2 + m5 + m8
+ m10+ m15

Repeat the above problem if the circuit has


the following dont care minterms
D (A, B, C, D) = m1 + m3 + m13 + m14

29

Elevator Controller
We need to design a logic circuit to
control an elevator door in a threestory building. The circuit has four
inputs. M is a logic signal that
indicates when the elevator is
moving (M=1) or stopped (M=0). F1,
F2, and F3 are floor indicator signals
that are normally LOW, and they go
HIGH only when the elevator is
positioned a the level of that
particular floor. For example, when
the elevator is lined up level with
the second floor, F2=1 and F1 = F3 =
0. The circuit output is the OPEN
signal (O) which is normally LOW
and goes HIGH only when the
elevator door is the elevator is
stopped at one of the three floors.

MF1F2F3

Elevator
control
O

30

Elevator Controller
M

F1

F2

F3

0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1

0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

0
1
1
X
1
X
X
X
0
0
0
X
0
X
X
X
31

Elevator Controller
F2 F 3
00
0
0
0
MF 1
1
1
1
1
0

01
m1

m0
m4

m12
m8

11

1
X
X

m5
m13
m9

10
m3

X
X
X

m7
m15
m11

m2

1
X
X

m6
m14
m10

32

Homework
Page 178
Problems 2.i, 2.m, and 2.n
Problem 3
Problem 4.b and 4.e

Page 179
Problem 5.c, 5.d, 5.e, 5.f, and 5.g

33

You might also like