Every clocked machine works in two moments:
- Between edges, it sits in its present state, and its logic works out where to go.
- At the active edge, it moves to the next state, which then becomes the new present state.
In a state diagram, the next state is wherever the arrow for the current input leads. In a state table, it's the cell in the present state's row under the current input. In hardware, it's the value on the flip-flops' D inputs just before the edge, worked out by the next-state logic.
Notation: you'll often see Q⁺ (or Q(t + 1)) for the next value of a state bit Q.
For a counter with no inputs, each state has just one next state, so the sequence is fixed. For an FSM with inputs, the same present state can lead to different next states depending on the input.
The next state is decided by values just before the edge. An input that changes after the edge affects the following transition, not this one.