I\'m trying to create a reusable barrel shifter; it takes an input array of bits and shifts them a certain number of positions (determined by another input). I want to parameter
You can instead of inputting the NUMBITS value as 8, input it as 2 (log2(8)), then retype as below to get around the problem, your generic just won't be as clean but it is scale-able.
entity BarrelShifter is
generic ( NUMBITS : integer :=2);
Port ( INPUT : in std_logic_vector (((2**Nbits)-1) downto 0);
OUTPUT : out std_logic_vector (((2**Nbits)-1) downto 0);
SHIFT_CNT : in std_logic_vector ((NUMBITS-1) downto 0)
);
end BarrelShifter;