I've been developing in VHDL for a while in a University course and I thought that I understood how it worked, but once in a while I realize that I quite not actually understand it.
Here goes my question:
As I could understand, if a signal is in a process's sensitivity list, the process will "execute" whenever that signal changes value.
So I ask, what is the difference between these 2 pieces of code:
process(clk) is
begin
if(clk = '1') then
--Do Something
end if;
end process;
and
process(clk) is
begin
if(rising_edge(clk)) then
--Do Something
end if;
end process;
Shouldn't they behave equally?
With the first, if
clkchanges from anything except'1'(eg'H') to '1', "something" will get done, whereas with the second it won't. Adding an asynchronous reset illustrates this. You need:otherwise, "something" would get done when
resetchanged from'1'to'0', for example.