Vhdl 如何更改为when语句

Vhdl 如何更改为when语句,vhdl,Vhdl,有人能帮我把这个vhdl代码改成使用“when”语句吗 以下是我编写的代码: library IEEE; use IEEE.std_logic_1164.all; entity sel2_1 is port( A, B, SEL : in std_logic; outsgnl : out std_logic); end sel2_1; architecture EX1 of sel2_1 is begin outsgnl <= (not SEL an

有人能帮我把这个vhdl代码改成使用“when”语句吗

以下是我编写的代码:

library IEEE;
use IEEE.std_logic_1164.all;

entity sel2_1 is
   port( A, B, SEL : in std_logic;
         outsgnl    : out std_logic);
end sel2_1;

architecture EX1 of sel2_1 is
begin
   outsgnl <= (not SEL and A) or (SEL and B);
end EX1;
IEEE库;
使用IEEE.std_logic_1164.all;
实体sel2_1为
端口(A、B、SEL:std_逻辑中;
outsgnl:out标准逻辑);
结束sel2_1;
sel2_1的架构EX1为
开始

当关键字在不同的VHDL分配中使用时,outsgnl。假设
SEL
仅为
'0'
'1'
,则可以简单地替换

outsgnl <= (not SEL and A) or (SEL and B);

当关键字在不同的VHDL分配中使用时,
outsgnl。假设
SEL
仅为
'0'
'1'
,则可以简单地替换

outsgnl <= (not SEL and A) or (SEL and B);

outsgnl我已经编辑了上面的问题,并把模拟结果放进去了。我正在尝试将vhdl代码改为使用when语句,我希望得到相同的精确结果。我编辑了上面的问题,并将模拟结果放在上面。我正在尝试将vhdl代码改为使用when语句,我希望得到相同的结果。非常感谢!它的工作原理与我上面发布的模拟相同。非常感谢!它的工作原理与我上面发布的模拟相同。
outsgnl <= A when SEL = '0' else B;