MUX2TO1.VHD
上传用户:dgjihui88
上传日期:2013-07-23
资源大小:43k
文件大小:1k
源码类别:
VHDL/FPGA/Verilog
开发平台:
MultiPlatform
- --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 ;