初学VHDL,请教寄存器多驱动的错误问题
我想实现如图的时钟bhttp://cache.amobbs.com/bbs_upload782111/files_15/ourdev_444505.jpg
(原文件名:clk.jpg)
思路是clk_in上升沿时clk_out输出0
clk_in下降沿时clk_out输出1
但是编译的时候出现以下错误
Error (10822): HDL error at clk.vhd(15): couldn't implement registers for assignments on this clock edge
哪位大侠说说这是什么问题呢?
附程序
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity clk is
port(clk_in:in std_logic;
clk_out:out std_logic);
end clk;
architecture clk1 of clk is
begin
process(clk_in)
begin
if(clk_in'event and clk_in='0')then
clk_out<='1';
end if;
if(clk_in'event and clk_in='0')then
clk_out<='0';
end if;
end process;
end clk1; 直接 clk_out <= not clk_in; 不就可以了? 是可以啊,但是我在这里实验的是上升沿和下降沿都作为敏感信号触发,但是就是不行,似乎只能用一个边沿啊 回复【2楼】155107149 北桥少年
----------------------------------------------------------------------
请问你后来怎样解决的 if(clk_in'event and clk_in='0')then
clk_out<='1';
end if;
if(clk_in'event and clk_in='0')then
clk_out<='0';
end if;
你是要它等于1还是0啊?、 Can you draw a sch. like your thought. it is hardware description language 假如这 if(clk_in'event and clk_in='0')then
clk_out<='1';
end if;
成立,你以为clk_out<='1' ,但你记住你设计的是硬件,不是软件,而这if(clk_in'event and clk_in='0')then
clk_out<='0';
end if;
不成立, clk_out<='0'保持不变,这与“ clk_out<='1'”不矛盾啦吗?! 不懂call我,QQ1247652780
页:
[1]