LATCH的产生
发布时间:2008/6/5 0:00:00 访问次数:487
在vhdl的表述逻辑的process中,如果一个信号被条件调用或者,有信号在付值语句右侧出现,而这些信号又没有在敏感表中,则输出信号会形成latch.对输入信号很多的逻辑最好不要用process表达,而用when...else 或with...select等其他.
另外还有其他情况也可以生成latch.下面是一个例子.
...
signal a : std_logic_vector( 3 downto 0);
signal b : std_logic_vector( 2 downto 0);
...
process ( rst,clk ) begin
if ( rst = '0' ) then
a <= ( others => '0' );
elsif ( clk'event and clk='1' ) then
a( 2 downto 0) <= b;
end if;
end process;
另外还有其他情况也可以生成latch.下面是一个例子.
...
signal a : std_logic_vector( 3 downto 0);
signal b : std_logic_vector( 2 downto 0);
...
process ( rst,clk ) begin
if ( rst = '0' ) then
a <= ( others => '0' );
elsif ( clk'event and clk='1' ) then
a( 2 downto 0) <= b;
end if;
end process;
在vhdl的表述逻辑的process中,如果一个信号被条件调用或者,有信号在付值语句右侧出现,而这些信号又没有在敏感表中,则输出信号会形成latch.对输入信号很多的逻辑最好不要用process表达,而用when...else 或with...select等其他.
另外还有其他情况也可以生成latch.下面是一个例子.
...
signal a : std_logic_vector( 3 downto 0);
signal b : std_logic_vector( 2 downto 0);
...
process ( rst,clk ) begin
if ( rst = '0' ) then
a <= ( others => '0' );
elsif ( clk'event and clk='1' ) then
a( 2 downto 0) <= b;
end if;
end process;
另外还有其他情况也可以生成latch.下面是一个例子.
...
signal a : std_logic_vector( 3 downto 0);
signal b : std_logic_vector( 2 downto 0);
...
process ( rst,clk ) begin
if ( rst = '0' ) then
a <= ( others => '0' );
elsif ( clk'event and clk='1' ) then
a( 2 downto 0) <= b;
end if;
end process;