【发布时间】:2014-05-08 14:29:49
【问题描述】:
我创建了一个分频器,我想使用 FPGA 板对其进行测试。为了测试它,如果开关打开,我想用分频制作一个 LED 闪烁。问题是如果时钟不在上升沿,我不知道如何改变 LED 的值。
这是我得到的确切错误:
第 51 行:信号灯无法合成,同步描述错误。当前软件版本不支持您用于描述同步元素(寄存器、内存等)的描述样式。 -->
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity divizor1 is
Port (clk : in STD_LOGIC;
--clk_out : out STD_LOGIC;
btn : in STD_LOGIC;
led : out STD_LOGIC
);
end entity divizor1;
architecture divizor_frecv of divizor1 is
signal cnt : std_logic_vector (24 downto 0);
signal clock :std_logic;
signal bec : std_logic;
begin
process(clk)
begin
if rising_edge(clk) then
cnt<=cnt +1;
end if;
if (cnt = "1111111111111111111111111") then
--clk_out <= '1';
clock <= '1';
else
-- clk_out <= '0';
clock <= '0';
end if;
end process;
process (clock, btn)
begin
if btn = '1' then
if clock'event and clock = '1' then
led <= '1';
else
led <= '0';
end if;
end if;
end process;
end divizor_frecv;
【问题讨论】: