EDA技术:怎么使用with_select语句设计一个四选一16位数据选择器?

如题所述

第1个回答  推荐于2017-09-16
library ieee;
use ieee.std_logic_1164.all;
entity xzq4 is
port(i0, i1, i2, i3:in std_logic_vector(15 downto 0);
s0, s1: in std_logic;
y : out std_logic_vector(15 downto 0));
end xzq4;
architecture rtl of xzq4 is
signal sel : std_logic_vector (1 downto 0);
begin
sel<=s1 & s0;-
with sel select
y<=i0 when "00",
i1 when "01",
i2 when "10",
i3 when others;
end rtl;本回答被提问者采纳
相似回答