q-m technique lect 3

Upload: neerav-kothari

Post on 05-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Q-M Technique Lect 3

    1/34

    Introduction

    Determining the Prime Implicants

    What are these Prime Implicants?

    Selecting a Minimum Set

    Another Example

    Rules for Table Reduction

    Incompletely Specified Functions

    Review

  • 7/31/2019 Q-M Technique Lect 3

    2/34

    Quine-McCluskey Methodis a step-by-step

    procedure which is guaranteed to produce asimplified standard form for given function.

    Advantages:

    can be applied to problems of many variables

    suitable for machine computation

    BUT tedious and prone-to-errors for humans.

    Quine-McCluskey Tabulation Method

    Introduction

  • 7/31/2019 Q-M Technique Lect 3

    3/34

    Introduction

    Relies on repeated applications on terms using UnifyingTheorem:

    axb + ax'b = ab

    where a and b stand for product terms;Example: wxyz + wx'yz = wyz

    Using binary representations(for the product terms), abovetheorem correspond to:

    a1b + a0b = a-b

    Examples: 111 + 101 = 1-1 (abc + ab'c = ac)

    101 + 100 = 10- (ab'c + ab'c' = ab')

    11-10 + 11-00 = 11--0 (abde' + abd'e' = abe')

  • 7/31/2019 Q-M Technique Lect 3

    4/34

    Introduction

    Two steps procedure:

    Find all prime implicants

    Smallest set of prime implicants to coverthe minterms of function

  • 7/31/2019 Q-M Technique Lect 3

    5/34

    Determining the Prime Implicants

    Consider a 4-variable function.

    F(A,B,C,D) = m(0,1,4,5,9,11,14,15)

    Procedure:

    Arrange the minterms in groups according to the number of1s (see Column 1)

    Combine terms from adjacent groups which differ by only 1bit. (see Column 2)

    Repeat step 2 with a new set of terms (see Column 3); untilno further combinations are possible.

  • 7/31/2019 Q-M Technique Lect 3

    6/34

    Determining the Prime Implicants

    The prime implicants (PIs) are those withouta tickmark, namely: {-001, 10-1, 1-11, 111-, 0-0-}

    Column 1

    0 0000

    1 0001

    4 0100

    5 0101

    9 1001

    11 1011

    14 1110

    15 1111

    Column 2 Column 3

    P

    P

    0, 1 000-P

    P

    0, 4 0-00P

    P

    1, 5 0-01

    P

    P

    1, 9 -001

    P

    P

    4, 5 010-P

    P 9,11 10-1P

    P

    P

    P11,15 1-11

    14,15 111-

    P

    P

    0,1,4,5 0-0-P

    P

    or {B'C'D, AB'D, ACD, ABC, A'C'}

  • 7/31/2019 Q-M Technique Lect 3

    7/34

    What are these Prime Implicants?

    A prime implicant (PI) is a product termobtained by combining the maximum possible

    number of minterms from adjacent squares inthe map.

    Largest groupings of minterms in K-mapcorrespond to prime implicants.

  • 7/31/2019 Q-M Technique Lect 3

    8/34

    What are these Prime Implicants? For comparison, the equivalent K-map with the various

    groupings of minterms are as follows:

    Column 1

    0 0000

    1 0001

    4 0100

    5 0101

    9 1001

    11 1011

    14 1110

    15 1111

    Column 2 Column 3

    P

    P

    0, 1 000-P

    P

    0, 4 0-00P

    P

    1, 5 0-01

    P

    P

    1, 9 -001

    P

    P

    4, 5 010-P

    P 9,11 10-1P

    P

    P

    P 11,15 1-1114,15 111-

    P

    P

    0,1,4,5 0-0-P

    P

    1

    A

    C

    00

    01

    11

    10

    00 01 11 10

    D

    AB

    CD

    1

    B

    1 1

    1

    1

    1

    1

  • 7/31/2019 Q-M Technique Lect 3

    9/34

    What are these Prime Implicants?

    For comparison, the equivalent K-map with the variousgroupings of minterms are as follows:

    Note that some of these groupings (primeimplicants) are redundant.

    So we need to find the minimum set whichwould cover all minterms step 2 of thetabulation technique. 1

    A

    C

    00

    01

    11

    10

    00 01 11 10

    D

    AB

    CD

    1

    B

    1 1

    1

    1

    1

    1

  • 7/31/2019 Q-M Technique Lect 3

    10/34

    Selecting a Minimum Set

    Next step is to select a minimum set of prime implicants torepresent the function the covering problem.

    Prepare a table for prime-implicant vs minterms a primeimplicant chart(PI Chart):

    0 1 4 5 9 11 14 15

    1,9 -001 X X

    9,11 10-1 X X

    11,15 1-11 X X

    14,15 111- X X

    0,1,4,5 0-0- X X X X

  • 7/31/2019 Q-M Technique Lect 3

    11/34

    Selecting a Minimum Set

    Choose essential prime implicants (EPIs) those withunique minterm in it (i.e. single minterm in the column).

    0 1 4 5 9 11 14 15

    1,9 -001 X X

    9,11 10-1 X X

    11,15 1-11 X X

    14,15 111- X X0,1,4,5 0-0- X X X X

    Unique minterms: 0,4,5,14

    Therefore, EPIs are: A'C', ABC.

    P PP P

    1

    A

    C

    00

    01

    11

    10

    00 01 11 10

    D

    AB

    CD

    1

    B

    1 1

    1

    1

    1

    1

  • 7/31/2019 Q-M Technique Lect 3

    12/34

  • 7/31/2019 Q-M Technique Lect 3

    13/34

    Selecting a Minimum Set

    Next, select one or more prime implicants which wouldcover all the remaining minterms. (namely, AB'D)

    9 11

    1,9 -001 X

    9,11 10-1 X X

    11,15 1-11 X

    Hence, minimum set of prime implicants to

    cover all the minterms is { A'C', ABC, AB'D }

    F = A'C' + ABC + AB'D

    1

    A

    C

    00

    01

    11

    10

    00 01 11 10

    D

    AB

    CD

    1

    B

    1 1

    1

    1

    1

    1

  • 7/31/2019 Q-M Technique Lect 3

    14/34

    Another Example

    Try tabulation technique with function:

    F(A,B,C,D) = m(2,4,6,8,9,10,12,13,15)

    Column 1 Column 2 Column 3

    2 0010 2,6 0-10 PI2 8,9,12,13 1-0- PI1

    4 0100 2,10 -010 PI3

    8 1000 4,6 01-0 PI4

    6 0110 4,12 -100 PI5

    9 1001

    8,9 100-

    10 1010 8,10 10-0 PI6

    12 1100 8,12 1-00

    13 1101 9,13 1-01

    15 1111 12,13 110-

    13,15 11-1 PI7

  • 7/31/2019 Q-M Technique Lect 3

    15/34

    Another Example

    Prime implicants: 1-0-, 0-10, -010, 01-0, -100, 10-0, 11-1

    or AC', A'CD', B'CD', A'BD', BC'D', AB'D', ABD

    2 4 6 8 9 10 12 13 15

    8,9,12,13 1-0- X X X X

    2,6 0-10 X X

    2,10 -010 X X

    4,6 01-0 X X4,12 -100 X X

    8,10 10-0 X X

    13,15 11-1 X X

    P P

    EPIs: 1-0-, 11-1 or AC', ABD

  • 7/31/2019 Q-M Technique Lect 3

    16/34

    Another Example

    Reduced PI chart

    2 4 6 8 9 10 12 13 15

    8,9,12,13 1-0- X X X X

    2,6 0-10 X X

    2,10 -010 X X

    4,6 01-0 X X

    4,12 -100 X X

    8,10 10-0 X X

    13,15 11-1 X X

    P P

    2 4 6 10

    2,6 0-10 X X

    2,10 -010 X X

    4,6 01-0 X X

    4,12 -100 X

    8,10 10-0 X

    EPIs: AC', ABD

    F = AC' + ABD +B'CD' + A'BD'

  • 7/31/2019 Q-M Technique Lect 3

    17/34

    Another Example

    Questions:

    How would you obtain simplified product-of-sums

    (POS) expressions with the tabulation technique?

    How would you handle dont care conditions inan incompletely specified function?

  • 7/31/2019 Q-M Technique Lect 3

    18/34

    Rules for Table Reduction

    After obtaining the EPIs, the rules for PI chart

    reduction are: Rule 1: A row that is covered byanother row may be

    eliminated from the chart. When identical rows arepresent, all but one of the rows may be eliminated.

    Rule 2: A column that coversanother column may beeliminated. All but one column from a set of identicalcolumns may be eliminated.

  • 7/31/2019 Q-M Technique Lect 3

    19/34

    Rules for Table Reduction

    Example: Given this reduced PI chart:

    5 10 11 13

    1,5,9,13 --01 X X

    5,7,13,15 -1-1 X X

    8,9,10,11 10-- X X9,11,13,15 1--1 X X

    10,11,14,15 1-1- X X

    Apply rule 1: 2nd and 5th rows can be eliminated.

    Apply rule 2: 3rd and 4th columns can be eliminated.

    5 10

    1,5,9,13 --01 X

    8,9,10,11 10-- X

  • 7/31/2019 Q-M Technique Lect 3

    20/34

    Incompletely Specified Functions

    Functions with dont-cares.

    Step 1: Finding prime implicants (no change).

    Step 2: PI chartomit the dont-cares.

    Example:

    F(A,B,C,D,E) = m(2,3,7,10,12,15,27)+ d(5,18,19,21,23)

  • 7/31/2019 Q-M Technique Lect 3

    21/34

    Incompletely Specified FunctionsF(A,B,C,D,E) = m(2,3,7,10,12,15,27) + d(5,18,19,21,23)

    Column 1 Column 2 Column 3

    2 00010 2,3 0001- 2,3,18,19 -001- PI1

    3 00011 2,10 0-010 PI4 3,7,19,23 -0-11 PI2

    5 00101 2,18 -0010 5,7,21,23 -01-1 PI3

    10 01010 3,7 00-11

    12 01100 PI7 3,19 -0011

    18 10010 5,7 001-1 7 00111 5,21 -0101

    19 10011 18,19 1001-

    21 10101 7,15 0-111 PI5

    15 01111 7,23 -0111 23 10111 19,23 10-11 27 11011 19,27 1-011 PI6

    21,23 101-1

    EPIs: PI4, PI5, PI6 and

    PI7.

    2 3 7 10 12 15 27PI1 X X

    PI2 X X

    PI3 X

    PI4 X X

    PI5 X X

    PI6 X

    PI7 X

    PI chart

    3

    PI1 X

    PI2 X

    Reduced

    PI chart:F = PI1 + PI4 + PI5 + PI6 + PI7

    or

    PI2 + PI4 + PI5 + PI6 + PI7

  • 7/31/2019 Q-M Technique Lect 3

    22/34

    Review Quine-McCluskeyTechnique

    Relies on unifying theorem:axb + axb = ab

    Procedure:

    (i) Find all prime implicants

    arrange minterms according to the number of 1s.

    exhaustively combine pairs of terms from adjacent groupswhich differ by 1 bit, to produce new terms.

    tick those terms which have been selected.

    repeat with new set of terms until none possible.

    terms which are unticked are the prime implicants.

  • 7/31/2019 Q-M Technique Lect 3

    23/34

    Review Quine-McCluskey Technique

    (ii) select smallest set to cover function prepare prime-implicants chart.

    select essential prime implicants for which one or more of itsminterms are unique (only once in the column).

    obtain a new reduced PI chart for remaining prime-implicants

    and the remaining minterms. select one or more of remaining prime implicants which will

    cover all the remaining minterms.

  • 7/31/2019 Q-M Technique Lect 3

    24/34

    Review Quine-McCluskeyTechnique

    Example:F(A,B,C,D) = m(0,1,4,5,9,11,14,15)

    Column 1

    0 0000

    1 0001

    4 0100

    5 0101

    9 1001

    11 1011

    14 1110

    15 1111

    Column 2 Column 3

    P

    P

    0, 1 000-P

    P

    0, 4 0-00P

    P

    1, 5 0-01

    P

    P

    1, 9 -001

    P

    P

    4, 5 010-P

    P 9,11 10-1P

    P

    P

    P11,15 1-11

    14,15 111-

    P

    P

    0,1,4,5 0-0-P

    P

    Review Quine McCluskey

  • 7/31/2019 Q-M Technique Lect 3

    25/34

    Review

    Quine-McCluskeyTechnique

    The prime implicants (those without a tick mark) are:{ B'C'D, AB'D, ACD, ABC, A'C' }

    0 1 4 5 9 11 14 15

    1,9 -001 X X

    9,11 10-1 X X11,15 1-11 X X

    14,15 111- X X

    0,1,4,5 0-0- X X X X

    9 11

    1,9 -001 X

    9,11 10-1 X X

    11,15 1-11 X

    Essential prime implicants : ABC, A'C'

    F = ABC + A'C' + AB'D

  • 7/31/2019 Q-M Technique Lect 3

    26/34

    Petricks method

    Consider the PI table of

    f(ABCD) = Sm(4,5,7,12,14,15)

    PI terms minterms

    4 5 7 12 14 15

    ABC a X X

    BCD d X X

    ABD c X X

    ABD d X X

    BCD e X X

    ABC f X X

  • 7/31/2019 Q-M Technique Lect 3

    27/34

    There are no essential prime implicants in this PI table. Also itis not possible to apply column and row reduction. Now weapply Petricks method. We formulate a p-expression for the PI

    table. The first column of the table indicates that either primeimplicant a or b must be selected to cover minterm 4.Corresponding to this we construct a term (a+b).Similarly,prime implicant a or c must be selected to cover minterm5.Accordingly a term (a+c) is constructed. In the same way the

    other similar terms are constructed, which are as followsPrime implicants

    p = (a+b)(a+c)(c+e)(b+d)(d+f)(e+f)

    Petricks method

  • 7/31/2019 Q-M Technique Lect 3

    28/34

    Petricks method

    p = (a+b)(a+c)(c+e)(b+d)(d+f)(e+f)---- (1)

    This expression can be manipulated using Boolean algebraic methods. It is tobe expressed in SOP form

    p=(a+bc)(d+bf)(e+cf)------------- (2)

    since (x+y)(x+z)= x.x+y.x+x.z+y.z= {x+x(y+z)} + yz

    = x+yz

    Simplify equn 2 we have

    P= ade+adcf+bcde+bcdf+abcf+bcfe+bcf+ abfe

    = ade+adcf+bcde+bcf(1+d+a+e)+abfe= ade+adcf+bcde+bcf+ abfe ----------------- (3)

    From equn 3, we obtain the condition that p must be equal to 1 only when asufficient subset of the prime implicants is selected to cover the PI table.

  • 7/31/2019 Q-M Technique Lect 3

    29/34

    From equn (3), we can write five possible minimalexpressions corresponding to each term as follows

    f1(ABCD)= a + d + e =ABC +ABD + BCD ------ (4)f2(ABCD)= a + d + c + f =ABC+ABD +ABD + ABC ------ (5)

    f3(ABCD)= b + c + d + e =BCD+ABD+ABD+BCD ------ (6)

    f4(ABCD)= b + c + f = BCD+ABD+ABC ------ (7)

    f5(ABCD)= a + b + f + e =ABC+BCD+BCD+ABC ------ (8)

    Thus we see that the Petricks method not only provides minimalexpression, it also gives all the possible minimal expressions. Now, wecan select one of these expression, Logically all are equivalent, but mayneed different number of components for realization resulting in differentcosts.

    Petricks method

  • 7/31/2019 Q-M Technique Lect 3

    30/34

    From equn (4) 3+3+3+3 =12

    From equn (5) 3+3+3+3+4 =16

    From equn (6) 3+3+3+3+4 =16

    From equn (7) 3+3+3+3 =12

    From equn (8) 3+3+3+3+4 =16

    So equn 4and equn 7 gives the optimalsolution.

    Petricks method

    E l 2

  • 7/31/2019 Q-M Technique Lect 3

    31/34

    Example 2

    PI terms MINTERMS

    0 4 10 13 15 16 22 23 26ABDE a X X

    ACD b X X

    ABC c X X

    ABD d X XBCDE e X X

    ACE f X X

    BCDE g X X

    ABDE h XABCD i X X

    ABCE j X

  • 7/31/2019 Q-M Technique Lect 3

    32/34

    In the PI table, the row i dominates

    over rows h and j, therefore, h & j rows are eliminated.

    Now, columns 22 and 23 have single X, therefore,row is secondary EPI, i.e. ABCD term will be a partof minimal expression. Now we use Petricks

    method.

    Then expression for p is given byp = (a+g)(a+b)(d+e)(b+c)(c+d)(f+g)(e+f)

    Example 2

    E l 2

  • 7/31/2019 Q-M Technique Lect 3

    33/34

    p = (a+g)(a+b)(d+e)(b+c)(c+d)(f+g)(e+f)

    =(a+bg)(d+ce)(b+c)(f+ge)

    =(ad+bdg+ace+bceg)(bf+cf+beg+ceg)

    =(abdf+acdf+abdeg+acdeg+bdfg+bcdfg+bdeg+bcdeg+abcef+acef+abceg+a

    ceg+bcefg+bcefg+bceg+bceg

    =abdf+acdf+(abdeg+bdeg+bcdeg)+(acdeg+aceg)+

    (bdfg+bcdfg)+(abcef+acef))+abceg+(bcefg+bceg)

    =abdf+acdf+bdeg+aceg+bdfg+acef+(abceg+bceg)=abdf+acdf+bdeg+aceg+bdfg+acef+bceg

    There are seven minimal functions corresponding to the above p expression

    Example 2

  • 7/31/2019 Q-M Technique Lect 3

    34/34

    f1(ABCDE) =a+b+d+f =ABDE+ACD+ABD+ACE

    COMPONENT = 4+3+3+3+4 =17

    f2(ABCDE)=a+c+d+f =ABDE+ABC+ABD+ACE

    COMPONENT = 4+3+3+3+4 =17f3(ABCDE)=b+d+e+g =ACD+ABD+BCDE+BCDE

    COMPONENT = 3+3+4+4+4 =18

    f4(ABCDE)=a+c+e+g =ABDE+ABC+BCDE+BCDE

    COMPONENT = 4+3+4+4+4 =19

    f5(ABCDE)=b+d+f+g =ACD+ABD+ACE+BCDECOMPONENT = 3+3+3+4+4 =17

    f6(ABCDE)= a+c+e+f =ABDE+ABC+BCDE+ ACE

    COMPONENT = 3+3+4+4+4 =18

    f6(ABCDE)= b+ c+e+g =ACD+ ABC+BCDE+BCDE

    COMPONENT = 3+3+4+4+4 =18The term ABCD corresponding to i in table will be included in each of the

    above functions. This will add 5 to the component cost of each function. Thecost is minimum for the functions f1,f2, and f5. Any one of these can beselected.