What is a Finite State Machine (FSM)?

A Finite State Machine (FSM) is a digital design model used to control sequential logic. It consists of a finite number of states, transitions between those states, inputs, and outputs.

The next state of the FSM depends on the current state and input conditions.


Simple Definition

An FSM is a sequential circuit that changes its state based on clock signals and input conditions.


Basic Components of an FSM

1. State Register

Stores the current state.

2. Next State Logic

Determines the next state based on current state and inputs.

3. Output Logic

Generates outputs based on state and/or inputs.

          +----------------+
Inputs -->| Next State     |
          | Logic          |
          +----------------+
                  |
                  v
          +----------------+
Clock --> | State Register |
Reset --> | (Current State)|
          +----------------+
                  |
                  v
          +----------------+
          | Output Logic   |
          +----------------+
                  |
               Outputs

Example: Traffic Light Controller

States:

RED
YELLOW
GREEN