第1个回答 2011-04-24
process (clk ,start ,stop ,pause ,js)
variable a ,b : std logic ;
variable aa :integer range 0 to 100 ;
variable chf ,lc :integer range 0 to 8000 ;
variable num:integer range 0 to 9 ;
begin
if clk′event and clk =‘1’ then
if stop =‘0’ then
chf : = 0 ;
num: = 0 ;
b : =‘1’;
aa : = 0 ;
lc : = 0 ;
elsif start =′0′ then
b : =′0′;
chf : = 700 ;
lc : = 0 ;
elsif start =′1′and js =′1′and pause =′1′ then
if b =′0′)then
num: = num + 1 ;
end if ;
if num = 9)then
lc : = lc + 5 ;
num: = 0 ;
aa : = aa + 5 ;
end if ;
elsif start =′1′and js =′0′and pause =′1′then
lc : = lc + 1 ;
aa : = aa + 1 ;
end if ;
if aa > = 100 then
a : =′1′;
aa : = 0 ;
else
a : =′0′;
end if ;
if lc < 300 then
null ;
elsif chf < 2000 and a =′1′ then
chf : = chf + 220 ;
elsif chf > = 2000 and a =′1′ then
chf : = chf + 330 ;
end if ;
end if ;
chefei < = chf ;
luc < = lc ;
end process ;
把if后的括号都去了,不需要的,你再试试,如果不行再联系。