IntermediateTopic 45 of 104Electronics & Embedded
Finite state machines
Sequential logic modelled by states and transitions; Moore and Mealy types.
In depth
An FSM has states, inputs, outputs and a transition function. Moore outputs depend only on state; Mealy on state and inputs. Design: state diagram, state table, encoding, next-state logic. Used for control logic, protocol handling and sequence detectors.
Key points
- One-hot encoding
- State minimisation
- Unreachable states
ExampleA traffic-light controller cycles through states on timer events.
State machines are how controllers and protocols are designed, since they turn a sequence of events into clear, testable behaviour.
What is Finite state machines?
Sequential logic modelled by states and transitions; Moore and Mealy types.
Why is it important to understand finite state machines?
State machines are how controllers and protocols are designed, since they turn a sequence of events into clear, testable behaviour.
What is the difference between Moore and Mealy machines?
In a Moore machine the output depends only on the state. In a Mealy machine it depends on the state and the inputs, so it can respond faster.
How do I avoid mistakes in a state machine?
Draw the state diagram first, cover every input in every state, and define the reset state clearly.
How is Finite state machines used in practice?
Typical applications include designing a traffic light controller with four states, modelling a communication protocol that waits for an acknowledgement and building a vending machine that tracks coins and dispenses items.
What should I learn before Finite state machines?
Study "Registers and counters" first (topic 44 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.
What are the key points of Finite state machines?
One-hot encoding. State minimisation. Unreachable states.
Can you give an example of Finite state machines?
A traffic-light controller cycles through states on timer events.
What comes after Finite state machines?
The next topic is "Timing: setup and hold", which builds directly on this one.
How difficult is Finite state machines?
It is classed as Intermediate in Electronics & Embedded (topic 45 of 104). It is an intermediate topic. Work through the beginner topics in Electronics & Embedded first.