C2a. Logic Simplification.ppt

Embed Size (px)

Citation preview

  • NurulHazlina/BEE2243/GlitchesCHAPTER 2Logic SimplificationKarnaugh Maps

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicIntroductionMerit of a network includePropagation delay ReliabilityCostIn this course, unless otherwise specified, the cost of a network is defined to be the total number of gates plus the total number of gate inputs.Solutions -> Simplification of design (Boolean Equation)

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicSimplification MethodsA graphic method that can handle Boolean expressions up to 6 variables Karnaugh mapsA tabular method that has no limit on the number of variable and can be implemented on a computer - Quine-McCluskey method

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicKarnaugh MapsThe Karnaugh map of a function consists a number of cells (squares) - equal to number of its minterms.Possibilities of simplification is signified by the presence of 1s occupying adjacent cells.Conceptually, it may be useful to think of a Karnaugh map as a different form of the truth table. Each row of the truth table is embedded in a cell in the map in such a way that the possibility of simplification becomes obvious.

    NurulHazlina/BEE2243/Logic

  • ECE C03 Lecture 2*Karnaugh Map Methodhard to draw cubes of more than 4 dimensions

    K-map is an alternative method of representing the truth table that helps visualize adjacencies in up to 6 dimensions

    Beyond that, computer-based methods are neededNumbering Scheme: 00, 01, 11, 10Gray Code only a single bit changes from code word to next code word

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*Karnaugh Map ExamplesF = AA asserted, unchangedB variesG = B'B complemented, unchangedA variesCout = A B + B Cin + A CinF(A,B,C) = A

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*More Karnaugh Map ExamplesF(A,B,C) = Sm(0,4,5,7)

    F = B' C' + A C In the K-map, adjacency wraps from left to rightand from top to bottomF'(A,B,C) = Sm(1,2,3,6)

    F' = B C' + A' CCompare with the method of using De Morgan's Theorem and Boolean Algebra to reduce the complement!F' simply replace 1's with 0's and vice versa

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*Karnaugh Map Examples (4 variables)F(A,B,C,D) = Sm(0,2,3,5,6,7,8,10,11,14,15)

    F = C + A' B D + B' D'K-map Corner AdjacencyIllustrated in the 4-CubeFind the smallest numberof the largest possiblesubcubes that cover theON-set

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*Karnaugh Maps: Circling zerosF = (B + C + D) (A + C + D) (B + C + D)

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*Karnaugh Map Dont CaresF(A,B,C,D) = Sm(1,3,5,7,9) + Sd(6,12,13)

    F = A'D + B' C' D w/o don't cares

    F = C' D + A' D w/ don't caresDon't Cares can be treated as 1's or 0's if it is advantageous to do soBy treating this DC as a "1", a 2-cubecan be formed rather than one 0-cubeIn PoS form: F = D (A' + C')

    Same answer as above, but fewer literals

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*Algorithm: Minimum SOP from K-MapStep 1:Choose an element of ON-set not already covered by an implicantStep 2:Find "maximal" groupings of 1's and X's adjacent to that element.Remember to consider top/bottom row, left/right column, andcorner adjacencies. This forms prime implicants (always a powerof 2 number of elements).Repeat Steps 1 and 2 to find all prime implicants

    Step 3:Revisit the 1's elements in the K-map. If covered by single primeimplicant, it is essential, and participates in final cover. The 1's itcovers do not need to be revisitedStep 4:If there remain 1's not covered by essential prime implicants, thenselect the smallest number of prime implicants that cover theremaining 1's

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*Gate Logic: Two Level SimplificationExample: (A,B,C,D) = m(4,5,6,8,9,10,13) + d(0,7,15)Initial K-mapPrimes aroundA' B C' D'Primes aroundA B C' D

    ECE C03 Lecture 2

  • ECE C03 Lecture 2*Gate Logic: Two-Level SimplificationExample ContinuedPrimes aroundA B' C' D'Primes aroundA B C' DEssential Primeswith Min Cover

    ECE C03 Lecture 2

  • NurulHazlina/BEE2243/LogicMap of a function of 2 variablesKarnaugh Maps

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMap of a function of 3 variables

    Karnaugh Maps

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMap of a function of 4 variables

    Karnaugh Maps

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMap of function of five variablesf(v, w, x, y, z)

    Karnaugh Maps

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMaps with cells designated by decimal numbers

    Karnaugh Maps

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicKarnaugh MapsTypical subcubes for elimination

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicKarnaugh MapsThe map for f(w,x,y,z) = m(1,2,3,5,6,7,8,13)

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicKarnaugh MapsThe map of f = xy + wxz + wxyz

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicKarnaugh MapsMap for the functions f(w,x,y,z) = m(1,3,4,5,6,7,11,14,15)

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicKarnaugh Mapsf(w,x,y,z) = m(0,3,7,8,12) + dc(5,10,13,14).

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicVariable-entered Karnaugh Maps

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicVariable-entered Karnaugh MapsVariable-entered map.

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicVariable-entered Karnaugh MapsVariable-entered maps grouping techniques z

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicVariable-entered Karnaugh MapsOptimal groupings on a variable-entered map

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicVEM : Minimization ProcedureSTEP1: Form an optimal collections of subcubes involving the literal z using the cells containing 1s as dont-care cells and the cells containing the literal z as 0-cell.STEP2: Form an optimal collection of subcubes involving the 1-cell not completely covered in STEP1 by replacing the literals z and z with 0 and 1-cell that is completely covered with dont-cares.

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicExample1VEM with z as map entered variableyz + xz

    NurulHazlina/BEE2243/Logic

  • Example2

  • NurulHazlina/BEE2243/LogicExample3

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/Logic Cont : Example3

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/Logic Cont : Example4

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicVariable-entered Karnaugh MapsMinimization through a map with single-variable entries

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMinimal POS : Example1(c) VEM with z as map entered variable

    NurulHazlina/BEE2243/Logic

  • Minimal POS : Example2

  • NurulHazlina/BEE2243/Logic Cont : Example2

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMinimal POS : Example3

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/Logic Cont : Example3

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMinimal SOPMinimal POS

    --000

    NurulHazlina/BEE2243/Logic

  • Incompletely Specified FunctionsSingle-variable map entries for incompletely specified (i.e having dont-cares) Boolean functionsNurulHazlina/BEE2243/Logic

    NurulHazlina/BEE2243/Logic

  • Incompletely Specified FunctionsStep 1: Form an optimal collections of subcubes involving the single literal; z or z,using the cells containing 1s, Xs and double entries with 1 constant as dont-care cells. Double entries with 0 constant part can be used as dont-cares for subcubes that agree with the literal part of the double entry.NurulHazlina/BEE2243/Logic

    NurulHazlina/BEE2243/Logic

  • Incompletely Specified FunctionsSTEP2:Replace the single literal entries; z and z, by 0.Retain the single 0 and Xs entriesReplace each single 1 entry by a dont care if it was covered in step 1. Otherwise, retain the single entry.Replace the double entries having having a 0 constant by 0.Replace each double entries with 1 constant by a X if the cell was used in step 1 to form at least one subcube agreeing with the literal parts; otherwise replace the double entry having a constant 1 by a 1.

    NurulHazlina/BEE2243/Logic

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicExamplesObtaining a minimal sum for the incompletely specified Boolean funciton f(w,x,y,z) = m(3,5,6,7,8,9,10) + dc(4,11,12,14,15) using a variable-entered map. (a) Truth table. (b) Variable-entered map. (c) Step 1 map and subcubes. (d) Step 2 map and subcubes.Obtaining a minimal sum for the incompletely specified Boolean function f(w,x,y,z) = m(0,4,5,6,13,14,15) + dc(2,7,8,9) using a variable-entered map. (a) Truth table. (b) Step 1 map and subcubes. (c) Step 2 map and subcubes.Obtaining a minimal product for the incompletely specified Boolean function f(w,x,y,z) = m(0,4,5,6,13,14,15) + dc(2,7,8,9) using a variable-entered map. (a) Step 1 map and subcubes. (b) Step 2 map and subcubes.

    NurulHazlina/BEE2243/Logic

  • AnswersQuestion 1Obtaining a minimal sum for the incompletely specified Boolean funciton f(w,x,y,z) = m(3,5,6,7,8,9,10) + dc(4,11,12,14,15) using a variable-entered map. (a) Truth table. (b) Variable-entered map. (c) Step 1 map and subcubes. (d) Step 2 map and subcubes.

    wxyzfMap entry0000000001000100z001110100-z,101011011011011111000111001110101z,11011-1100-z,0110101110--1111-

  • AnswersNurulHazlina/BEE2243/LogicUsed as 1-cell

    NurulHazlina/BEE2243/Logic

  • AnswersQuestion 2Obtaining a minimal sum for the incompletely specified Boolean function f(w,x,y,z) = m(0,4,5,6,13,14,15) + dc(2,7,8,9) using a variable-entered map. (a) Truth table. (b) Step 1 map and subcubes. (c) Step 2 map and subcubes.

    wxyzfMap entry00001z000100010-z,0001100100110101101101z,10111-1000--1001-1010001011011000z1101111101111111

  • AnswersNurulHazlina/BEE2243/Logic

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicObtaining a minimal product for the incompletely specified Boolean function f(w,x,y,z) = m(0,4,5,6,13,14,15) + dc(2,7,8,9) using a variable-entered map. (a) Step 1 map and subcubes. (b) Step 2 map and subcubes.

    NurulHazlina/BEE2243/Logic

  • 2-variable map entriesNurulHazlina/BEE2243/Logic

    NurulHazlina/BEE2243/Logic

  • 2-variable map entriesNurulHazlina/BEE2243/Logic

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMaps having sum terms as entries. (a) Variable-entered map. (b) Grouping the y literal. (c) Grouping the z literal. (d) Grouping the not completely covered 1-cell.

    NurulHazlina/BEE2243/Logic

  • NurulHazlina/BEE2243/LogicMaps having product terms as entries. (a) Variable-entered map. (b) Grouping the yz term. (c) Grouping the y literal.(d) Grouping the not completely covered 1-cell.

    NurulHazlina/BEE2243/Logic