-- +-----------------------------+ -- | Library: multiplexer | -- | designer : Tim Pagden | -- | opened: 7 Jul 1998 | -- +-----------------------------+ -- Function: N-bit M-to-1 multiplexer library ieee; library vfp; use ieee.std_logic_1164.all; use vfp.integer_class.all; use vfp.hardware_specifications.all; entity mux_generic is generic ( data_width : integer := 1; -- N-bit data funnel_factor : integer := 2 -- M to 1, thus f_f = M ); port ( -- a : in std_ulogic_vector((data_width * funnel_factor)-1 downto 0); a : in std_ulogic_2D_array(0 to (funnel_factor-1), data_width-1 downto 0); sel : in std_ulogic_vector(log_2(funnel_factor)-1 downto 0); -- actually, just std_ulogic_vector; would do the trick y : out std_ulogic_vector(data_width-1 downto 0) ); end mux_generic;