Course contentsShow
← Embedded Systems & Computer Architecture
Lesson 18 of 9361. Foundations of Digital Logic and Computer ArchitectureFree lesson

Finite State Machine Formal Definitions

You will define the components of a Finite State Machine including states, transitions, inputs, and outputs using formal mathematical notation.

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 M=(Q,Σ,Δ,δ,λ,q0)M = (Q, \Sigma, \Delta, \delta, \lambda, q_0):

  1. QQ: A finite set of states. These represent the "memory" of your system (e.g., S0,S1,S2S_0, S_1, S_2).
  2. Σ\Sigma: A finite set of inputs. These are the external signals that trigger changes.
  3. Δ\Delta: A finite set of outputs. The values generated by the machine based on its current state.
  4. δ\delta: The state transition function, defined as δ:Q×Σ→Q\delta: Q \times \Sigma \to Q. This dictates which state you move to next, given your current state and an input.
  5. λ\lambda: The output function, defined as λ:Q×Σ→Δ\lambda: Q \times \Sigma \to \Delta (or sometimes just Q→ΔQ \to \Delta for Moore machines). This determines what the machine "does" while in a specific state.
  6. q0q_0: The initial state, or the starting point when the system resets.

A Practical Example

Imagine a simple two-state lock. When in state LOCKED (S0S_0), if you receive a KEY input, you transition to UNLOCKED (S1S_1).

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 (QQ) are stored in registers (flip-flops), the Transition Function (δ\delta) is implemented with combinatorial logic gates that feed the flip-flop inputs, and the Output Function (λ\lambda) 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.