syyang85
Newbie level 3
This is a typical counter which counts until 31 with every clock coming in
but im havin this error
why can't i have more than more than 1 wait statement in the process, if not how am i ever to loop it?
any ideas?
when i try to change wait until CLK='1'; to if (CLK'event and CLK='1') then
It gave me warning of exceeding 10,000 iteration.
Why it wont exit the loop when the condition of (intern_value<31) is fulfilled?
but im havin this error
Error (10398): VHDL Process Statement error at count31.vhd(27): Process Statement must contain only one Wait Statement
why can't i have more than more than 1 wait statement in the process, if not how am i ever to loop it?
any ideas?
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
entity COUNT31 is
port ( CLK: in std_logic;
COUNT: out integer);
end COUNT31;
architecture behav_COUNT of COUNT31 is
begin
P_COUNT: process
variable intern_value: integer;
begin
intern_value:=0;
while (intern_value<31) loop
wait until CLK='1';
intern_value:=intern_value + 1;
COUNT <= intern_value;
end loop;
end process P_COUNT;
end behav_COUNT;
when i try to change wait until CLK='1'; to if (CLK'event and CLK='1') then
It gave me warning of exceeding 10,000 iteration.
Why it wont exit the loop when the condition of (intern_value<31) is fulfilled?