Hardware Reference
In-Depth Information
Figure 4.2
Car alarm (a) with and (b) without state bypass.
4.2.4 Existence of State Bypass
The state-bypass problem occurs when the transition conditions for entering a state
coincide with the transition conditions for leaving that same state, and such condi-
tions are true during more than one clock cycle.
As an example, consider the car alarm of i gure 4.2a. If the alarm is in the disarmed
state and a command from the remote control ( remote = '1') is received, the machine
passes to the armed state, ready to detect any intrusions. However, if the remote = '1'
command lasts several clock cycles (as is generally the case) and the intrusion sensor
is off ( sensor = '0'), the circuit goes back to disarmed , then returns to armed , and so on,
producing a kind of state bypass (in fact, the states are not exactly bypassed, but rather,
the machine remains in each state for just one clock period instead of staying there).
Note that in this example state bypass occurs even when sensor = '1'.
This problem can be solved with some kind of l ag or, more clearly, with wait states,
as in i gure 4.2b (white circles). Note that the wait1 and wait2 states wait until remote
returns to zero before allowing any other action to take place.
The failure to prevent state bypass can lead to a circuit with occasional malfunc-
tioning that is very difi cult to locate later. This is especially true when the state bypass
can only occur in very particular situations, which might have been overlooked in the
simulations and therefore remained undetected during the design phase.
4.2.5 Lack of Reset
In the design of any FSM the need for reset must always be considered (only few cases
are i ne without an explicit reset port). Failing to do so can cause incorrect machine
initialization or even deadlock. A detailed analysis on the use of reset and its conse-
quences was presented in sections 3.8 and 3.9.
Search WWH ::




Custom Search