Once each state has a code (state encoding), every state bit Qᵢ needs an equation for its next value Qᵢ⁺. These next-state equations, built from gates, form the next-state logic: the combinational heart of an FSM, sitting in front of the state register.
How to get them:
- Write the encoded state table as a truth table: inputs are the present-state bits and the machine inputs; outputs are the next-state bits.
- Mark rows for unused codes as don't-cares.
- Simplify each output column, for example with a karnaugh map.
With D flip-flops, D is the next value, so Dᵢ = Qᵢ⁺ and you're done. With T or JK flip-flops you'd translate through the excitation table instead.
The outputs get their own output equations the same way.
Counters use exactly the same method. The synchronous up counter's D1 = is a next-state equation.
| Z | |||||
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |