Good syntax for state machine

Joined
Sep 27, 2006
Messages
5
Reaction score
0
Hi everyone.

I've always coded a state machine using two processes and two seperate signals: current_state and next_state, along the lines of:

process(clk, reset)
if reset = '1' then
current_state <= RESET;
elsif rising_edge(clk) then
current_state <= next_state;
end if;
end process;

process(current_state, inputs...)
case current_state is
-- set next_state combinatorially...
end case
end process;


I'm now just starting to question why I do this, and not just do away with the asynchronous process and do everything in the synchronous one.

Does anyone know if there is a preferred method and why?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top