Re: FSM state register?
One-hot encoding sets one bit in the state register for each state. For ex, FSM with 16 states required 16 FF`s for one hot encoding.
Each node of the state diagram in one-hot encoding is implemented with one FF. There are lot of unused states in the One-hot encoding. If you use N FF , there will be 2 power N used states , 2 power N - N states are unused states.
In your example, to represent 5 , you need to specify 10000 not 0101...and etc..
There are diffrent FSM encoding style including One-hot, are Adjucent encoding, Random encoding, User-Specific encoding, Moore encoding, Binary encoding and etc..
Regards,
Sam