0
我正在尝试使用VHDL设计一个交通灯控制器,我正在用Altera EPM240T100C5编程,并使用自定义扩展板来显示交通信号灯。最慢的时钟电路板上设置仍然较快,比我想,我需要写一个我一样这么一个时钟分频器:VHDL时钟分频器在板上工作但仿真失败
LIBRARY ieee;
USE ieee.std_logic_1164.all;
entity clockdivider is
port
(
clkin : in std_logic;
dividedclk : out std_logic
);
end clockdivider;
architecture divider of clockdivider is
signal J : std_logic;
signal K : std_logic;
begin
J <= '1';
K <= '1';
process(clkin)
variable tempdividedclk : std_logic;
begin
if (rising_edge(clkin)) then
tempdividedclk := (NOT(tempdividedclk) AND J) OR (tempdividedclk AND (NOT(K)));
end if;
dividedclk <= '0';
dividedclk <= tempdividedclk;
end process;
END divider;
这将运行在板上,但在模拟器(精细的ModelSim )“dividedclk”输出无法初始化任何东西。我想知道是否有人知道为什么?
在此过程中,可以为tempdivideclk的变量声明提供默认值'0'或'1'。 'variable tempdividedclk:std_logic:='0';' – user1155120