Concurrency VHDL新增功能,不支持未受影响的波形
我使用的是VHDL,但我的模拟器不支持下面的示例代码中未受影响的波形,我需要先运行这些代码,然后才能开始家庭作业。我在网上读到,我可以传递相同的波形Z,但我不知道如何才能得到与未受影响的关键字相同的结果。。。如何重写它以产生相同的结果 PS:我需要在作业的下一部分中使用if-then-else语句重写它,我知道在这种情况下我可以使用next关键字。这是一本教科书中的代码,我需要在作业之前运行它 谢谢你的帮助Concurrency VHDL新增功能,不支持未受影响的波形,concurrency,signals,vhdl,xilinx,Concurrency,Signals,Vhdl,Xilinx,我使用的是VHDL,但我的模拟器不支持下面的示例代码中未受影响的波形,我需要先运行这些代码,然后才能开始家庭作业。我在网上读到,我可以传递相同的波形Z,但我不知道如何才能得到与未受影响的关键字相同的结果。。。如何重写它以产生相同的结果 PS:我需要在作业的下一部分中使用if-then-else语句重写它,我知道在这种情况下我可以使用next关键字。这是一本教科书中的代码,我需要在作业之前运行它 谢谢你的帮助 library IEEE; use IEEE.std_logic_1164.all;
library IEEE;
use IEEE.std_logic_1164.all;
entity pr_encoder is
port ( S0, S1,S2,S3: in std_logic;
Z : out std_logic_vector (1 downto 0));
end entity pr_encoder;
architecture behavioral of pr_encoder is
begin
Z <= "00" after 5 ns when S0 = '1' else
"01" after 5 ns when S1 = '1' else
unaffected when S2 = '1' else
"11" after 5 ns when S3 = '1' else
"00" after 5 ns;
end architecture behavioral;
IEEE库;
使用IEEE.std_logic_1164.all;
实体pr_编码器为
端口(S0、S1、S2、S3:std_逻辑中;
Z:输出标准逻辑向量(1到0);
终端实体pr_编码器;
pr_编码器的结构是
开始
Z否,如果您只是用未受影响
对行进行注释,行为将发生改变
你似乎在描述一个故事。(在同步设计中不建议这样做)。实际上,Z
在S2/='1'
时更新,而在S2='1'
时不更新
您确实可以将作业包装在流程和if-else结构中,但不需要next
语句
process (S0, S1, S2, S3) is
begin
if S0 = '1' then
Z <= "00" after 5 ns;
elsif S1 = '1' then
Z <= "01" after 5 ns;
elsif S2 = '1' then
null; -- do nothing
elsif S3 = '1' then
Z <= "11" after 5 ns;
else
Z <= "00" after 5 ns;
end if;
end process;
旁白:
我以前从未听说过未受影响的
关键字,我认为它的使用非常有限,因此可能不是所有工具都支持它
你的模拟器是什么
Z <= "00" after 5 ns when S0 = '1' else
"01" after 5 ns when S1 = '1' else
"11" after 5 ns when S2 /= '1' and S3 = '1' else
"00" after 5 ns when S2 /= '1';
-- else unaffected is implicit