11/15 & 11/17 CS150 Section week 12 This week: Karnaugh maps, State minimization 1. K-maps Making K-maps. AB ABCD OUT Maxterm Minterm 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D) CD 1 0 1 1 0 0 1 1 1 1 1 1 0 1 0 1 ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD 00 01 11 10 00 01 11 10 00 1 0 0 1 1 0 0 1 01 0 0 1 1 0 0 1 1 11 1 1 1 1 1 1 1 1 10 1 1 0 1 1 1 0 1 00 1 0 0 1 1 0 01 0 0 1 1 0 0 1 1 11 1 1 1 1 1 1 1 1 10 1 1 0 1 1 1 0 1 The four corners are 0 this1 circle actually here… OUT=BD+AC+AD Terms: Maxterm: Product of Sums ( POS ). Product of terms whose results are zero: OUT=(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D)(A+B+C+D) Implicant: Anything that you circle to be part of your equation. 1s if you’re looking for minterms, 0 if you’re looking for maxterms… Prime implicant: If you can draw a bigger circle around an group, in other words, if you can draw a circle that completely envelopes a group + some, then that group is not a prime implicant. A prime implicant is a circled group that is the biggest it can possibly be. Essential prime implicant: If there is only one circle that includes a particular implicant, then that circle is necessary, uh, essential. If all of one group’s members are also inside other circles, then that circle is redundant and not necessary ( essential ). Minterm… What you’ve been doing up to now. Sum of Products ( SOP ). Sum of terms whose results are one: OUT=ABCD+ABCD+ABCD+ABCD+ABCD+ABCD+ABCD+ABCD+ABCD+ABCD+ABCD Simplify: _ __ __ _ __ _ _ OUT = XYZ + XYZ + XYZ + XYZ + XYZ = ___Y+XZ_____________________ using K-maps. STT XYZ 000 001 010 011 100 101 110 111 OUT 1 1 0 0 1 1 1 0 XY Z OUT 0 1 00 1 1 01 0 0 11 1 0 10 1 1 2. Glitches and K-maps: OUT AB C 00 01 11 10 0 0 1 1 0 1 0 0 1 1 K-map simplified equation: OUT=BC+AC Equation drawn in gates: You can do this… Can a glitch occur on the 110 111 transition? Yes. It happens when the new 0 propagates through the circuit faster than the new 1 does. ( This will make sense if you draw the circuit ). How can you fix it using a K-map? Add a circle that covers that transition. ( The red circle ). OUT AB C 00 01 11 10 0 0 1 1 0 1 0 0 1 1 3. State minimization Given the STD below, use a state implication table to find and draw the reduced state transition diagram. Things that make two states equal: 1. 2. Same outputs for same inputs Same next states 0 A [0] 0 0 G [0] B [0] 1 1 C [0] 1 0 1 0 1 F [0] 0 E [0] 1 1 D [1] 0 Present State A B C D E F G Initial STT Next State X=0 X=1 B A D D A B A C C C E F G E Output 0 0 0 1 0 0 0 Step 1: Write up implication chart and cross out squares where the output of the two states are different. ( Cross out things that violate first rule ). Step 2: Write in next states for each pair of states in implication table. Step 3: Use information in table ( crossed out squares ) to determine whether next states of each state pair are equivalent or not. Cross out those that are not equivalent because they violate the second rule of equivalence. Step 4: Repeat step 3 until you have a pass where you don’t cross anything out. Step 5: The states that haven’t been crossed out are equivalent. ( This isn’t really a step… ) State Implication Chart Step 1. D’s output is different than all other states so we can cross out D’s rows and columns. B C D E F G A B C D E F Step 2: Use initial STT to fill in implication table’s next states. B C B A C B C D A D C C C C B A A A D A C B F C B A F C B D F B C B G C A A G C A D G A F A G A B A C E C E C E F E G E D E F G A B C A D B E F Blue Xs are first pass. Green Xs are second pass. Nothing crossed out on third pass. So the equivalent states are: A=B and E=F=G Reduced STD 0 1 Filling in the reduced STT will make drawing the reduced STD easier: Present State 1 Reduced STT Next State Output X=0 X=1 AB AB C 0 C D C 0 D D EFG 1 EFG AB EFG 0 AB C [0] [0] 0 0 EFG [0] 1 D [1] 0 1