I recently tried to make simple n to 1 multiplexer with selection input.
It just forward to output one part of input stdlogicvector, based on selection value.
When I put selection 2 and width 10 as in code below, I get zero gate count in map report.
When I put 2 and 32 I get value different than zero.
Anybody has some idea?
entity mltplx is
selection : integer:=2;
width : integer:=10
input : in std_logic_vector((2**selection)*width-1 downto 0);
sel : in std_logic_vector(selection-1 downto 0);
output : out std_logic_vector(width-1 downto 0)
architecture arch of mltplx is
mux: process(input, sel)
variable i : integer;
i := conv_integer(unsigned(sel));
output <= input((i+1)*width-1 downto i*width);