Forum Discussion
Altera_Forum
Honored Contributor
16 years agoNeed help creating a simple 32bit counter
I'm trying to learn VHDL so I thought I'd try converting the "my_first_fpga" example from verilog to VHDL (how complicated can adding one to a number be?), three hours later, lots of googling and sea...
Altera_Forum
Honored Contributor
16 years agoThanks, a friend suggested verilog over VHDL, maybe I should listen to him.
Question: The following worksQ : buffer std_logic_vector(31 downto 0));
if CLK'EVENT AND CLK = '1' then
Q <= Q + 1 ;
end if;But if the counter is stored in a variable and copied to Q on a positive edge it doesn't work. ie: if CLK'EVENT AND CLK = '1' then
counter := counter + 1;
Q <= counter ;
end if; Why doesn't that work?