Sunteți pe pagina 1din 81

Digital Logic and Design

Dr. M. Najam ul Islam


PhD Electrical Engineering
Lecture 6: Karnaugh Maps

2
Karnaugh Map

• The Karnaugh map, like Boolean algebra, is a


simplification tool applicable to digital logic.

• Boolean simplification is actually faster than


the Karnaugh map for a task involving two or
fewer Boolean variables. It is still quite usable
at three variables, but a bit slower.

3
Karnaugh Map
• At four input variables, Boolean algebra
becomes tedious. Karnaugh maps are both
faster and easier.

• Karnaugh maps work well for up to six input


variables, are usable for up to eight variables.

• For more than six to eight variables,


simplification should be by CAD (Computer-
Aided Design).
4
The Karnaugh Map (K-map) Method

• Recall: a given function has


• A unique representation using a truth table
• A unique representation as a sum of minterms
• Several equivalent representations as algabraic expressions

• Boolean minimization is a bit awkward


• Solution: Karnaugh map method minimization

5
K-map Method
• An alternate approach to representing a Boolean
functions
• Graphical representation of a Boolean function

• Minimization is performed by visual identification of


logic blocks
• The larger the blocks, the fewer literals in a term

• Representation of minterms of a function

6
K-map Method
• All rows in a truth table represented with a square
• Each square represents a minterm
• Number of 1’s  Number of minterms
• Example: A 2-variable map

7
K-map Method
• 1’s and 0’s represent function in K-maps
• 1 is put where F = 1 in the truth table
• 0’s are typically not shown
(a) F1 = xy, (b) F2 = x+y

8
Rules for K-maps
• We can reduce functions by circling 1’s in the K-map
• Each circle represents minterm reduction
• Following circling, we can deduce minimized and-or form

• Rules
• Every cell containing a 1 must be included at least once
• Enclose the largest possible “power of 2 rectangle”
• The 1’s must be enclosed in the smallest possible number of
rectangles

9
K-Maps
• In the final figure, we superimpose all three variables,
attempting to clearly label the various regions. The
regions are less obvious without color printing, more
obvious when compared to the other three figures.
• This 3-variable K-Map (Karnaugh map) has 2³ = 8
cells, the small squares within the map. Each
individual cell is uniquely identified by the three
Boolean Variables (A, B, C).
• For example, ABC' uniquely selects the lower right
most cell, A'B'C' selects the upper left most cell

10
11
K-Map Simplification of SOPs
• Grouping the 1s
• Can group the 1s in the adjacent cells.
• Rules
1. A group must contain either 1, 2, 4, 8, or 16 cells, which are
all powers of two. For a 3-variable map, total cells are 8.
2. 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.
3. Always include the largest possible number of 1s in a group
in accordance with rule 1.
4. 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.
12
K-Map Simplification of SOPs
• Determining the minimum SOP expression from the
Map
• Each group of cells containing 1s creates one product term
composed of all variables that occur in only one form (either
complemented or uncomplemented) within the group.
• Determine the minimum product term for each group.
• For a 3-variable map
• A 1-cell group yields a 3-variable product term
• A 2-cell group yields a 2-variable product term
• A 4-cell group yields a 1-variable term
• An 8-cell group yields a value of 1 for the expression
• When all the minterms are derived, they are summed to form
the minimum SOP expression.
13
3-Variable Karnaugh Maps
• Two variables on one side, one on the other
• Gray codes are used to represent blocks
• Only 1 bit changes in adjacent blocks

14
K-map Blocks
• Identifying blocks in Karnaugh maps
• Neighboring minterms can be combined
• Example
F = x’y’z’ + x’y’z

15
K-map Blocks
• Identifying blocks in Karnaugh maps
• Neighboring minterms can be combined
• Example
F = x’y’z’ + x’y’z = x’y’
• Resulting expression has 2 literals

16
K-map Blocks
• Example:
F ( x, y, z)   (2,3,4,5)  xyz  xyz  xyz  xyz
• Corresponding K-map

17
K-map Blocks
• Example:
F ( x, y, z)   (2,3,4,5)  xyz  xyz  xyz  xyz
• Corresponding K-map

• 2 blocks of size 2  F  xy  xy

18
K-map Blocks

• Exercise
• What is the K-map minimized form of the following expression?
F ( x, y, z)   (3,4,6,7)

19
K-map Blocks

• Exercise
• What is the K-map minimized form of the following expression?
F ( x, y, z)   (3,4,6,7)

• Blocks continue across borders of K-maps (wrap around)


20
K-map Blocks
• We have learnt how to combine 2 minterms
• Can we combine more than 2?
• Yes
F  xyz  xyz  xyz  xyz

• Any block of “power of 2 size” can be reduced


• Larger the block, simpler the expression
21
K-map Blocks
• We have learnt how to combine 2 minterms
• Can we combine more than 2?
• Yes
F  xyz  xyz  xyz  xyz  ( x  x). y.( z  z)  y

• Any block of “power of 2 size” can be reduced


• Larger the block, simpler the expression
22
K-map Blocks
• Can blocks overlap? Yes
• Example:
F ( A, B, C)   (1,2,3,5,7)

• The largest power-2 block may have an overlap

23
K-map Blocks
• Can blocks overlap? Yes
• Example:
F ( A, B, C)   (1,2,3,5,7)

• The largest power-2 block may have an overlap

24
Converting Blocks into Expressions
• Rule of thumb
• Write down the variables that do not change

F(A,B,C) = C+A’B

25
Example 1 & 2
• Simplify A’B’C’ + A’B’C

• Simplify A’B’C’ + A’B’C + A’BC + A’BC’

26
Example 3
• A’B’C + A’BC + AB’C + ABC

• Mapping the four p-terms yields a group of four,


which is covered by one variable C.
27
Example 4
• A’B’C’ + A’B’C + A’BC + A’BC’ + ABC + ABC’

• After mapping the six p-terms above, identify the upper group of four, pick
up the lower two cells as a group of four by sharing the two with two more
from the other group. Covering these two with a group of four gives a
simpler result. Since there are two groups, there will be two p-terms in the
Sum-of-Products result A'+B
28
Example 5
• A’B’C’ + AB’C’ + A’BC’ + ABC’

• Mapping the four p-terms above yields a group of four. Visualize the group
of four by rolling up the ends of the map to form a cylinder, then the cells
are adjacent. We normally mark the group of four as above left. Out of the
variables A, B, C, there is a common variable: C'. C' is a 0 over all four
cells. Final result is C'.
29
Example 6
• A’B’C’ + A’B’C + A’BC + A’BC’ + AB’C’ + ABC’

• The six cells above from the un simplified equation can be organized into
two groups of four. These two groups should give us two p-terms in our
simplified result of A' + C'

30
Function Simplification
• Consider the function f = A′BC + AB′C + ABC′ + ABC

31
32
33
4-variable Karnaugh Map

34
4-variable Karnaugh Map

35
4-Variable K-maps
• Same principle can be extended to 4-variable
expressions

• Note again the gray code pattern in blocks


36
4-Variable K-maps
• 1 square  One minterm  A term with 4 literals

• 2 adjacent squares  A term with 3 literals

• 4 adjacent squares  A term with 2 literals

• 8 adjacent squares  A term with 1 literal

• 16 adjacent squares  1

37
4-Variable K-maps
• Example:
F (w, x, y, z)   (0,1,2,4,5,6,8,9,12,13,14)

38
4-Variable K-maps
• Example:
F (w, x, y, z)   (0,1,2,4,5,6,8,9,12,13,14)

F ( w, x, y, z )  y  wz  xz

39
4-Variable K-maps
• Pair
• Group of 2 adjacent minterms
• Eliminates 1 variable

• Quad
• Group of 4 adjacent minterms
• Eliminates 2 variables

• Octet
• Group of 8 adjacent minterms
• Eliminates 3 variables

• Redundant
• All elements are covered by other groups

40
Example 7

41
Example 7

42
Example 8

43
Example 8

44
Explanation
• The four cells above are a group of four
because they all have the Boolean variables B'
and D' in common.

• In other words, B=0 for the four cells, and D=0


for the four cells. The other variables (A, B) are
0 in some cases, 1 in other cases with respect to
the four corner cells.

45
Example 9

46
Example 9

47
Example 10

48
Example 10

49
50
Example 11

51
Example 11

52
Example 12

53
Example 12

54
Example 13

55
Example 13

56
Example 14

57
Example 15

58
4-Variable K-maps
• Example:
F  AC  AB  BCD

59
Minterm to Maxterm

60
61
62
• Simplify the Product-Of-Sums Boolean
expression below, providing a result in SOP form.
63
• Then fill in the implied 1s in the remaining cells of the
map above right.
64
65
66
Σ (Sum) and Π (Product) Notation

• In sums notation let we have an example....

f(A,B,C,D) = Σ m(0,1, 2, 4, 5, 7, 12, 13, 15)

or

f(A,B,C,D) = Σ(m0,m1,m2,m4,m5,m7,m12,m13,m15)

67
68
f(A,B,C,D) = Π M(2, 6, 8, 9, 10, 11, 14)

or

f(A,B,C,D) = Π(M2, M6, M8, M9, M10, M11, M14)

69
In Product Notation

70
Terminology
• Implicant
• Any product term in the SOP form
• A block of 1’s in a K-map

• Prime implicant
• Product term that cannot be further reduced
• Block of 1’s that cannot be further increased

• Essential prime implicant


• Prime implicant that covers a 1 (or minterm) that is not covered by
any other implicant

71
Essential Prime Implicants
• Example:
F ( A, B, C, D)   (0,2,3,5,7,8,9,10,11,13,15)

• Essential prime implicants:


• Prime implicants:

72
Essential Prime Implicants
• Example:
F ( A, B, C, D)   (0,2,3,5,7,8,9,10,11,13,15)

• Essential prime implicants: BD and B’D’


• Prime implicants: CD, B’C, AD, AB’

73
Incompletely Specified Functions
• Sometimes a function is not completely specified
• For instance, when BCD numbers are handled

• A BCD number is represented by 4 bits with 6 values undefined


• What to do with these unused (undefined) values?
• Answer: Use them as don’t care conditions

F ( A, B, C , D)  AD  BCD  BC D  ABC D

74
Don’t Care

• Don't cares in a Karnaugh map, or truth table,


may be either 1’s or 0’s, as long as we don't
care what the output is for an input condition
we never expect to see.

• We plot these cells with an asterisk, *, among


the normal 1’s and 0’s

75
Don't Care

• We take 1's to define the output of function and


consider all other as zero , which is not always
the case.

• e.g. If a four bit decimal code does not use six


combinations. A simplified circuit can be made
that will guarantee no use of those six
combination.
76
Example

77
78
• What should be the valid answer:

• Ans = AC
79
5 & 6-Variable Karnaugh-Maps

5 - Variable Karnaugh-Maps

80
5 & 6-Variable Karnaugh-Maps

81

S-ar putea să vă placă și