two level minimization

Upload: dr-dj

Post on 09-Mar-2016

232 views

Category:

Documents


0 download

DESCRIPTION

Presentation on Two level minimization of boolean expressions.

TRANSCRIPT

  • 2-Level MinimizationClassic Problem in Switching TheoryTabulation Method Transformed to Set Covering ProblemSet Covering Problem is Intractablen-input Function Can Have 3n/n Prime Implicantsn-input Function Can Have 2n MintermsExponentially Complex Algorithms for Exact Solutions

    NOTE: Sometimes the Covering Problem is Easy to Solve (when no cyclic tables result)

  • Heuristic Branch and BoundQuine-McCluskey Method is Tabulation Method Using a Branch and Bound Algorithm with Heuristic in Branch Operation for Solution of the Cyclic Cover Branch and Bound ApproachesBRANCH STEPReduce, HALT if not Cyclic CoverHeuristically Choose a PI Solve Cyclic Cover in Two WaysAssume Chosen PI is in the Final Cover SetAssume Chosen PI is not in the Final Cover SetSelect Between 1) and 2) Depending on Minimal CostBOUND STEPIf Current Solution is Better Than Previous, Return from this Level of Recursion (Note: Initially Set to Entire Set of PIs in Table)Go to Branching Step

  • Branch and Bound DiagramCyclicCover 1CyclicCover 2CyclicCover 3CC3Solution 1CC3Solution 2Initial CC1 Soln is All PIsHeuristically Choose a PI Reduce to CC2Initial CC2 Soln is All PIsHeuristically Choose a PI Reduce to CC3Initial CC3 Soln is All PIsHeuristically Choose a PI1 Reduce to CC3Heuristically Choose a PI2 Reduce to CC3Soln 1 Fully Reduced Equal to All PIs in CC3 No BoundingSoln 2 Better CC3 Entire Set and Fully Reduced

  • Choosing Candidate PIsChoose PI With Fewest LiteralsThat is, One that Covers the most MintermsSelect One that Covers a Minterm Covered by Very Few Other MintermsNote if Minterm Covered by Single PI, it is EPIThis Technique Chooses One that is Almost an EPIIndependent Set Heuristic

  • Independent Set HeuristicFind Maximum Set of Independent Rows in Cover MatrixPartition Matrix as Shown

    0CAI is Sub-Matrix of Independent Rows I = {I1, I2, I3, ...}Choose PI in I that Covers Most Rows in AReduce Matrix Using New EPI Selection and DominanceIf Matrix is 00 Solution is Found Else Go To 1)

  • Exact Method Petricks MethodWhen Cyclic Cover Table is Found use Covering Clauses in POS FormEach Product Corresponds to MintermTransform the POS to SOPProduct Terms Represent Selected PrimesMinimum Cover Identified by Product with Fewest LiteralsFinds ALL Solutions to the Cyclic Cover

  • Petricks Method ExampleWrite Clauses as a POS Expression:We Solve this Equation

  • Solving the Satisfying Clause It is Easy to Find a Satisfying Argument for a SOP Expression Classic Petricks Method Transforms POS to SOP

  • Multi-Output FunctionsMinimizing Each Output Separately Usually Results in Poor MinimizationTerm Sharing Occurs Only by ChanceCan Use Multi-Output Prime ImplicantsMore Complex Version of Tabulation MethodCan Use Characteristic Function for Multi-Output FunctionsUtilizes Principles in Multiple-Valued Logic

  • Product FunctionsConsiderxyzf1f2Minterms in f1f2 are Minterms for Both f1 and f2f1f2 is a Product Function

    x

    y

    z

    f1

    f2

    f1( f2

    0

    0

    0

    1

    0

    0

    0

    0

    1

    1

    1

    1

    0

    1

    0

    1

    1

    1

    0

    1

    1

    0

    1

    0

    1

    0

    0

    0

    0

    0

    1

    0

    1

    1

    1

    1

    1

    1

    0

    0

    0

    0

    1

    1

    1

    1

    1

    1

  • Multi-Output Prime ImplicantDEFINITIONA MOPI for a set of switching functions f1, f2, , fm is a product of literals which is either:A Prime Implicant of One of the functions, fi, for i=1,2,,mA Prime Implicant of one of the Product Functions, fifjfk where i,j,k=1,2,,m and ij kTHEOREMThe set of all MOPIs is sufficient for the determination of at least one multi-output minimized SOP.

  • Tagged Product TermsCould Generate Using K-map or Tabulation Method for Each Output Separately AND all Product Functionstoo lengthyinstead use Tagged Product TermsTagged Product Terms have Two Parts:kernel a product term of literals (as normal)tag appended entity to kernel that indicates which function outputs it applies to

    x

    y

    z

    f1

    f2

    f1( f2

    TPTs

    0

    0

    0

    1

    0

    0

    000f1 -

    0

    0

    1

    1

    1

    1

    001f1f2

    0

    1

    0

    1

    1

    1

    010f1f2

    0

    1

    1

    0

    1

    0

    011 -f2

    1

    0

    0

    0

    0

    0

    1

    0

    1

    1

    1

    1

    101f1f2

    1

    1

    0

    0

    0

    0

    1

    1

    1

    1

    1

    1

    111f1f2

  • Generating MOPIs

    0

    0

    0

    f1

    -

    0

    0

    1

    f1

    f2

    0

    1

    0

    f1

    f2

    0

    1

    1

    -

    f2

    1

    0

    1

    f1

    f2

    1

    1

    1

    f1

    f2

  • Generating MOPIs

    0

    0

    0

    f1

    -

    (

    0

    0

    1

    f1

    f2

    (

    0

    1

    0

    f1

    f2

    0

    1

    1

    -

    f2

    (

    1

    0

    1

    f1

    f2

    (

    1

    1

    1

    f1

    f2

    (

    0

    0

    -

    f1

    -

    0

    -

    0

    f1

    -

    0

    -

    1

    -

    f2

    -

    0

    1

    f1

    f2

    0

    1

    -

    -

    f2

    -

    1

    1

    -

    f2

    1

    -

    1

    f1

    f2

  • Generating MOPIs0-0f1- and 0-1-f2 DO NOT combineNo Common Tag ElementsThey WOULD Combine Under Cube Merging for Single Output FunctionOnly Place Check Mark on Terms with COMMON Tag OutputsEXAMPLE 000f1- and 001f1f2 Results in 000f1- Being Checked ONLY

    0

    0

    0

    f1

    -

    (

    0

    0

    1

    f1

    f2

    (

    0

    1

    0

    f1

    f2

    G

    0

    1

    1

    -

    f2

    (

    1

    0

    1

    f1

    f2

    (

    1

    1

    1

    f1

    f2

    (

    0

    0

    -

    f1

    -

    B

    0

    -

    0

    f1

    -

    C

    0

    -

    1

    -

    f2

    (

    -

    0

    1

    f1

    f2

    D

    0

    1

    -

    -

    f2

    E

    -

    1

    1

    -

    f2

    (

    1

    -

    1

    f1

    f2

    F

    -

    -

    1

    -

    f2

    A

  • MOPI Cover Table

    f1

    f2

    m0

    m1

    m2

    m5

    m7

    m1

    m2

    m3

    m5

    m7

    f1

    B

    X

    X

    C

    X

    X

    f2

    A

    X

    X

    X

    X

    E

    X

    X

    f1(f2

    D

    X

    X

    X

    X

    *F

    X

    X

    X

    X

    G

    X

    X

    5

    (

    1&7

  • MOPI Cover Table

    F is an essential row for f1, onlyColumn dominance, remove m5 under f2

    f1

    f2

    m0

    m1

    m2

    m5

    m7

    m1

    m2

    m3

    m5

    m7

    f1

    B

    X

    X

    C

    X

    X

    f2

    A

    X

    X

    X

    X

    E

    X

    X

    f1(f2

    D

    X

    X

    X

    X

    *F

    X

    X

    X

    X

    G

    X

    X

    5

    (

    1&7

  • MOPI Cover Table

    Will use Petricks method applied to multiple outputs

    f2

    f2

    m0

    m1

    m2

    m1

    m2

    m3

    m7

    f1

    B

    X

    X

    C

    X

    X

    f2

    A

    X

    X

    X

    E

    X

    X

    f1(f2

    D

    X

    X

    *F

    X

    G

    X

    X

    B+C B+D C+G A+D E+G A+E A+F

  • Exact Solution

  • Exact Solution (Cont.) Minimum Product Term: {A,B,G}

    f1ON = All MOPIs that have f1 in Tag f2ON = All MOPIs that have f2 in Tag

  • Hazard-Free 2-Level MinimizationTabular Method Can Be Applied To Realize 2-Level Designs That Eliminate Certain Hazards

    Considers Delay of Logic CircuitsExample:

  • Hazard TypesStatic Hazard Output value the same after input change

    0-Hazard 1-Hazard Dynamic Hazard Output value different after input change

  • Analysis of Networks with Static HazardsSOP Expression with 1-Hazard

    POS Expression with 0-Hazard

  • Elimination of Hazard

    Prime Implicant added to eliminate static 1-hazard

  • Other Hazard Classifications for More than One Input ChangeLogic Hazard Hazard caused by the particular implementation. Can be eliminated by adding Pis

    Function Hazard Presence of hazard due to the function realized by the output. Present for transitions in which more than one input changes. Cannot be eliminated

  • Tabular Approach to Hazard-Free DesignUses Minimum number of prime implicantsA Network will contain no static or dynamic hazards if its 1-sets satisfy the following two conditionsFor each pair of adjacent input states that both produce a 1 output, there is at least one 1-set that includes both input states of the pairThere are no 1-sets that contain exactly one pair of complementary literals

  • Tabular Approach StepsFind prime implicants using tabular approachCreate prime implicant table, however, columns will be any essential single minterm & all pairs of adjacent states (these have been found in the second table of 1)See Example Handout