数字系统的设计及VHDL实践 第3章.ppt

多路选择器 多路选择器的逻辑功能是在地址选择信号的控制下,从多路输入数据中选择一路数据作为输出端口的输出数据. 4选1多路选择器 Library IEEE; Use IEEE.std_logic_1164.all; Entity mux4 is port ( input : in std_logic_vector (3 downto 0 ); a, b: in std_logic; y: out std_logic ); End mux4; Architecture behav of mux4 is signal sel :std_logic_vector(1 downto 0); Begin sel=b a; process(input , sel) begin 信号需在结构体中说明,而变量可在进程中说明。 P48 4选1多路选择器 if (sel=“00”) then y=input(0); elsif (sel=“01”) then y=input(1); elsif (sel=“10”) then y=input(2); elsif (sel=“11”)

文档评论(0)

1亿VIP精品文档

相关文档