- 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?
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?