What are the advantages to using Finite State Machines (FSMs) to design modules?
A. State Machines (FSMs) are the best way to describe the sequential behavior of a system component or attribute. State Diagrams can be used to convey the system’s behavior in response to both internal and external events and conditions. The analysis of most source-code would reveal, to the knowing eye, the existence of some aspect of sequential operations. Unfortunately, this occurs more of a necessary artifact, as opposed to a direct design method, usually resulting in a poorly structured system that can be very difficult to maintain. The basic concept of a state machine is: if a specified event has not occurred, than nothing needs to be performed for this task. If it has occurred, then perform some action and transit to the next defined state, to continue the sequential process for this task. The Staccato Design Method is based almost entirely on ‘direct coding’ of these powerful State Diagrams. Their usage is what allows for excellent performance of your embedded software. For more