|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
代码如下:
counter:process(rst,clk.ena,sop)
begin
if(clk'event and clk='1')then --计数
if(ena='0' or sop='1')then --清零 //按照代码,应该在ena=0或sop=1时候,计数器cnt清零
//可是仿真波形显示的结果却是
//在ena=0时,cnt清零;而在sop=1时,计数器cnt没有清零
cnt<=(others=>'0');
end if;
if(ena='1')then
if(cnt=b"1111_1111")then
cnt<=(others=>'0');
else
cnt<=cnt+1;
end if;
end if;
end if;
end process counter;
----------------------
本人菜鸟,能否请高手具体说说为什么在sop=1时,cnt 没有清零 |
|