Finite State Machine Formal Definitions
In this lesson, you will learn how to represent a Finite State Machine (FSM) using precise mathematical notation to bridge the gap between abstract logic and physical circuit design.
While we have used flip-flops to build counters, more complex systems require a formal way to track "where" the system is and "how" it should react to the outside world. A Finite State Machine is defined as a 6-tuple :
- : A finite set of states. These represent the "memory" of your system (e.g., ).
- : A finite set of inputs. These are the external signals that trigger changes.
- : A finite set of outputs. The values generated by the machine based on its current state.
- : The state transition function, defined as . This dictates which state you move to next, given your current state and an input.
- : The output function, defined as (or sometimes just for Moore machines). This determines what the machine "does" while in a specific state.
- : The initial state, or the starting point when the system resets.
A Practical Example
Imagine a simple two-state lock. When in state LOCKED (), if you receive a KEY input, you transition to UNLOCKED ().
We define the transition as:
δ(S0, KEY) = S1
If the input is NONE, the state remains the same:
δ(S0, NONE) = S0
In your hardware, these formal definitions correspond directly to logic components: the States () are stored in registers (flip-flops), the Transition Function () is implemented with combinatorial logic gates that feed the flip-flop inputs, and the Output Function () is combinatorial logic that reads the current flip-flop state to drive external pins. By mapping these, you can design any sequential circuit systematically.
Key Takeaway: An FSM is formally defined as a mathematical tuple that maps current states and inputs to next states and outputs, providing a rigorous blueprint for implementing complex sequential control logic.