Lecture 4 Review
Question #1 § Find the groupings in the following K-Map C · D C · D C · D C · D A · B 1 0 X 1 A · B X 0 X 1 A · B 1 X 1 1 A · B 1 X X X § Produce a logical equation for these groupings: A + D
Question #1: alternative § Find the groupings in the following K-Map C · D C · D C · D C · D A · B 1 0 X 1 A · B X 0 X 1 A · B 1 X 1 1 A · B 1 X X X § Produce a logical equation for these groupings: D + C
Question #2 R Q § Complete the truth table Q S S R Q T Q T Q T+1 Q T+1 0 0 0 1 0 1 ß Hold 0 0 1 0 1 0 0 1 X X 0 1 ß Reset 1 0 X X 1 0 ß Set ß Forbidden 1 1 X X 0 0
Question #2 R Q § Complete the truth table Q S S R Q T Q T Q T+1 Q T+1 0 0 0 1 0 1 ß Hold 0 0 1 0 1 0 0 1 X X 0 1 ß Reset 1 0 X X 1 0 ß Set ß Forbidden 1 1 X X 0 0
Question #3 S Q § What are the output C values from Q and Q Q given the following R inputs on S , R and C ? S R C Q Q Time 0 0 1 ? ? 1 0 1 1 0 1 0 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1
Question #3 S Q § What are the output C values from Q and Q Q given the following R inputs on S , R and C ? S R C Q Q Time 0 0 1 ? ? 1 0 1 1 0 1 0 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1
Question #4 S Q S 0 Q 0 S 1 Q 1 § Assuming all C C C inputs start low, R Q R 0 Q 0 R 1 Q 1 complete the timing diagram Clock S R Q 0 Q
Lecture 5 Review
Question #1 Assume we want to build a change machine § We can add either $0.05 or $0.10 at a time § We want to keep track of the current amount in the machine § We can hold a maximum of $0.50 § Draw the state diagram
Question #1b 5¢ Five Zero 5¢ 10¢ 10¢ 5¢ § How many flip- Ten Fifteen 5¢ 10¢ 10¢ flops would you 5¢ Twenty-Five Twenty need to implement 5¢ 10¢ 10¢ the following finite 5¢ Thirty-Five Thirty state machine 5¢ 10¢ 10¢ (FSM)? 5¢ Forty Forty-Five ú 11 states 5¢ 10¢ ú # flip-flops = é log 2 (# of states) ù Fifty ú # flip-flops = 4
Question 2: Barcode Reader § When scanning UPC barcodes, the laser scanner looks for black and white bars that indicate the start of the code. § If black is read as a 1 and white is read as a 0 , the start of the code (from either direction) has a 1010 pattern. ú Can you create a state machine that detects this pattern?
Step #1: Draw state diagram 0 1 1 A 0 B 1 1 C 0 0 D 1 E 0
Step #2: State Table Present Next § Write state table with Z X Z State State § Output Z is determined A 0 0 A A 1 0 B by the current state. B 0 0 C B 1 0 B ú Denotes Moore machine. C 0 0 A § Next step: allocate flip- C 1 0 D D 0 0 E flops values to each state. D 1 0 B E 0 1 A ú How many flip-flops will E 1 1 D we need for 5 states? # flip-flops = é log(# of states) ù
Step #3: Flip-Flop Assignment 0 1 1 A § 3 flip-flops 0 B needed here. 1 1 § Assign states C 0 0 carefully though! D 1 § Can’t simply do this: E Ø B = 011 0 Ø A = 100 Ø D = 001 Ø C = 010 Ø E = 000 Why not?
Step #3: Flip-Flop Assignment 0 1 1 A 0 B § Be careful of 1 1 race conditions. C 0 0 § Better solution: D Ø B = 001 Ø A = 000 1 E Ø C = 011 Ø D = 101 0 Ø E = 100 • Still has race conditions (C à D, C à A), but is safer. • “Safer” is defined according to output behaviour. • Sometimes, extra flip-flops are used for extra insurance.
Step #4: Redraw State Table Present Next § From here, we can X X F 2 F 1 F 0 Z Z F 2 F 1 F 0 State State construct the K-maps 0 0 A 0 0 0 0 0 0 A 0 0 0 0 A 0 1 1 0 0 0 B 0 1 for the state logic 0 0 B 1 0 0 0 0 0 C 1 1 combinational circuit. 0 0 B 1 1 1 0 0 0 B 0 1 0 1 C 1 0 0 0 0 0 A 0 0 ú Derive equations for each 0 1 C 1 1 1 0 0 1 D 0 1 flip-flop value, given the 1 0 D 1 0 0 0 0 1 E 0 0 1 0 D 1 1 1 0 0 0 B 0 1 previous values and the 1 0 0 0 1 0 0 0 E 0 1 A input X . 1 0 E 0 1 1 1 1 1 D 0 1 ú Three equations total, plus one more for Z (trivial for Moore machines).
Step 5: Circuit design § Karnaugh map for F 2 : F 0 · X F 0 · X F 0 · X F 0 · X F 2 · F 1 0 0 0 0 F 2 · F 1 X X 1 0 F 2 · F 1 X X X X F 2 · F 1 0 1 0 1 F 2 = F 1 X + F 2 F 0 X + F 2 F 0 X
Step 5: Circuit design § Karnaugh map for F 1 : F 0 · X F 0 · X F 0 · X F 0 · X F 2 · F 1 0 0 0 1 F 2 · F 1 X X 0 0 F 2 · F 1 X X X X F 2 · F 1 0 0 0 0 F 1 = F 2 F 1 F 0 X
Step 5: Circuit design § Karnaugh map for F 0 : F 0 · X F 0 · X F 0 · X F 0 · X F 2 · F 1 0 1 1 1 F 2 · F 1 X X 1 0 F 2 · F 1 X X X X F 2 · F 1 0 1 1 0 F 0 = X + F 2 F 1 F 0
Step 5: Circuit design § Output value Z goes high based on the following output equation: Z = F 2 F 1 F 0 § Note: All of these equations would be different, given different flip-flop assignments! ú Practice alternate assignment for the midterm J
Recommend
More recommend