Vous êtes sur la page 1sur 41

EEE 21

Switching Theory and


Digital Logic Design

Lecture 4b

Karnaugh maps
SOP form
EEE 21

Minimizing Boolean
Expressions

Minimal form of a boolean expression

fewest literals and product (or sum) terms as


possible
not necessarily unique

Methods of minimization

Using Boolean manipulation


Using Karnaugh map
Using Tabular method
EEE 21

2/41

Karnaugh Maps (K-maps)

rearranged truth table showing the implicants


involved in any canonical or standard form
displays the minterms of a function in a
geometrical pattern such that the application
of the logical adjacency theorem becomes
obvious

EEE 21

3/41

Implicant

P is an implicant of function F if whenever P


is 1, F also takes the value 1
a "covering" (sum term or product term) of one
or more minterms in a sum of products (or
maxterms in a product of sums) of a Boolean
function

EEE 21

4/41

Logical Adjacency

Two cells in a Karnaugh map are said to be


logically adjacent when their corresponding
input combinations differ by only one bit.

Example:

Logically
adjacent

0010
0110
1010
1011
1100
1101
1110
1111
EEE 21

Logically adjacent
Not logically adjacent

5/41

Drawing a K-Map

Construct a grid with as many cells as


there are possible output combinations
for the given number of input variables
Each cell maps a row in the truth table
As you move from one cell to another, one variable
changes each time a boundary is cut or crossed

EEE 21

6/41

Drawing a K-Map: 3-bit Input


Input variable (MSB)
AB
Input
variable
(LSB)

f(A,B,C)
00

01

11

10

m0

m2

m6

m4

m1

m3

m7

m5

Note:
MSB = most significant bit,
LSB = least significant bit

Cell corresponding to
input ABC = 011 or
minterm 3

EEE 21

ABC

minterm

000

m0

001

m1

010

m2

011

m3

100

m4

101

m5

110

m6

111

m7

7/41

Drawing a K-Map
Note: Input values must change by only one bit as
you move from one cell to another to make the cells
logically adjacent.

AB

00

01

11

10

m0

m2

m6

m4

m1

m3

m7

m5

Note the ordering of


minterms !

f(A,B,C)

EEE 21

8/41

Drawing a K-Map: 4-bit Input


f(A,B,C,D)
AB

ABCD

minterm

ABCD

minterm

0000

m0

1000

m8

0001

m1

1001

m9

00

01

11

10

00

m0

m4

m12

m8

0010

m2

1010

m10

01

m1

m5

m13

m9

0011

m3

1011

m11

0100

m4

1100

m12

0101

m5

0101

m13

0110

m6

0110

m14

0111

m7

0111

m15

CD

11

m3

m7

m15

m11

10

m2

m6

m14

m10

f(A,B,C,D)

EEE 21

9/41

Drawing a K-Map: 5-bit Input

f(A,B,C,D,E)

Partition the truth table


into two:
MSB = A = 0
MSB = A = 1
ABCDE

minterm

00000

m0

00001

m1

...

...

01110

m14

01111

m15

10000

m16

10001

m17

...

...

11110
11111

BC

(A=0)

00

01

11

10

00

m0

m4

m12

m8

01

m1

m5

m13

m9

11

m3

m7

m15

m11

10

m2

m6

m14

m10

DE

BC

(A=1)

00

01

11

10

00

m16

m20

m28

m24

01

m17

m21

m29

m25

m30

11

m19

m23

m31

m27

m31

10

m18

m22

m30

m26

DE

EEE 21

10/41

Drawing a K-Map: 6-bit Input


f(A,B,C,D,E,F)
Partition the truth table
into four:
MSB = AB = 00
MSB = AB = 01
MSB = AB = 10
MSB = AB = 11

ABCDEF

minterm

ABCDEF

minterm

000000

m0

100000

m32

000001

m1

100001

m33

...

...

...

...

001110

m14

101110

m46

001111

m15

101111

m47

010000

m16

110000

m48

010001

m17

110001

m49

...

...

...

...

011110

m30

111110

m62

011111

m31

111111

m63

EEE 21

11/41

CD

f(A,B,C,D,E,F)

(AB=00)
00

01

11

10

00

m0

m4

m12

m8

01

m1

m5

m13

11

m3

m7

10

m2

m6

EF

CD

CD

(AB=01)
00

01

11

10

00

m16

m20

m28

m24

m9

01

m17

m21

m29

m25

m15

m11

11

m19

m23

m31

m27

m14

m10

10

m18

m22

m30

m26

00

01

11

10

EF

CD

00

01

11

10

00

m32

m36

m44

m40

00

m48

m52

m60

m56

01

m33

m37

m45

m41

01

m49

m53

m61

m57

11

m35

m39

m47

m43

11

m51

m55

m63

m59

10

m34

m38

m46

m42

10

m50

m54

m62

m58

EF

EF

(AB=10)

(AB=11)
EEE 21

12/41

Example
Example: f(A,B,C) = m(1,2,3,5,7)

ABC
000

f
0

001

010

011

m1
m2
m

100

m4

101

110

m5
m6

111

m7

AB

m0

00

01

11

10

EEE 21

13/41

From K-Maps
to Boolean Expressions
AB

00

01

11

10

{ 001, 010, 011, 111, 101 }

f(A,B,C) = m(1,2,3,5,7)
= ABC + ABC + ABC + ABC + ABC = (AB'C + A'BC) + A'BC + (ABC + AB'C) + A'BC'
= (AC)(B'+B) + (AC)(B+B') + A'BC + A'BC'
= AB + C
= (AC)(1) + (AC)(1) + A'B(C+C')
= AC + AC + A'B
= C(A'+A) + A'B
= C + A'B

EEE 21

14/41

From K-Maps
to Boolean Expressions

AB

00

01

11

10

Physically adjacent:
They differ in only 1 bit in their coordinates
A'B'C + A'BC + ... = A'C (B'+B) + .. = A'C + ...
Logically adjacent: They differ in only one variable (B)

EEE 21

15/41

From K-Maps
to Boolean Expressions

AB

00

01

11

10

ABC

AB'C

A'C

AC(B+B') = AC

EEE 21

16/41

From K-Maps
to Boolean Expressions

AB

00

01

11

10

A'C

AC
C(A'+A) = C

EEE 21

17/41

From K-Maps
to Boolean Expressions
A'BC' + A'BC = A'B(C'+C) = A'B
AB

00

01

11

10

C
f(A,B,C) = A'B + C

EEE 21

18/41

Reading K-Maps: Groups

Group only entries that are logically adjacent


Groups should be of size 2n x 2m, where n
and m are integers.

Ex: 1x1, 1x2, 1x4, 2x4, 1x8, 2x2, 4x4, 2x8...


Not allowed: 1x6, 2x5, etc.

Group types

Island: single entry


Dual: two entries in a group
Quad: four map entries
Octet: eight map entries
EEE 21

aim for the largest


grouping possible

19/41

Reading K-Maps: Groups

Island: consists of a single entry


that will not group with any other
entry
AB

00

01

11

10

00

01

11

10

CD

Island

EEE 21

Island

20/41

Reading K-Maps: Groups

Dual: entry that will group with


only one other entry
AB

00

01

11

10

00

01

11

10

CD

EEE 21

Dual
Dual

21/41

Reading K-Maps: Groups

Quad: consists of four map entries


AB

00

01

11

10

00

01

11

10

CD

EEE 21

Quad

Quad

22/41

Reading K-Maps: Groups

K-map groups can wrap-around the edges

For entries located at the edges of the map, think


of the K-map as a piece of cardboard you can roll
so that ends meet
AB

00

01

11

10

00

01

11

10

CD

EEE 21

Quad

23/41

Reading K-Maps: Groups

K-map groups can wrap-around the edges


AB

00

01

11

10

00

01

11

10

CD

EEE 21

Octet
Octet

24/41

Reading K-Maps:
Groups

F(A,B,C,D,E,F)

Stacking K-maps

For entries located on


multiple K-maps
Think of each K-map as a
piece of cardboard stacked in
order of logical adjacency
Groups can then pierce or
slice through the stack

EEE 21

25/41

BC

Example

(A=0)
00

01

11

10

00

01

11

10

00

01

11

10

00

01

11

10

DE

BC
DE

The top and bottom


octets can be
combined to form a
larger group.
F(A,B,C,D,E) = B

(A=1)
EEE 21

26/41

BC

Example

(A=0)
00

01

11

10

00

01

11

10

00

01

11

10

00

01

11

10

DE

BC
DE

F(A,B,C,D,E) = C

(A=1)
EEE 21

27/41

Reading K-Maps: Procedure

Search for groups one size at a time, starting with


islands, then duals, etc.

Group only entries that are logically adjacent


Groups should be as large as possible

Order of creating groups of a given size

uncovered entries that will group in only one way


uncovered entries that will group in more than one way
but will not form a bigger group, and will group only with
uncovered entries
uncovered entries that will group in more than one way
but will not form a bigger group, and will group with
other covered entries
EEE 21

28/41

Reading K-Maps: Procedure

Groups may overlap as long as each group


contains at least one unique entry not covered
by any other group
Stop when every entry has been covered at
least once.
Remove redundant groups.

A group is redundant when all its entries are


covered by other groups.

EEE 21

29/41

Redundant groups: Example


BC

00

01

11

10

00

01

11

10

DE

BC

BC

(A=0)
00

01

11

10

00

01

11

10

DE

Octet marked in
green is redundant.
Will add an extra
term and the
expression is no
longer minimal

(A=1)
EEE 21

30/41

From K-Maps to Boolean Expressions:

Minimal Sum of Product (SOP)

To form minimal SOP expressions, group


entries that are 1
Each group found represents a product term in
the Boolean expression

Find the input bits that do not change from one cell
to another in the K-map
For each constant variable representing the input bit

Bit 1: literal is normal (uncomplemented)


Bit 0: literal is complemented

Sum all the product terms


EEE 21

31/41

From K-Maps to Boolean Expressions

Minimal SOP: Example 1


AB

00

01

11

10

AB

C
f(A,B,C) = AB+C

EEE 21

32/41

From K-Maps to Boolean Expressions

Minimal SOP: Example 2

Given the K-map below, find the minimal SOP expression for f(A,B,C,D):
AB

00

01

11

10

00

01

11

10

CD

EEE 21

F(A,B,C,D) = ABCD
+ ABC
+ BD
+ AD

33/41

BC

Example 3

(A=0)
00

01

11

10

00

01

11

10

00

01

11

10

00

01

11

10

DE

BC
DE

F = AB + AC

(A=1)
EEE 21

34/41

Examples

AB

function F
00

01

11

10

00

01

11

10

CD

F=1
EEE 21

35/41

Examples
AB

00

01

11

10

00

01

11

10

CD

function G
G=0

EEE 21

36/41

BC

Example

(A=0)
00

01

11

10

00

01

11

10

DE

BC

00

01

11

10

00

01

11

10

DE

F(A,B,C,D,E)
= AB + AC + AC

(A=1)
EEE 21

37/41

BC

Example

(A=0)
00

01

11

10

00

01

11

10

DE

BC

00

01

11

10

00

01

11

10

DE

F(A,B,C,D,E)
= BC + AC + AC

(A=1)
EEE 21

38/41

Note

The two previous examples show two


different but equally minimal solutions
for the same set of K-maps.

F = AB + AC + AC
F = BC + AC + AC

EEE 21

39/41

f(A,B,C,D,E,F) = ?? minimal SOP


CD

(AB=00)
00

01

11

10

00

01

11

10

EF

CD

CD

(AB=01)
00

01

11

10

00

01

11

10

00

01

11

10

EF

CD

00

01

11

10

00

00

01

01

11

11

10

10

EF

EF

(AB=10)

(AB=11)
EEE 21

40/41

Exercise

Simplify AB + AC + BC using a K-map

AB
C

00

01

0
1

11

10

1
1

AB + AC + BC = AB + AC

EEE 21

41/41

Vous aimerez peut-être aussi