Hardware Reference
In-Depth Information
Figure 8.16
Full switch debouncer. (a) Flowchart. (b) Bad and (c) good solutions.
To discuss the need for an explicit reset signal (see sections 3.8 and 3.9), let us
divide the problem into two cases. The i rst regards implementation in FPGAs whose
l ip-l ops are automatically reset to '0' at power-up. In this case, reset is not needed if
any of the encoding schemes described in section 3.7 is used, except for one-hot, but
i ne for the modii ed version of one-hot seen in i gure 3.10b, with the only restriction
that zero must be declared as the initial (reset) state. The second case regards imple-
mentation in devices whose DFFs' initial state is arbitrary. If sequential or Gray encod-
ing is used, all two-bit codewords will be consumed to encode the machine, so the
initial state will fall necessarily inside the machine, and deadlock cannot occur. Con-
sequently, we only need to consider the consequences of having the machine start
from a state other than state zero . It is clear from i gure 8.16c that the value of y will
adjust itself automatically to the value of x after at most T clock periods; therefore,
reset is required only if having y = '1' during such a short time period might be enough
to turn on a critical application (a factory machine, for example).
Based on section 8.10, the number of l ip-l ops needed to implement this circuit is
as follows. For the state register: M FSM = 4 states; therefore, N FSM = 2 if sequential, Gray,
or Johnson encoding is used, or 4 for one-hot. For the optional output register: assum-
ing that y comes directly from a DFF, N output = 0. For the timer: with t state_max = 2 ms and
f clk = 50 MHz, T max = 10 5 clock cycles results, so N timer = 17. Therefore, N total = 19 or 21.
8.11.4 Reference-Value Defi ner
This section deals with a problem that is common in control applications. It consists
of a circuit that sets a reference value. For example, a temperature controller for an
air conditioning system must have a way of letting the user choose the desired ( refer-
ence ) room temperature (see section 5.4.4).
Search WWH ::




Custom Search