由于模拟,过程不起作用

时间:2018-06-09 09:53:04

标签: vhdl

我编写了这段代码来理解vhdl中的进程,但奇怪的是我看到了无法正常工作的模拟 我的代码:

entity test is
    port(
        i1 : in std_logic;
        i2 : in std_logic;
        r : out std_logic
    );
end test;

architecture Behavioral of test is
signal g : std_logic;
begin
    process(i1)
        begin
        if i1 = '1' then 
            g <= '1';
        else 
            g <= '0';
        end if;
    end process;
    process(i2)
    begin
        if i2 = '1' and g = '0' then
            r <= '1';
        else
            r <= '0';
        end if;
    end process;

end Behavioral;

这是我的结果: enter image description here

当我处理i1时所以g在第一个周期应为1,所以r应为0但i2为1后r为1

1 个答案:

答案 0 :(得分:0)

您在第二个过程中使用g,但它不在过程敏感度列表中。

process(i2,g)
begin
    if i2 = '1' and g = '0' then
...
相关问题