Remembering where you are
10State machines
- Stage 1
- Stage 2
- Stage 3
- Stage 4
- Stage 5
- Stage 6
- Stage 7
- Stage 8
- Stage 9
- Stage 10 (this one)
- Stage 11
- Stage 12
- Stage 13
- Stage 14
- Stage 15
Explanation
A finite state machine is a register holding the current state plus combinational logic that computes the next state from the current state and the inputs. Each clock edge moves it one step.
A pattern detector that spots 1, 0, 1 in a stream of bits needs four states: nothing yet, saw 1, saw 1 0, saw 1 0 1. A traffic light controller is another. A processor's control unit is a state machine too: its states are fetch, decode and execute.
Clock a state machine
NowS0: nothing useful seen yet
input
| input | – |
|---|---|
| state | S0 |
| output | 0 |
State S0, output 0
Check yourself
Marked instantly in your browser. Use the interactive above to work it out.