05-KarnaughMaps (1)

Embed Size (px)

Citation preview

  • 8/16/2019 05-KarnaughMaps (1)

    1/30

    Karnaugh Maps for

    Simplication

    1

  • 8/16/2019 05-KarnaughMaps (1)

    2/30

      Boolean algebra helps us simplify expressions

    and circuits

      Karnaugh Map: A graphical technique forsimplifying a Boolean expression into eitherform: minimal sum of products (MSP) minimal product of sums (MPS)

      oal of the simpli!cation" #here are a minimal number of product$sum terms %ach term has a minimal number of literals

      &ircuit'ise this leads to a minimal to'le*elimplementation

    2

  • 8/16/2019 05-KarnaughMaps (1)

    3/30

      A to'*ariable function has four possible minterms"+e can re'arrangethese minterms into a Karnaugh map

     

    ,o e can easily see hich minterms containcommon literals Minterms on the left and right sides contain y- and y 

    respecti*ely Minterms in the top and bottom ros contain x- and x 

    respecti*ely

    3

    x   y minterm

    0 0   x’y’

    0 1   x’y

    1 0   xy’

    1 1   xy

    Y

    0 1

    0   x’y’   x’yX

    1   xy’   xy

    Y0   1

    0 x’ y’   x’ yX

    1 x y’   x y

    Y’   Y

    X’ x’ y’   x’ y

    X x y’   x y

  • 8/16/2019 05-KarnaughMaps (1)

    4/30

      .magine a to'*ariable sum of minterms:

    x-y- / x-y

      Both of these minterms appear in the top roof a Karnaugh map hich

      means that they both contain the literal x-

      +hat happens if you simplify this expressionusing Boolean algebra0

    4

    x’y’ + x’y = x’(y’ + y) [ Distributive ]= x’ • 1 [ y + y’ = 1 ]= x’ [ x • 1 = x ]

    Y

    x’y’ x’yX xy’ xy

  • 8/16/2019 05-KarnaughMaps (1)

    5/30

     

    Another example expression is x-y / xy Both minterms appear in the right side here y is

    uncomplemented

     #hus e can reduce x-y / xy to 1ust y

      2o about x-y- / x-y / xy0 +e ha*e x-y- / x-y in the top ro corresponding to x-

     #here-s also x-y / xy in the right side correspondingto y

     #his hole expression can be reduced to x- / y

    5

    Y

    x’y’ x’y

    X xy’ xy

    Y

    x’y’ x’y

    X xy’   xy

  • 8/16/2019 05-KarnaughMaps (1)

    6/30

      3or a three'*ariable expression ith inputs

    x y 4 the arrangement of minterms is more tric5y:

      Another ay to label the K'map (usehiche*er you li5e):

    6

    Y

    x’y’z’ x’y’z x’yz x’yz’

    X xy’z’ xy’z xyz xyz’

    Y

    m0 m1 m3 m2

    X m4 m5 m! m6

    Y

    00 01 11 10

    0 x’y’z’ x’y’z x’yz x’yz’X

    1 xy’z’ xy’z xyz xyz’

    Y

    00 01 11 10

    0 m0 m1 m3 m2X

    1 m4 m5 m! m6

  • 8/16/2019 05-KarnaughMaps (1)

    7/30

      +ith this ordering any group of 6 7 or 8 ad1acent squares onthe map

      contains common literals that can be factored out

      9Ad1acency includes rapping around the left and right sides:

      +e-ll use this property of ad1acent squares to do oursimpli!cations"

    !

    x’y’z + x’yz= x’z(y’ + y)= x’z • 1= x’z

    x’y’z’ + xy’z’ + x’yz’ + xyz’= z’(x’y’ + xy’ + x’y + xy)= z’(y’(x’ + x) + y(x’ + x))= z’(y’+y)

    = z’

    Y

    x’y’z’   x’y’z x’yz   x’yz’

    X xy’z’ xy’z xyz xyz’

    Y

    x’y’z’   x’y’z x’yz   x’yz’

    X   xy’z’   xy’z xyz   xyz’

  • 8/16/2019 05-KarnaughMaps (1)

    8/30

      +e can !ll in the K'map directly from a truth

    table #he output in ro i of the table goes into square

    mi of the K'map

    ;emember that the rightmost columns of the K'

    map are 9sitched

    "

    Y

    m0   m1   m3   m2

    X m4   m5   m!   m6

    x y z #(x$y$z)

    0 0 0 0

    0 0 1 10 1 0 0

    0 1 1 0

    1 0 0 0

    1 0 1 1

    1 1 0 1

    1 1 1 1

    Y

    0 1 0 0

    X 0 1 1 1

  • 8/16/2019 05-KarnaughMaps (1)

    9/30

       

  • 8/16/2019 05-KarnaughMaps (1)

    10/30

       #he most di=cult step is grouping togetherall the >s in the K'map Ma5e rectangles around groups of one to four

    or eight >s

    All of the >s in the map should be included in atleast one rectangle

    ?o not include any of the @s

    %ach group corresponds to one product term

    10

    Y

    0   1   0 0

    X   0   1 1 1

  • 8/16/2019 05-KarnaughMaps (1)

    11/30

     

    Ma5e as fe rectangles as possible tominimi4e the number of products in the!nal expression"

      Ma5e each rectangle as large as possible

    to minimi4e the number of literals in eachterm"

      ;ectangles can be o*erlapped if that

    ma5es them larger"

    11

  • 8/16/2019 05-KarnaughMaps (1)

    12/30

      et-s consider simplifying f(xy4) xy / y-4

    / x4

       

  • 8/16/2019 05-KarnaughMaps (1)

    13/30

       

  • 8/16/2019 05-KarnaughMaps (1)

    14/30

     

    .n our example e can rite f(xy4) into equi*alent ays

      .n either case the resulting K'map isshon belo

    14

    Y

    x’y’z’   x’y’z   x’yz x’yz’

    X   xy’z’   xy’z   xyz   xyz’

    #(x$y$z) = x’y’z + xy’z + xyz’ + xyz

    Y

    m0   m1   m3   m2

    X   m4   m5   m!   m6

    #(x$y$z) = m1 + m5 + m6 + m!

    Y

    0   1   0 0

    X   0   1 1 1

  • 8/16/2019 05-KarnaughMaps (1)

    15/30

     

    Simplify the sum of minterms m> / mF / mG / mH

    15

    Y

    X

    Y

    m0   m1   m3   m2

    X m4   m5   m!   m6

  • 8/16/2019 05-KarnaughMaps (1)

    16/30

      2ere is the !lled in K'map ith all groups

    shon #he magenta and green groups o*erlap hich

    ma5es each of them as

    large as possible

    Minterm mH is in a group all by its lonesome

       #he !nal MSP here is x-4 / y-4 / xy4-

    16

    Y

    0 1 1 0

    X 0 1 0 1

  • 8/16/2019 05-KarnaughMaps (1)

    17/30

       #here may not necessarily be a unique MSP" #he K'map beloyields to

    *alid and equi*alent MSPs because there are to possibleays toinclude minterm mI

      ;emember that o*erlapping groups is possible as shon abo*e

    1!

    Y

    0 1 0 1

    X 0 1 1 1

     y’z + yz’ + xy  y’z + yz’ + xz

    Y

    0 1 0 1

    X 0 1 1 1

    Y

    0 1 0 1

    X 0 1 1 1

  • 8/16/2019 05-KarnaughMaps (1)

    18/30

      +e can do four'*ariable expressions tooE  #he minterms in the third and fourth columns and in the third

    and  fourth ros are sitched around" Again this ensures that ad1acent squares ha*e common literals

      rouping minterms is similar to the three'*ariable casebut:   6 7 8 or >H minterms  

  • 8/16/2019 05-KarnaughMaps (1)

    19/30

    1%

    Y

    m0   m1   m3   m2

    m4   m5   m!   m6m12   m13   m15   m14

    X

    'm"   m%   m11   m10

    Y

    (’x’y’z’ (’x’y’z (’x’yz (’x’yz’

    (’xy’z’ (’xy’z (’xyz (’xyz’(xy’z’ (xy’z (xyz (xyz’

      X

    '(x’y’z’ (x’y’z (x’yz (x’yz’

  • 8/16/2019 05-KarnaughMaps (1)

    20/30

       #he expression is already a sum of

    minterms so here-s the K'map:

      +e can ma5e the folloing groups resultingin the MSP x-4- / xy-4

    20

    Y1 0 0 1

    0 1 0 0

    0 1 0 0X

    '1 0 0 1

    Ym0 m1 m3 m2

    m4 m5 m! m6m12 m13 m15 m14

    X

    'm" m% m11 m10

    Y

    1 0 0 1

    0 1 0 00 1 0 0

    X

    '1 0 0 1

    Y

    ’x’ y’z’ ’x’y’z ’x’yz ’x’ yz’

    ’xy’z’ ’xy’z ’xyz ’xyz’xy’z’ xy’z xyz xyz’

    X

    'x’ y’z’ x’y’z x’yz x’ yz’

  • 8/16/2019 05-KarnaughMaps (1)

    21/30

    21

    = 0 = 1

    Ym0   m1   m3   m2

    m4   m5   m!   m6

    m12   m13   m15   m14X

    'm"   m%   m11   m10

    Ym16 m1! m1% m"m20 m21 m23 m22m2" m2% m31 m30

    X

    'm24 m25 m2! m26

  • 8/16/2019 05-KarnaughMaps (1)

    22/30

    22

    = 0 = 1

    1 1

    1 1 1

    1

    1 1

    1

    1 1

    1 11

    # = X’ *m(4$6$12$14$20$22$2"$30)+ ’'’Y’ *m(0$1$4$5)+ '’Y’’ *m(0$4$16$20)+ 'XY *m(30$31)+ ’'X’Y m11

  • 8/16/2019 05-KarnaughMaps (1)

    23/30

      Maxterms are grouped to !nd minimal PoSexpression

    x +y+z x+y+z’ x+y’+z’ x+y’+z

    x’ +y+z x’+y+z’ x’+y’+z’ x’+y’+z

    23

      00 01 11 10

    0

    1x

     yz

  • 8/16/2019 05-KarnaughMaps (1)

    24/30

      3(+J67G)

    24

    x +y+z x+y+z’ x+y’+z’ x+y’+z

    x’ +y+z x’+y+z’ x’+y’+z’ x’+y’+z

      00 01 11 10

    0

    1

    x

     yz

    0 0 1 0

    0 0 1 1

      00 01 11 10

    0

    1

    x

     yz

    &('$X$Y$)= Y (X + )

  • 8/16/2019 05-KarnaughMaps (1)

    25/30

    25

    &('$X$Y$)= *m(0$1$2$5$"$%$10) 

    = , -(3$4$6$!$11$12$13$14$15)

    00 00

    0

    0 0 0 0

    &('$X$Y$)= ('’ + X’)(Y’ + ’)(X’ +

    )

    .r$

    &('$X$Y$)= X’Y’ + X’’ + '’Y’

    '/i/ ne is t/e minim ne

  • 8/16/2019 05-KarnaughMaps (1)

    26/30

    26

    &('$X$Y$)= , -(0$2$3$4$5$6)

      = *m(1$!$"$%$10$11$12$13$14$15)

    11

    1 1 1 1

    1 1 1 1

    &('$X$Y$)= ' + XY + X’Y’

  • 8/16/2019 05-KarnaughMaps (1)

    27/30

       "

  • 8/16/2019 05-KarnaughMaps (1)

    28/30

      3ind a MSP for

    f(xy4) Σm(@67G8>7>G) d(xy4) Σm(I>@>F)

     #his notation means that input combinations xy4 @>>> >@>@ and>>@>

    (corresponding to minterms mI m>@ and m>F) are unused"

    2"

      Y

    1 0 0 1

    1 1 x 0

    0 x 1 1X

    '1 0 0 x

  • 8/16/2019 05-KarnaughMaps (1)

    29/30

      3ind a MSP for:

    f(xy4) Σm(@67G8>7>G) d(xy4) Σm(I>@>F)

    2%

      Y

    1 1

    1 1 x

    x 1 1 X'

    1 x

    #($x$y$z)= x’z’ + ’xy’ + xy

  • 8/16/2019 05-KarnaughMaps (1)

    30/30

      K'maps are an alternati*e to algebra for simplifying expressions

     #he result is a MSP$MPS hich leads to a minimal to'le*elcircuit

    .t-s easy to handle don-t'care conditions K'maps are really only good for manual simpli!cation of small

    expressions"""

       #hings to 5eep in mind:

    ;emember the correct order of minterms$maxterms on the K'map +hen grouping you can rap around all sides of the K'map and

    your groups can o*erlap Ma5e as fe rectangles as possible but ma5e each of them as

    large as possible" #his leads to feer but simpler product terms  #here may be more than one *alid solution

    30