Electronic – Finite State Machine and Reset Signal

digital-logicresetsequential-logicstate-machines

let's consider a certain finite state machine, for instance a Mealy Machine:

enter image description here

I was told that it cannot work properly in absence of a reset signal (for the State Register), since we would not know the initial state of the device at the moment in which it is switched on.

But I do not understand clearly this concept. In fact, a Mealy machine may be described by an ASM diagram, for instance this one:

enter image description here

Let's consider the instant in which it is switched on: why cannot it work properly without a reset button?

If it is not present, I think that the machine will follow anyway the related ASM diagram correctly, and the difference is simply that it may start from another state (for instance from s1 instead of s0).

Best Answer

You need to remember that the FSM needs to be built with actual physical components (even if it is in an FPGA). An FSM needs memory to keep track of the states, most of the time these memory elements are flip-flops. Upon power up, a flip flop can choose one of three states: High, Low or in-between (metastablity which means both transistors are on and it's a really bad state to be in).

The first reason the state machine needs to be reset is to prevent metastablity. Many FPGA's do this with an asyncronus reset.

The second reason is to get the state machine into a pre-determined state. For many applications, having a state machine starting at a random point is unacceptable.