:PROPERTIES:
:ID: 29d52285-bccb-40dd-90f5-ac2e828c498b
:mtime: 20231023031918
:ctime: 20231023031906
:END:
#+title: finite state machine
#+filetags: :public:project:
* Definition Finite State Machine
- *Finite State Machine* (FSM) – a deterministic
machine (circuit) that produces outputs which
depend on its internal state and external inputs
- *States* – the set of internal memorised values,
shown as circles on the state diagram
- *Inputs* – External stimuli, labelled as arcs on the
state diagram
- *Outputs* – Results from the FSM
* Types of FSM
There are 2 main types of FSM:
1) [[id:a25405e3-fd5b-4d13-a0bd-730d0833e89c][moore machine]]
2) [[id:5b797b90-e399-4f96-a817-80a27556dd42][mealy machine]]
* Problems with FSM
Consider what could happen on power-up:
- The state of the FFs could by chance be in
one of the unused states
- This could potentially cause the machine to
become stuck in some unanticipated sequence of
states which never goes back to a used state
** What can be done?
– Check to see if the FSM can eventually
enter a known state from any of the
unused states
– If not, add additional logic to do this, i.e.,
include unused states in the state transition
table along with a valid next state
– Alternatively use asynchronous Clear and
Preset FF inputs to set a known (used)
state at power up