You are on page 1of 48

Topic 5

:

Principle of Combinational Circuit
(Karnaugh Map)

FLB 20203
DIGITAL SYSTEMS Karnaugh Map 1

Introduction to Karnaugh Map

ƒ Systematic method to obtain simplified sum-of-
products (SOPs) Boolean expressions.
ƒ Objective: Fewest possible terms/literals.
ƒ Diagrammatic technique based on a special form
of Venn diagram.
ƒ Advantage: Easy with visual aid.
ƒ Disadvantage: Limited to 5 or 6 variables.

FLB 20203
DIGITAL SYSTEMS Karnaugh Map 2

Venn Diagrams

ƒ Venn diagram to represent the space of minterms.
ƒ Example of 2 variables (4 minterms):

a'b'

ab' ab a'b
a
b

FLB 20203
DIGITAL SYSTEMS Karnaugh Map 3

Karnaugh Map Methods

A Karnaugh Map is a matrix of squares
„each square represents a minterm or
maxterm from a Boolean expression

A Karnaugh Map allows us to find input variable
redundancies
⇒ help reduce output equation

FLB 20203
DIGITAL SYSTEMS Karnaugh Map 4

...e. „ a product term in n variables is called a minterm ⇒ for 3 variables x. x yz FLB 20203 DIGITAL SYSTEMS Karnaugh Map 5 . xyz. each in a different square.Karnaugh Map Methods n Each map lists the 2 product terms that can be formed from n variables. x yz.. z ⇒ 2 3 = 8 minterms i. y.

„The minterm in each square or element of the map is the product of the variables listed at row and column of the element ⇒ x yz is at the intersection of x y and z FLB 20203 DIGITAL SYSTEMS Karnaugh Map 6 .Karnaugh Map Methods A map of n variables will have 2 n squares. each representing a minterm.

Karnaugh Map Methods The Karnaugh Map is very convenient „ provides some “feel” for the function due to its graphical presentation FLB 20203 DIGITAL SYSTEMS Karnaugh Map 7 .

FLB 20203 DIGITAL SYSTEMS Karnaugh Map 8 .Karnaugh Map Methods However its usefulness is chiefly due to the arrangement of the cells or squares. „ The expression must be written in canonical form ⇒ each term in the expression must contain each variable. „ Each cell differs from the adjacent cell by having exactly one variable complemented in the minterm.

Different Types of K-maps ƒ 2-variables ƒ 3-variables ƒ 4-variables ƒ 5-variables ƒ Larger K-maps FLB 20203 DIGITAL SYSTEMS Karnaugh Map 9 .

2-variable K-maps ƒ For 2-variable case (e.: variables a.g.b). the map can be drawn as: FLB 20203 DIGITAL SYSTEMS Karnaugh Map 10 .

b) K-map Alternative 1: Alternative 2: a b b a OR OR a'b' a'b m0 m1 a'b' ab' m0 m2 a a m3 b b m1 m3 ab' ab m2 a'b ab Alternative 3: a a OR b ab a'b b m3 m1 and others… ab' a'b' m2 m0 FLB 20203 DIGITAL SYSTEMS Karnaugh Map 11 .2-variable K-maps ƒ Alternative layouts of a 2-variable (a.

2-variable K-maps ƒ Equivalent labeling: b b a 0 1 0 equivalent to: a 1 a a b 1 0 equivalent to: 0 b 1 FLB 20203 DIGITAL SYSTEMS Karnaugh Map 12 .

b b 0 0 0 1 a 0 1 a 1 0 C = ab S = ab' + a'b FLB 20203 DIGITAL SYSTEMS Karnaugh Map 13 .2-variable K-maps ƒ The K-map for a function is specified by putting ™ a ‘1’ in the square corresponding to a minterm ™ a ‘0’ otherwise ƒ For example: Carry and Sum of a half adder.

0) ⇒ put 1 in box put 0 everywhere else.1) ⇒ put 1 in box Z=1 for (A.B) = (1.B) = (0. Example (2-variable) B A 0 1 0 0 1 Z = A B + AB ⇒ 1 1 0 Z=1 for (A. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 14 .Karnaugh Map Methods The map is filled by placing 1’s in the squares for terms that lead to a 1 output.

b b bc bc a a 00 01 11 10 00 01 11 10 a'b'c' a'b'c a'bc a'bc' 0 m0 m1 m3 m2 0 OR a m4 m5 m7 m6 a ab'c' ab'c abc abc' 1 1 c c Above arrangement ensures that minterms Note Gray code sequence of adjacent cells differ by only ONE literal. b. c). Therefore. there are 8 cells in a 3-variable K-map.) FLB 20203 DIGITAL SYSTEMS Karnaugh Map 15 . (Other arrangements which satisfy this criterion may also be used.3-variable K-maps ƒ There are 8 minterms for 3 variables (a.

FLB 20203 DIGITAL SYSTEMS Karnaugh Map 16 . m0 has 3 adjacent neighbours: m1.b. m2 and m4. each cell in an n-variable K-map has n adjacent neighbours.c' (m4) is adjacent to a.c' (m2) ™ a.c' (m6) bc a 00 01 11 10 0 m0 m1 m3 m2 1 m4 m5 m7 m6 Each cell in a 3-variable K-map has 3 adjacent neighbours.b. In general. For example.b'.3-variable K-maps ƒ There is wrap-around in the K-map: ™ a'.c' (m0) is adjacent to a'.b'.

as you move from box to box „ known as a Gray Code (code where only one bit changes at a time) i. Z = ABC + A BC + AB C + AB C BC A 00 01 11 10 0 0 0 1 0 3 variables 1 1 1 1 0 The top row BC is numbered such that only 1-bit changes at a time. not numbered as in the usual sequence.g. but done to show the relationship between variables.Karnaugh Map Methods E. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 17 .e.

FLB 20203 DIGITAL SYSTEMS Karnaugh Map 18 .Karnaugh Map Methods „ the main reason ⇒ any two squares that are adjacent differ in only one variable „ If two adjacent squares both have an entry of one ⇒ the corresponding product terms differ in only one variable ⇒ the two terms can be merged by eliminating that variable.

this is immediately apparent from the map as for the circled ones : „ is constant = 1 „ is constant = 0 „ changes and ⇒ will not be in the final expression. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 19 .Karnaugh Map Methods „ Consider a grouping of two of the circled terms which are adjacent we can see that ⇒ ( ) AB C + A B C = AB C + C = AB Can represent these 2 terms by .

Karnaugh Map Methods „ Then can form final simplified expression from the minimum number of circles required to encompass all the ones. „ Two loops cover all the ones. Z = AB + AC + BC FLB 20203 DIGITAL SYSTEMS Karnaugh Map 20 . BC A 00 01 11 10 0 0 0 1 0 minimum expression1 1 1 1 0 we could also include the third circle and thus Z = AB + BC but this is not a minimum expression.

z) K-map. y.4-variable K-maps ƒ There are 16 cells in a 4-variable (w. y yz wx 00 01 11 10 00 m0 m1 m3 m2 01 m4 m5 m7 m6 x m12 m13 m15 m14 11 w m8 m9 m11 m10 10 z FLB 20203 DIGITAL SYSTEMS Karnaugh Map 21 . x.

yz y wx m0 m1 m3 m2 m4 m5 m7 m6 x m12 m13 m15 m14 w m8 m9 m11 m10 z FLB 20203 DIGITAL SYSTEMS Karnaugh Map 22 .4-variable K-maps ƒ There are 2 wrap-arounds: a horizontal wrap-around and a vertical wrap-around. ƒ Every cell thus has 4 neighbours. m2. m4 and m8. the cell corresponding to minterm m0 has neighbours m1. For example.

Exercise .Karnaugh Map Methods Z = A B CD + A BC D + A BC D + A BCD + ABC D + ABCD + AB CD CD AB FLB 20203 DIGITAL SYSTEMS Karnaugh Map 23 .

Answer .Karnaugh Map Methods CD AB 00 01 11 10 00 0 0 1 0 01 1 1 1 0 11 0 1 1 0 10 0 0 1 0 Z = CD + BD + A BC FLB 20203 DIGITAL SYSTEMS Karnaugh Map 24 .

⇒ The maps are considered so that top and bottom edges and left and right edges are touching.B.D C C.D D One feature should be noted at this point „ The concept of adjacency can be extended to include wrapping around the edges of the map.Karnaugh Map Methods for which an implementation would be A A. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 25 .C B Z B.

CD AB 00 01 11 10 00 0 0 1 0 01 1 1 1 0 11 0 1 1 0 10 0 0 1 0 Z = C D + C B + AD FLB 20203 DIGITAL SYSTEMS Karnaugh Map 26 .Karnaugh Map Methods or we could loop the zeros.

Karnaugh Map Methods for which an implementation would be A Z B C D Z = CD + C B + AD ( ) Z = C + D ⋅ (C + B ) ⋅ A + D ( ) FLB 20203 DIGITAL SYSTEMS Karnaugh Map 27 .

Karnaugh Map Methods A B Z C D This is equivalent to A B Z C D A B Z C D which is equivalent to our first implementation FLB 20203 DIGITAL SYSTEMS Karnaugh Map 28 .

g. vwxyz. e.5-variable K-maps ƒ Maps of more than 4 variables are more difficult to use because the geometry (hyper-cube configurations) for combining adjacent squares becomes more involved. need 25 = 32 squares. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 29 . ƒ For 5 variables.

5-variable K-maps ƒ Organised as two 4-variable K-maps: v' v y y yz yz wx 00 01 11 10 wx 00 01 11 10 00 m0 m1 m3 m2 00 m16 m17 m19 m18 01 m4 m5 m7 m6 01 m20 m21 m23 m22 x x m12 m13 m15 m14 m28 m29 m31 m30 11 11 w w m8 m9 m11 m10 m24 m25 m27 m26 10 10 z z Corresponding squares of each map are adjacent. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 30 . Can visualise this as being one 4-variable map on TOP of the other 4-variable map.

ƒ K-maps larger than 6 variables are practically unheard of! ƒ Normally. a 6-variable K-map is organised as four 4- variable K-maps. which are mirrored along two axes. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 31 .Larger K-maps ƒ 6-variable K-map is pushing the limit of human “pattern- recognition” capability.

57.14.b ef cd 00 01 11 10 10 11 01 00 cd 00 m0 m1 m3 m2 m18 m19 m17 m16 00 01 m4 m5 m7 m6 m22 m23 m21 m20 01 11 m12 m13 m15 m14 m30 m31 m29 m28 11 m8 m9 m11 m10 m26 m27 m25 m24 10 10 10 m40 m41 m43 m42 m58 m59 m57 m56 10 11 m44 m45 m47 m46 m62 m63 m61 m60 11 a 01 m36 m37 m39 m38 m54 m55 m53 m52 01 00 m32 m33 m35 m34 m50 m51 m49 m48 00 cd 00 01 11 10 10 11 01 00 cd ef ef a.41.b' a‘.25. FLB 20203 DIGITAL SYSTEMS Karnaugh Map 32 .Larger K-maps w b ef a‘.8.b' a.45.29.18.23.27.b Try stretch your recognition capability by finding simplest sum-of-products expression for Σ m(6.61).

NAND and NOR Implementations NAND implementation important. due to Silicon Area reasons. NAND can be made to yield AND and OR gates ⇒ an AND gate can be formed from 2 NAND gates and ⇒2-input OR can be formed from 3 NAND gates FLB 20203 DIGITAL SYSTEMS Karnaugh Map 33 .

NAND and NOR Implementations A A⋅B A⋅ B B A⋅A A A+ B B ⋅B B Thus a set of NAND’s can thus be used to make any combinational network by substituting the above for AND and OR blocks FLB 20203 DIGITAL SYSTEMS Karnaugh Map 34 .

NAND and NOR Implementations Same applies for NOR’s A A. B A+B B A A AB B B FLB 20203 DIGITAL SYSTEMS Karnaugh Map 35 .

NAND and NOR Implementations Z = A B C D + A B C D + A B CD + A BC D + A BCD + A BCD + ABC D + ABCD + ABCD + AB C D + AB C D CD AB 00 01 11 10 00 1 1 0 1 01 0 1 1 1 11 0 1 1 1 10 1 1 0 0 Prime implicants and essential prime implicants (EPI) FLB 20203 DIGITAL SYSTEMS Karnaugh Map 36 .

NAND and NOR Implementations Minimum expression Z = B C + C D + BC + A CD eqn (1) SOP use AND and OR FLB 20203 DIGITAL SYSTEMS Karnaugh Map 37 .

NAND and NOR Implementations A ⋅ C⋅ D A B ⋅C B Z C B⋅ C D C⋅D or Z = B C + BD + BC + A CD FLB 20203 DIGITAL SYSTEMS Karnaugh Map 38 .

NAND and NOR Implementations Sometimes it is easier to group the zeros terms together CD AB 00 01 11 10 00 1 1 0 1 01 0 1 1 1 11 0 1 1 1 10 1 1 0 0 Z = BC D + AB C + B CD FLB 20203 DIGITAL SYSTEMS Karnaugh Map 39 .

NAND and NOR Implementations Z = BC D + AB C + B CD eqn (2) A⋅ B ⋅C A B B ⋅C ⋅ D Z C D B ⋅C ⋅ D FLB 20203 DIGITAL SYSTEMS Karnaugh Map 40 .

NAND and NOR Implementations Can further arrange Z = BC D • AB C • B CD ( ) ( ) ( Z = B +C+D • A+B+C • B+C +D ) eqn (3) POS use OR and AND A + B+C A B B+C + D Z C D B +C+ D FLB 20203 DIGITAL SYSTEMS Karnaugh Map 41 .

NAND and NOR Implementations We can also rearrange Z as follows : Z = BC D + AB C + B CD ( ) ( ) ( ) eqn (4) Use NOR Z = B +C+D + A+B+C + B+C +D A + B+C A B B+C + D Z C D B +C+ D FLB 20203 DIGITAL SYSTEMS Karnaugh Map 42 .

NAND and NOR Implementations likewise for sum of products form of Z Z = B C + C D + BC + A CD eqn (5) Use NAND Z = B C • C D • BC • A CD A ⋅C ⋅ D A B ⋅C B Z C B⋅C D C ⋅D FLB 20203 DIGITAL SYSTEMS Karnaugh Map 43 .

Implementation of Minimum Functions Observing the function Z. from the last example again Z = A B C D + A B C D + A B CD + A BC D + A BCD + A BCD + ABC D + ABCD + ABCD + AB C D + AB C D To implement Z would require : · 4 inverters · 11 quad-input AND gates · 1 eleven-input OR gate Thus in general always need to minimise the function FLB 20203 DIGITAL SYSTEMS Karnaugh Map 44 .

2 Can implement the minimum Z in Product of Sums form i. 3 FLB 20203 DIGITAL SYSTEMS Karnaugh Map 45 . 1 .e. Eqn.Implementation of Minimum Functions Can implement the minimum Z in Sum of Products form i.e. Eqn.e. Eqn. Can implement the minimum Z in negation of Sum of Products form i.

only NAND gates Can convert between Product-of-Sums to NOR gate implementation. with the use of 2 inverters.e. 4 i.e.Implementation of Minimum Functions By applying deMorgans Laws we can rearrange Z and then implement it i. inverters & NOR gates or Egn. Eqn.e. 5 i. · between the output of the OR gates and input of the AND gate · obviously has no effect on the output · now each OR + NOT ⇒ makes it a NOR and the NOT’s at the input of the AND ⇒makes it a NOR FLB 20203 DIGITAL SYSTEMS Karnaugh Map 46 .

Conversion of POS to NOR Gates A + B+C A B B+C + D Z C D B +C+ D ( )( Z = B +C + D ⋅ A+ B+C ⋅ B+C + D)( ) FLB 20203 DIGITAL SYSTEMS Karnaugh Map 47 .

FLB 20203 DIGITAL SYSTEMS Karnaugh Map 48 . ⇒ function said to be completely specified. when output not known for every combination of input variables (usually because all combinations cannot occur) ⇒ function said to be incompletely specified The minterms or maxterms that are not used as part of the output function are called don’t care terms.Don’t Cares When an output value is term is known for every possible combination of input variables. However.