Gofs
Member level 2
- Joined
- Apr 26, 2012
- Messages
- 48
- Helped
- 11
- Reputation
- 22
- Reaction score
- 11
- Trophy points
- 1,288
- Location
- UK / POLAND
- Activity points
- 1,659
Hi there,
I am quite new in VHDL and I came from years of programming in 'usual' languages like C++, C# and Pascal so it is difficult for me to understand some things in VHDL and maybe I am doing something stupidly wrong. Well I am trying somehow to do following:
PROCESS_COUNTER: process(CLK, RESET, ClockReset)
begin
if RESET = '0' then
Counter <= (others => '0');
elsif ClockReset'event then
Counter <= (others => '0');
elsif rising_edge(CLK) then
Counter <= Counter + 1;
end if;
end process;
Generally I want to reset the counter when a RESET signal will go 0 or there will be a signal change on ClockReset signal. Apparently this way is not the right way. Can somebody give an idea how to make the code doing that? Thanks.
I am quite new in VHDL and I came from years of programming in 'usual' languages like C++, C# and Pascal so it is difficult for me to understand some things in VHDL and maybe I am doing something stupidly wrong. Well I am trying somehow to do following:
PROCESS_COUNTER: process(CLK, RESET, ClockReset)
begin
if RESET = '0' then
Counter <= (others => '0');
elsif ClockReset'event then
Counter <= (others => '0');
elsif rising_edge(CLK) then
Counter <= Counter + 1;
end if;
end process;
Generally I want to reset the counter when a RESET signal will go 0 or there will be a signal change on ClockReset signal. Apparently this way is not the right way. Can somebody give an idea how to make the code doing that? Thanks.