Forum Discussion
Altera_Forum
Honored Contributor
12 years agoIn an async process, all signs must be assigned in ALL branches. In your code, LED_out is only assigned in the closed and opened states - it must also be assigned in all of the other states.
The way to avoid this is assign all signals in an asynchronous process a default value before the case statement. This way, if it is not assigned a specific value in a branch, it will take the default assignment.
process(state)
begin
output <= '0'; --default assignment
case state is
when state1 =>
--do something
--no assignment to output means it will be '0';
when state2 =>
output <= '1'; --overrides default assignment
when state3 =>
--no output assignment, output is '0' again
end case;
end process;
This way latches are avoided.