library ieee; 
use ieee.std_logic_1164.all;
use work.std_arith.all; --need for std_match

entity TEST_LOOK_UP is
	port (
	A: in std_logic_vector(2 downto 0);
	B: out std_logic_vector(1 downto 0)
);
end TEST_LOOK_UP;

architecture behavior of TEST_LOOK_UP is 
	constant Rows: integer :=8;
	constant Cols: integer :=5;
	constant NumIns: integer :=3;
	constant NumOuts: integer :=2;

	subtype MyData is std_logic_vector(Cols-1 downto 0);
	type Table is array(0 to Rows-1) of MyData;
	constant MyTable: Table := (
--		NumIns=3 inputs / NumOuts=2 outputs
             "00011",   
             "00110",
             "01001", 
             "01100",
             "10011",   
             "10110",
             "11001", 
             "11101"
	        );
	 begin
		process(A)
		variable X: MyData;
		begin
			for Count in 0 to Rows-1 loop
				X := MyTable(Count);
				if std_match(A,X(NumIns+NumOuts-1 downto 2)) then
					B <= X(NumOuts-1 downto 0);
				end if;
			end loop;       
		end process;
end behavior;
