我的问题是关于以下代码:
library ieee;
use ieee.std_logic_1164.all;
entity exam is port (
I,CLK,RESET : in std_logic;
Q : out std_logic
);
end entity;
architecture exam_arc of exam is
signal temp_sig : std_logic;
begin
process (CLK,RESET)
begin
if RESET = '1' then
temp_sig <='0';
elsif CLK'event and CLK='1' then
temp_sig <= I;
end if;
Q <= temp_sig;
end process;
end exam_arc;
Run Code Online (Sandbox Code Playgroud)
似乎这段代码模拟了一个D触发器,它在时钟的上升沿工作,但是这个问题的答案是[这个问题来自于考试]这个问题声称这个D触发器在时钟的下降沿工作.
这个VHDL代码模拟什么样的触发器?
这是一个棘手的问题.注意,该过程在时钟上升沿和下降沿唤醒,并且在rising_edge上分配中间信号temp_sig.
把它与信号分配的语义(推迟分配)放在一起,看看你得到了什么.
吉姆建议通过模拟进行交叉检查......