An electronic lock, a vending machine, a subway turnstile, a control panel for a microwave oven, a spell checker, a text search application, and the core of a microprocessor all embody a common element. Their behavior can be modeled using a finite state machine. A state machine is a model used in a design to visualize the effects of a sequence of inputs on the state of the system and its output. The behavior of the system is predetermined from its design. A state machine is one of the most common building blocks of modern digital systems.
A state machine is a model used to describe the behavior of a real world system. State machines are used to solve a large number of problems. They are used to model the behavior of various types of devices such as electronic control devices, parsing of communications protocols and programs that perform text or pattern searches.
State machines may be described using a state diagram and a state table. A state diagram is composed of states, inputs, outputs and transitions between states. A state table describes a state machine with the present state and input on the left and the next state and output on the right.
State machines may be implemented using either a hardware architecture or a software architecture. The advantage of a hardware implementation is that it operates very fast, but it is difficult to modify and usually requires more circuit board space. The advantage of a software implementation is that it is easier to design and modify, but can be slower than the hardware equivalent.
At the conclusion of this course the student will learn:
- When to use a state machine in a design
- The differences between a Mealy machine and a Moore machine
- The different components of a state machine
- The difference between a state diagram and a state table
- The advantages and disadvantages of a state machine implemented in hardware
- The advantages and disadvantages of a state machine implemented in software