_SYNC_PROC: process ()
begin
if ('event and = '1') then
if ( = '1') then _state <= st1_;
-- Output signals here will have one clock delay of the <= '0'; <= '0';
else _state <= _next_state; <= _c; <= _c;
-- assign other outputs to internal signals
end if;
end if;
end process;
_NEXT_STATE_DECODE: process (_state, , , ...)
begin
--declare default state for next_state to avoid latches _next_state <= _state;
-- default is to stay in current state
-- so there are no else branch in the if statement
case (_state) is
when _st1_ =>
-- State Change Condition
if = '1' then _next_state <= _st2_;
-- Internal Output can put here
-- Only occur on state transaction (next_state changed but state not changed)
-- If output need to assert at first cycle of one state,
-- we can delay this output one clock in _SYNC_PROC process
end if;
-- Internal Output can put here
-- This output will be asserted till state change
when _st2_ =>
if = '1' then _next_state <= _st3_;
end if;
when _st3_ => _next_state <= _st1_;
when others => _next_state <= _st1_;
end case;
end process;