Forum Discussion
2 Replies
- Altera_Forum
Honored Contributor
Did you notice the HDL templates in Quartus editor context menu (right mouse click in the editor window)? They have examples for all usual VHDL constructs.
- Altera_Forum
Honored Contributor
It depends on where you want to do it. If "000" is the value of some signal - say some_signal and you have various options then use a case statement, e.g.:
note that the case statement has to be within a process. You could do if then else:case some_signal when "000" => PRICE <= "110010"; when "111" => PRICE <= some other value; when others => PRICE <= some default value; end case;
If you don't want / have a process then you coule write it as a concurrent statement - i.e just on its own:if some_signal = "000" then PRICE <= "110010"; else PRICE <= some value; end if;PRICE <= "110010" when some_signal = "000" else "some default value";