Pushbutton Debouncer plus Memory Figure 8.33 shows a pushbutton that must be debounced and also " memorized, " such that the stored value gets inverted every time the pushbutton is pressed (as in the stopwatch used by football referees, which alternately runs and stops every time the pushbutton is pressed). If a debouncer were not needed, the trivial solution of figure 8.33acould be used, in which x is connected directly to the clock input of a DFF (due to the inverted version of q connected back to d, it resembles a toggle-type flip-flop, so every time a positive clock edge occurs, the value of y gets inverted). Let us assume, however, the usual situation, in which the pushbutton must be debounced.
(a) Draw a flowchart for the combined solution of figure 8.33b (debouncer plus memory in one FSM).
(b) Draw a Moore-type state diagram corresponding to the flowchart presented above.
(c) Assuming that sequential encoding is used and that the debouncing time interval is 1 ms, with fclk = 50 MHz, calculate the number of flip-flops needed to build this machine.
(d) If the solution of figure 8.33awere employed, with the debouncer included, how many flip-flops would be required?