FONT SIZE : AAA
State machines have their roots in mathematics and, therefore, like many things in math, sound really clever but are actually pretty simple when it comes down to it. You will also find state machines and drawings of state machines being called finite state machines (FSMs) and state transition diagrams (somewhat unfortunately STDs).
The basic concept is that a system stays in a stable state until some trigger causes it to transition to another state. This transition might cause some actions to occur during the transition. States are drawn on a diagram as boxes or bubbles and transitions as lines with arrows that go either from one box to another or from one box back to itself. The transition lines are drawn with a two-part label on them. The top part of the label is the condition for the transition to occur (say, a button being pressed), and then there is a horizontal line, and under the line appear any actions that need to take place during the transition (say, turn a LED on).
There are, of course, other ways of drawing state machines, but this is probably the most common. Figure 6-1 shows the state machine for a fictional coffee maker. It is assumed that the coffee maker has two heating elements, a boiling element and a warming element, with the warming element keeping a hotplate and the coffee warm.
The dot and first transition line indicate the starting state for the machine when it is first turned on, in this case the “Idle” state. The coffee maker will stay in this state until the “Start” button is pressed, at which point the boiling and warming elements will be turned on, and the machine will be in the “Brewing” state until the water reservoir is empty, at which point the power to the heating element will be turned off and the state of the machine will be in the “Keeping Warm” state. At any point, the user can press the “Cancel” button, which will turn off the heating elements and return the machine to its “Idle” state.
This example is very straightforward, and by following the transitions around the diagram, you can get a good feel for how the system will operate in practice. You could also think up other scenarios that could be dealt with—perhaps an “Error” state that is entered if the water reservoir is empty before “Start” is pressed. The condition for such a transition might be “Start pressed AND water reservoir empty.”
I find that hand drawing a state machine on the traditional “back of an envelope” or even a whiteboard is easier than using software, although if you find that you might be returning to the design in the future, you may want to scan or photograph the state machine and save it in the project folder for future reference.
Manufacturer:Xilinx
Product Categories:
Lifecycle:Any -
RoHS: -
Manufacturer:Xilinx
Product Categories: FPGAs
Lifecycle:Active Active
RoHS:
Manufacturer:Xilinx
Product Categories: Industrial components
Lifecycle:Obsolete -
RoHS: No RoHS
Manufacturer:Xilinx
Product Categories:
Lifecycle:Obsolete -
RoHS: No RoHS
Manufacturer:Xilinx
Product Categories: CPLDs
Lifecycle:Active Active
RoHS: No RoHS
Support