Skip navigation
Electronic Design

Asynchronous Gray-Code State Machine

<p>State diagrams are a simple, yet elegant way to model complex systems, regardless of the implementation. Most state machines are designed to be synchronous. However, there are many applications that aren't well suited to a state machine that's limited to changing states on the edge of a clock. Such systems may require state transitions on both edges of a clock, or match dissimilar interfaces where state transitions must occur when control signals change levels.</p> <p> Asynchronous state machines have many advantages of their synchronous counterparts, but aren't limited to making transitions on a clock edge. One very simple state machine is the common SR latch. It has only two states, and transitions are made in direct response to the Set and Reset inputs without a clock. More complex systems require some precautions. With asynchronous transitions, care must be exercised to ensure that race conditions don't cause non-deterministic behavior. This can be done by encoding the states in a Gray code so that only a single state bit changes for each state transition. If more than one bit were to change, then skew would cause transitions through undesired states, causing glitches, oscillations, or unwanted state transitions. This precludes using a "one shot" implementation more common in FPGAs where each state corresponds to one storage element, because as one element turns off, the other turns on, and decoding glitches would result.</p> <p> An example of a simple, asynchronous Gray-code state machine is shown (<a href="/Files/29/11458/Figure_01.gif">Fig. 1</a>). As seen in the timing diagram (<a href="/Files/29/11458/Figure_02.gif">Fig. 2</a>), the application required a Strobe signal (DSTROBE) to be generated by transitions of two different control signals. The first strobe had to be triggered by the first falling edge of the DMA Acknowledge signal (DACK-). All subsequent strobes had to be triggered by the rising edge of the Read Enable Not signal (RE-). The state diagram models this behavior. The Off state is necessary because a transition directly from Wait to Idle would require two bits to change simultaneously. The S0 bit changes first in going to Off, then S1 changes going to Idle. The state storage elements are latches implemented as multiplexers. In a multiplexer rich architecture like an Actel FPGA, this circuit is very efficient. </p>

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.