VHDL 问题
library ieee;use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity counter_1024 is
port(datain : in std_logic_vector(7 downto 0);
clk, clr, en, updn, bcdwr : in std_logic;
dataout : out std_logic_vector(7 downto 0) := "00000000";
c : out std_logic := '0');
end counter_1024;
architecture beh of counter_1024 is
begin
process(clk, en)--, clr, bcdwr, updn)
--variable data : std_logic_vector(8 downto 0) := "000000000";
begin
if (en = '1' ) then
c <= '1';
dataout(7 downto 0) <= "00000000";
--else c <='0';
end if;
end process;
end;
可时序分析图中似乎不符合if语句,恳请请各位高手指教啊!谢谢 回复 1# recoba7
你程序中没有标明en=0的情况,系统默认在输出加了一个锁存器 好深奥的VHDL,Verilog好学,呵 难怪我加了个else语句后能恢复正常。追问下,我初始化c为0,可前面en=0的那一部分c怎么不为0啊? 刚开始学这语言,先基本弄懂吧,呵呵 CLK都没用,怎么可能仿真正确。 看清楚再说。。。 process(clk, en)--, clr, bcdwr, updn)
--variable data : std_logic_vector(8 downto 0) := "000000000";
begin
if (en = '1' ) then
c <= '1';
dataout(7 downto 0) <= "00000000";
--else c <='0';
end if;
end process;
楼上的CLK在哪里用到了,请指明。CLK为什么会出现在敏感表中。你的程序太深奥了,难怪我看不懂。 clk没用到啊,还有,现在产生了锁存器,电平敏感。 好深奥的VHDL,Verilog好学,呵
页:
[1]