VHDL中的灵敏度列表

时间:2014-02-13 19:35:38

标签: vhdl digital

此处的代码:http://esd.cs.ucr.edu/labs/tutorial/latch.vhd

--------------------------------------------
-- Simple D Latch (ESD book Chapter 2.3.1)
-- by Weijun Zhang, 04/2001
--
-- latch is simply controlled by enable bit
-- but has nothing to do with clock signal
-- notice this difference from flip-flops
--------------------------------------------

library ieee ;
use ieee.std_logic_1164.all;

entity D_latch is
port(   data_in:    in std_logic;
    enable:     in std_logic;
    data_out:   out std_logic
);
end D_latch;

architecture behv of D_latch is
begin       

    -- compare this to D flipflop

    process(data_in, enable)
    begin
        if (enable='1') then
            -- no clock signal here
        data_out <= data_in;  
    end if;
    end process;    

end behv;

为什么“data_in”需要在敏感度列表中?我知道该过程需要它来进行分配,但是过程基于启用输入而起作用。

由于

1 个答案:

答案 0 :(得分:0)

对于D-latch,只要enable为'1',就需要data_out = data_in。因此,如果data_in发生变化,而enable仍为'1',则data_out必须更改。如果data_in不在敏感列表中,则不会发生这种情况。