2

我使用以下代码在 VHDL 中实现了一个寄存器:

    library ieee;
    use ieee.std_logic_1164.all;

    entity reg is

      generic (
        width : integer := 8
      );

      port (
        reset, clk, en : in  std_logic;
        d : in  std_logic_vector(width - 1 downto 0);
        q : out std_logic_vector(width - 1 downto 0)
      );

    end reg;

    architecture Behavioral of reg is

    begin

      regProc : process (clk, reset, en, d)
      begin

        if reset = '1' then

          q <= (others => '0');

        elsif rising_edge(clk) and en = '1' then

          q <= d;

        end if;

      end process;

    end Behavioral;

我在模拟它时注意到,当既没有上升时钟沿也没有复位时,它有时会改变它的输出。我在下面包含了来自 Vivado 仿真的波形,其中感兴趣的事件发生在黄色标记处。谁能向我解释这种行为?谢谢。

注册模拟

4

0 回答 0