论坛» 嵌入式开发» FPGA

高手帮帮忙 小弟有礼了

菜鸟
2005-05-18 05:48 1楼

我在做一个波形发生器,为什么产生方波的程序用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;

菜鸟
2005-06-02 00:07 2楼

楼上的很热心,鼓掌

共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册]