Forum Discussion
Altera_Forum
Honored Contributor
17 years ago --- Quote Start --- Is my implementation of the FSM a good practice? I use three processes..The first one is simply to advance state machine on the rising edge of clk..The second one determines next state based on input and current state. The third one, generate the output on the rising edge of clk...In Altera's Quartus II Handbook (and several other places), it seems that people combaining second and third process together. Is there a advantage that way? I'd like to make my code clear..plus, the third process gives me the freedom to choose whether I can have my output on the rising edge or falling edge.. --- Quote End --- Hi, I have always been against the use of anything more than one process for any state machine. Books and tutors may say anything they want but let them come and do the work with deadlines...it is perfectly possible to have just one process FSM so why bother about having excessive code and its problems. If you want to change clk edge then you can just do that separately using a further set of registers. I already notice that your second process is not right, you may get latches, your sensitivity list contains only the state machine(SC) and not all inputs read inside.