mux2to1.vhd

来自「【经典设计】VHDL源代码下载~~ 其中经典的设计有:【自动售货机】、【电子钟」· VHDL 代码 · 共 18 行

VHD
18
字号

--mux2to1.vhd n-bit 2-to-1 multiplexer
library ieee ;
use ieee.std_logic_1164.all ;
entity mux2to1 is
generic ( n : integer := 14 ) ;
port (	
  w0 : in 	std_logic_vector(n-1 downto 0) ;--input first term
  w1 : in 	std_logic_vector(n-1 downto 0) ;--input second term
  s	: in 	std_logic ;--select line
  f	: out 	std_logic_vector(n-1 downto 0) ) ;--output seleted term
end mux2to1 ;
architecture behavior of mux2to1 is
begin
  with s select
  f <= w0 when '0',
       w1 when others ;
end behavior ;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?