Altera_Forum
Honored Contributor
11 years agoState Machine - define an initial state
Hi, so I'm doing this activity and I have to make a controller, but it does not have a reset or any input. It have to start the moment I put power on the circuit. Here comes the problem, when I try to simulate (an example of my code is below) it starts on a different state (not the one i want). I know why it's wrong, I just don't know how to fix, how to tell - in VHDL - which one is my initial state.
example of my code: (...) architecture beh of FSM is type states is (Initial_state , second_state , third_sate ); signal EA: states; begin process (clock, EA) begin if clock'event and clock = '1' then Case EA is when Initial_state => EA <= second_state; when second_state => EA <= third_state; when third_state => EA <= Initial_state; end case; (...) Thank you!