|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
很短的一个计数分频程序:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity fenpin is
port(
clk:in std_logic; --12M时钟信号
clk_scan ut std_logic
);
end;
architecture abc of fenpin is
signal cnt:integer range 0 to 30;
begin
process(clk)
begin
if(rising_edge(clk))then
if(cnt=cnt'high)then
cnt<=0;
else
cnt<=cnt+1;
end if;
end if;
end process;
process(cnt,clk)
begin
if(rising_edge(clk))then
if(cnt>=cnt'high/2)then
clk_scan<='1';
else
clk_scan<='0';
end if;
end if;
end process;
end;
=====================================================
不知道程序有没有问题?我做功能仿真的时候能够看到cnt信号,但是做时序仿真的时候就没有了。怎么回事呢? |
|