我在做一个波形发生器,为什么产生方波的程序用epm7128s84-15编译有错误,好象是逻辑阵列太多,怎么改啊
希望高手帮忙,万分感谢!!
LIBRARY ieee; use ieee.std_logic_1164.all; entity square is port(clk,clr:in std_logic; q:out integer range 0 to 255); end square; architecture sq_arc of square is signal a:bit; begin process(clk,clr) variable cnt:integer; begin if clr='0'then a<='0'; elsif clk'event and clk='1'then if cnt<31 then cnt:=cnt+1; else cnt:=0; a<=not a; end if; end if; end process; process(clk,a) begin if clk'event and clk='1'then if a='1'then q<=255; else q<=0; end if; end if; end process; end sq_arc;