Hardware Reference
In-Depth Information
Figure 8.17
Reference-value dei ner implemented (a) with a counter and (b) with a state machine.
An example is presented in i gure 8.17, in which the reference value is set by a
pushbutton. Two cases are considered; in both a debouncer is needed, but in i gure
8.17a the reference value is produced by a common counter (note that x plays the
role of clock), whereas in i gure 8.17b it is produced by an FSM (the actual system
clock plays the role of clock). Even though a counter too is an FSM, the reference here
is to the fact that only the latter is implemented using the FSM approach.
The case in i gure 8.17a is advantageous when the reference values are regular
(next = present + constant). For example, if we want to set the desired room tem-
perature for the air conditioning system mentioned above, the counter can be
incremented by one unit (1°F or 1°C) every time the pushbutton is pressed (and
released, of course), going from the minimum to the maximum reference value,
returning then to the minimum value and restarting from there. Another advan-
tage of this alternative is that the number of reference values can be arbitrarily
large.
The case in i gure 8.17b is advantageous when the reference values are irregular
and the number of reference values is small. Note that we have made a little modii ca-
tion in the debouncer (FSM1), embedding in it a one-shot converter (see sections 2.4
and 5.4.3), which converts the (long) debounced signal into a pulse with duration
equal to one clock period.
A solution for the case of i gure 8.17b is presented in i gure 8.18. The time behavior
of FSM1 is illustrated in i gure 8.18a, and the corresponding state diagram is shown
in i gure 8.18b. It is a '0'-to-'1' debouncer, so it requires three states; just one extra
state is needed to include the one-shot conversion, thus totaling four states. The state
diagram for FSM2 is depicted in i gure 8.18c, for a total of 10 states with arbitrary
reference values r 1 , r 2 , …, r 10 . The one-shot modii cation of FSM1 is important because
it eliminates the need for FSM2 to check the return of x to '0', which would double
its number of states.
In many applications both up and down controls are needed. This kind of situation
is illustrated in i gures 8.19a and 8.19b, which are generalizations of the cases in i gures
8.17a and 8.17b, respectively (i.e., in the former the reference value is set by a counter,
whereas in the latter it is set by a state machine).
Search WWH ::




Custom Search