Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

K'Map - Semplification of boolean functions, Study notes of Digital Electronics

logical gate

Typology: Study notes

2011/2012

Uploaded on 03/17/2012

mohitsaini111
mohitsaini111 🇮🇳

5 documents

1 / 34

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
4. Simplification of Boolean Functions 4-1
Chapter 4. Simplification of Boolean
Functions
Boolean Cubes and Boolean Functions
01
01
11
10
00
(a) n = 1
(b) n = 2
(c) n = 3
(d) n = 4
1100
0000
0010 0011
0001
0110
0111
0101
1111
1011
1001
1000
1110
1110
0100
000
010 011
111
101
110
001
100
Figure 1: Boolean cubes [Gajski].
c
Cheng-Wen Wu, Lab for Reliable Computing (LaRC), EE, NTHU 2005
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download K'Map - Semplification of boolean functions and more Study notes Digital Electronics in PDF only on Docsity!

Chapter 4. Simplification of Boolean

Functions

Boolean Cubes and Boolean Functions

0 1

01

(^1011)

00

(a) n = 1

(b) n = 2

(c) n = 3

(d) n = 4

1100

0000

0010 0011 0001 0110 0111 0101 1111

1011 (^10001001)

1110

1110

0100

000

010 011

111 101

110

001

100

Figure 1: Boolean cubes [Gajski].

  • A Boolean n-cube uniquely represents a Boolean function of n variables if each vertex is assigned a 1 (marked) or 0 (unmarked).
  • Each vertex of the n-cube represents a minterm (a row in the truth table).

Example 1 Fig. 2 shows the truth table and the corresponding cube representations of the carry and sum functions. 2

(c) Sum function s (^) i

(b) Carry function c^ i+

(a) Truth table

c (^) i x (^) i yi^ c^ i+1 s (^) i (^00 00 01 00 ) (^00 11 01 01 ) (^11 00 01 01 ) (^11 11 01 11 )

000

010 011

111 101

110

001

000

010 011

111 101

110

001

100

100

Figure 2: Boolean-cube representations for carry and sum functions [Gajski].

+ (a) Each m-subcube of the n-cube represents 2 m^ minterms with the same

n m literals, where m < n; (b) each m-subcube with 2 m^ 1-minterms

represents a product term of n m literals.

  • A prime implicant (PI) is a subcube (of 1-minterms) that is not contained in any other subcube (of 1-minterms); an essential prime implicant (EPI) is a PI that contains a 1-minterm that is not contained in any other PI.
  • K-map is in fact a visual diagram of all possible ways a function may be expressed—the simplest one can easily be identified.

/ K-maps provide visual aid to identify PIs and EPIs. / They are used for manual minimization of Boolean functions.

Exercise 1 How do you transform a K-map into a truth table? Is it unique? How do you transform a K-map into an n-cube? Is it unique? 2

Two- and Three-Variable Maps

1 1 m^3

m 2

m 1

m 0 1 0

0 1

0 0

x y f

2-var map 2-var map f^ =^ xy^ x^ +^ y^ (x^ ^ y^ )^0

xy 0 xy

x^0 y 0 x^0 y 1

1 1 1

1 1

xy 0 1

x y^0 0 1

0 1 0 1

1

0

(^01) x^ y

1

0

x^ y

m 2 m 3

m 0 m 1

Figure 4: Two-variable maps.

xy 0 z 0 xy 0 zxy^ z xy z 0

x^0 y 0 z 0 x^0 y 0 z x^0 y z x^0 y z 0

3-var map 3-var map f^ =^ z^ x^0 y + xy 0

1 1

1 1 1 1 1 1

xy^ z 0 1

00 01 11 10 00 01 11 10

1

0

00 01 11 10 x^ y^ z

1

0

x^ y^ z

m 4 m 5 m 7 m 6

m 0 m 1 m 3 m 2

Figure 5: Three-variable maps.

(a)

m 0 m 1 m 3 m (^2)

m 4 m 5 m 7 m (^6)

YZ X 0

00 01 X Y Z X Y Z X Y Z X Y Z

X Y Z X Y Z X Y Z X Y Z

11 10

Y

X 1

Z (b) Fig. 2-10 Three-Variable Map

Figure 6: Three-variable map simplification [Mano & Kime].

  • Minterms are arranged in the Gray-code sequence. (Why?)

  • Any 2 (horizontally or vertically) adjacent squares differ by exactly 1 vari- able, which is complemented in one square and uncomplemented in the other.

  • Any 2 minterms in adjacent squares that are ORed together will cause a re-

moval of the different variable, e.g., m 5 + m 7 = xy 0 z + xy z = xz (y 0 + y ) =

xz , because y + y 0 = 1.

0^01 1^11^3^10 2

4 5 7 6

0

1

i^0

x y i i c 1

1 1 1

0^01 1^11 3^10 2

4 5 7 6

0

1

i i^ i^0

x y c 1

1 1

1

Figure 7: K-maps for the carry and sum functions [Gajski].

Example 2

Simplify the following Boolean functions: (a) F 1 (X ; Y ; Z ) =

P

(3; 4 ; 6 ; 7); (b)

F 2 (X ; Y ; Z ) =

P

0 1

Y

Z

X

(b) F 2 (X, Y, Z) = Σm(0, 2, 4, 5, 6) = Z + XY

00 01 11 10 1

YZ X

1

1 1 1

0 1

Y

Z

X 1

00 01 11 10 1

YZ X

1 1

(a) F 1 (X, Y, Z) = Σm(3, 4, 6, 7) = YZ + XZ Fig. 2-14 Maps for Example 2-

2

  • The map is considered to lie on a surface with the top and bottom edges, as well as the right and left edges, touching each other to form adjacent squares.

/ One square ) a minterm of 4 literals.

/ Two adjacent squares ) a term of 3 literals.

/ Four adjacent squares ) a term of 2 literals.

/ Eight adjacent squares ) a term of 1 literal.

/ Sixteen adjacent squares ) the constant ‘1’.

Example 5

For the maps shown above, f 1 (w ; x; y ; z ) =

P

(0; 1 ; 2 ; 4 ; 5 ; 6 ; 8 ; 9 ; 12 ; 13 ; 1 4) and

f 2 = w 0 x^0 y 0 + x^0 y z 0 + w 0 xy z 0 + w x^0 y 0. 2

  • A PI is a product term obtained by combining the maximum possible number of adjacent squares in the map.

  • Pick the EPIs that minimize the number of literals.

Minimize the number of groupings.

Maximize their sizes.

Example 6 Show the region in the K-map that is represented by X 0 Z 0.

(a)

00 01

00 01

YZ WX

Y

Z

W

11 10

11 10

X

0 1 3 2

4 5 7 6

8 9 11 10

(^12 13 )

XZ

0 2 8 10

1 3

9

11

X Z

(b) Fig. 2-18 Four-Variable Map: Flat and on a Torus to Show Adjacencies

2

Example 7

Simplify the Boolean function F (W; X ; Y ; Z ) =

P

00

01

00 01

YZ WX

Y

Z

W

11 10

11

10

X

1 1 1

1 1 1

1 1

(^1 1 )

Fig. 2-19 Map for Example 2-5: F = Y + WZ + XZ

2

m m 1 m m m m m m m m m m m m

m m m m m m m m m m m m m m m m

m m m m m m m m m m m m m m m

m m m m m m m m m m m m m m m m

0 3 m^2 4 m^5 7

8 9 11 10

12 13 15 14

16 17 19 18 20 21 23 22

24 25 27 26

32 33 35 34 36 37 39 38

40 41 43 42

44 45 47 46

48 m 49 51

28 29 31 30

50 52 53 55 54

56 57 59 58

60 61 63 62

00 01 11 10 00 01 11 10 00 01 11 10

00 01 11 10

v = 0 v = 1

u = 0

u = 1

12 13 15 14 8 9 11 10

0 1 3 2 4 5 7 6 20 21

16 17 19 18 23 22

24 25

28 29 31 30 27 26

32 33 35 34 36 37 39 38 46 43 42

45 47 40 41

44

48 52 60 56

49 53 61 57 59 58

63 62

55

51 50 54

xy

zw

00 01 11 10 00 01 11 10 00 01

11 10

00 01

11 10

v = 0 v = 1

u = 0

u = 1

’ ’

(^12131514) ’ 8 9 11 10

0 1 3 2 4 5 7 6 20 21

16 17 19 18 23 22

24 25

28 29 31 30 27 26

32 33 35 34 36 37 39 38 46

43 42

45 47

40 41

44

48 52 60

56

49 53 61

57 59 58

63 62

55

51 50 54

xy

zw

x v

xz

z w

Figure 10: Six-variable K-maps [Gajski].

Theorem 1 In a K-map, 2 minterms are adjacent iff they differ in exactly 1 variable.

O In general, for an n-variable function, where n = 2 k , we can construct a k -D

K-map such that:

I the map is extended in each dimension on 2 of the variables; I the extension sequence in each dimension is a Gray sequence.

Simplification Using K-Maps

  • The complement of a function is represented in the map by the squares not marked by 1s (they usually are marked by 0s).

f = A^0 D 0 + C 0 + B D 0 f 0 = C D + AB 0 C

0 0

0

0

0

CD AB CD AB

1

1

1

1 1

1 1

1 1

1 1 00 01 11 10

00 01 11 10 00 01 11 10

10

11

01

00

Figure 11: The complement of f 0 gives f in pos.

Example 9 We want to simplify the following function in sop & pos:

f (A; B ; C ; D ) =

X

(a) Mark the map with 1s and 0s according to the function.

(b) Use the 1s to determine the EPIs of f , which immediately give the sop form:

f = B 0 D 0 + B 0 C 0 + A^0 C 0 D :

(c) Use the 0s to determine the EPIs of f 0 , and complement it to give the pos form:

f 0 = AB + C D + B D 0 ;

00 01

00 01

CD AB

C

D

A

11 10

11 10

B

1 1

1

1 1 1

1

00 01

00 01

CD AB

C

D

A

11 10

11 10

B

1 1

1

1 1 1

1

(a) Plotting the minterms (b) Essential prime implicants Fig. 2-22 Simplification with Prime Implicants in Example 2-

Figure 13: Simplification with PIs for f = P (0; 5 ; 10 ; 11 ; 12 ; 13 ; 15) [Mano & Kime].

1 2

3 00 01

00 01

CD AB

C

D

A

11 10

11 10

B

1

1

1 1

1

1

1 1

1

Fig. 2-23 Map for Example 2-

Figure 14: Simplification with PIs for f = P (0; 1 ; 2 ; 4 ; 5 ; 10 ; 11 ; 13 ; 15) [Mano & Kime].

Exercise 2 Does the minimal cover of PIs contain only EPIs? 2

Example 10 Simplify the following Boolean function in the pos form:

F (A; B ; C ; D ) =

P

00 01

00 01

CD AB

C

D

A

11 10

11 10

B

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

Fig. 2-24 Map for Example 2-10: F = ( A + B) ( C + D) ( B + D)

F 0 = AB + C D + B D 0 ) F = (A^0 + B 0 )(C 0 + D 0 )(B 0 + D ) 2

Exercise 3

Simplify F = (A^0 + B 0 + C )(B + D ) in the pos form. 2

Don’t-Care Conditions

  • In practice, there are applications where the function is not specified for cer- tain combinations of the input variables. For example, in the 4-bit BCD code for the decimal digits, the outputs are unspecified for the input combinations 1010-1111.

  • Functions that have unspecified outputs for some input combinations are called incompletely specified functions.

  • The unspecified minterms of a function are called the don’t-care conditions, or simply the don’t-cares, and are denoted as Xs.

  • These don’t-care conditions can be used on a map to provide further simpli- fication of the Boolean expression.

  • The tabulation method is a specific step-by-step (algorithmic) procedure that is guaranteed to produce a simplified standard-form expression for a function.

  • It can be applied to problems with any number of variables.

  • It is suitable for machine computation.

  • It however is quite tedious for human use.

  • The tabulation method was first formulated by Quine (1952) and later im- proved by McCluskey (1956), thus known as the Quine-McCluskey method.

/ Step 1: Exhaustive search of all PIs.

  • Group minterms by number of 1s.
  • Compare minterms and find pairs with distance 1.
  • Generate subcubes.
  • Repeat the above procedure on generated subcubes until no more subcubes can be generated. / Step 2: Choose among the PIs which give an expression with the least amount of literals (minimal cover generation).
  • Find EPIs through a selection table.
  • Find minimal cover through the pos of the PIs.

Determination of PIs

  • The goal of the Quine-McCluskey algorithm is a special case of the follow- ing: Select the smallest possible subset, D , of a set of objects, A , so that some criterion, f , is satisfied.

  • The set D will consist of all products in the minimal sop realization of a given Boolean function f , of which the set A contains all possible products.

Let f =

P

(a) (b) (c) w xy z w xy z w xy z 0 0000 3 0,1 000– 0,2,8,10 –0– 0,2 00–0 3 0,8,2,10 –0– 1 0001 3 0,8 –000 3 2 0010 3 10,11,14,15 1–1– 8 1000 3 2,10 –010 3 10,14,11,15 1–1– 8,10 10–0 3 10 1010 3 10,11 101– 3 11 1011 3 10,14 1–10 3 14 1110 3 11,15 1–11 3 15 1111 3 14,15 111– 3

¬ Group the minterms according to the number of 1s (see Column (a)). Combine any 2 minterms that differ from each other by exactly one variable (i.e., dist-1), the unmatched variable removed (see Column (b)). Try this for all possible pairs of minterms. A check ( 3 ) is placed to the right of both minterms if they have been used in a match.

® Repeat the process. Combine any 2 product terms from Step that differ from each other by exactly one variable, the unmatched variable removed (see Column (c)).

¯ The unchecked terms in the table form the PIs. Some of the product terms may appear twice in the table. It of course is unnecessary to use the same term twice.

  • When comparing 2 terms to decide if they can be combined, the comparison can be done directly on the decimal numbers. We combine 2 terms iff the difference of their corresponding decimal numbers is a power of 2.

*Multi-Output Minimization Using Maps

  • Identify all possible PIs that cover each implicated minterms in each output expression, and search for a minimal cover by using shared terms.

  • The Quine-McCluskey method also can be extended for this purpose.

f 1 (A; B ; C ) =

X

f 2 (A; B ; C ) =

X

f 3 (A; B ; C ) =

X

A

BC

00 01 11 10 A

BC

BC

A

f 1 f 2 f 3

Figure 16: Simplification of multiple output functions.

f 1 = A^0 C 0 + B C 0 + A^0 B + AB 0 C

f 2 = A^0 C + B C + AB 0 C 0 + A^0 B

f 3 = B C 0 + A^0 B + AB 0 C 0 + AB 0 C

*XOR & XNOR Patterns on the Map

  • Inspect the K-map to detect XOR/XNOR patterns: 1) kitty-corner adjacen- cies; 2) offset adjacencies.

A BC 0 1

00 01 11 10

1 1

A BC 0 1

00 01 11 10 1 1 kitty-corner offset (A  B )C A(B  C )

ABCD^ 00 01 11 10 00 01 11 10

ABCD 00 01 11 10 00 01 11 10 10

11

01

00

CD AB^00011110

1

1 1

1

1 1

1 1 1 1

1 1

1 1

1 1

f 1 f 2 f 3

Figure 17: XOR/XNOR patterns on the map.

f 1 = A^0 B 0 C 0 D + A^0 B 0 C D 0 + A^0 B C 0 D 0 + A^0 B C D

= A^0 B 0 (C  D ) + A^0 B (C  D )^0

= A^0 [(B 0 )(C  D ) + (B )(C  D )^0 ]

= A^0 [B  (C  D )]

f 2 = A^0 C 0 D + AC 0 D 0 + A^0 B C + AB 0 C

= C 0 (A  D ) + C (A  B )

f 3 = A^0 B 0 C D + A^0 B C D 0 + AB C 0 D 0 + AB 0 C 0 D

= (A  C )(B  D )