Board logo

标题: 各位大侠,帮我看看我错在哪里? [打印本页]

作者: outside    时间: 2005-11-2 10:36     标题: 各位大侠,帮我看看我错在哪里?

帮忙看下这个记数器程序错在哪里了. library ieee; use ieee.std_logic_1164.all; entity counter is port (clock:in std_logic; reset:in std_logic; hold:in std_logic; countnum:buffer integer range 0 to 59 ); end; architecture behavior of counter is begin process(reset,clock) begin if reset='1' then countnum<=0; else if rising_edge(clock)then if hold='1' then countnum<=countnum; else if countnum=59 then countnum<=0; else countnum<=countnum+1; end if; end if; end if; end process; end; 谢谢各位了!
作者: boyfly    时间: 2005-11-3 18:11

最后是否应该 end behavior;
作者: fenglouto    时间: 2005-11-3 23:10

少了个end if。不过有点看不懂hold干什么的?

[此贴子已经被fenglouto于2005-11-3 23:10:49编辑过]


作者: xlnxfpga    时间: 2005-11-4 23:08

找本语言书仔细看看吧




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0