【发布时间】:2021-01-07 00:34:16
【问题描述】:
我编写了一个代码来制作一个带有 1 个选择器的 3-1 多路复用器,该选择器通过选择器脉冲工作,这是我在下面编写的代码。 但是,输出仅在 if 条件下分配给输入及其机会。如何让它在改变时始终分配给该值?
library ieee;
use ieee.std_logic_1164.all;
entity selector is
port( ip,selec: in std_logic;
a,b,c: inout std_logic);
end selector;
architecture Behaviour of selector is
signal temp : std_logic;
begin
process(selec)
begin
if (selec'EVENT and selec ='1') then
if(a = ip) then
temp<= b;
elsif (b = ip) then
temp <= c;
else
temp <= a;
end if;
end if;
end process;
end if;
end Behaviour;
我只使用 ModelSim,因为我无法访问硬件进行测试:(
【问题讨论】: