library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity amplitud is
    Port ( 	CLK : in  STD_LOGIC;                                    -- 48000Hz
				num_nota : in STD_LOGIC_VECTOR (4 downto 0);  
				num_inst : in STD_LOGIC_VECTOR (1 downto 0);
				af : out STD_LOGIC_VECTOR (7 downto 0);
				a1 : out STD_LOGIC_VECTOR (7 downto 0);								
				a2 : out STD_LOGIC_VECTOR (7 downto 0);								
				a3 : out STD_LOGIC_VECTOR (7 downto 0);								
				a4 : out STD_LOGIC_VECTOR (7 downto 0);								
				a5 : out STD_LOGIC_VECTOR (7 downto 0);								
				a6 : out STD_LOGIC_VECTOR (7 downto 0);								
				a7 : out STD_LOGIC_VECTOR (7 downto 0);								
				a8 : out STD_LOGIC_VECTOR (7 downto 0);								
				a9 : out STD_LOGIC_VECTOR (7 downto 0);								
				a10 : out STD_LOGIC_VECTOR (7 downto 0);								
				a11 : out STD_LOGIC_VECTOR (7 downto 0);								
				a12 : out STD_LOGIC_VECTOR (7 downto 0);								
				a13 : out STD_LOGIC_VECTOR (7 downto 0);								
				a14 : out STD_LOGIC_VECTOR (7 downto 0);								
				a15 : out STD_LOGIC_VECTOR (7 downto 0);								
				a16 : out STD_LOGIC_VECTOR (7 downto 0);								
				a17 : out STD_LOGIC_VECTOR (7 downto 0);								
				a18 : out STD_LOGIC_VECTOR (7 downto 0);								
				a19 : out STD_LOGIC_VECTOR (7 downto 0)										
				);
end amplitud;

architecture Behavioral of amplitud is

--------------------------------------------ROMs-------------------------------------------------
------------- OBOE
									
	type ROM_a_1 is array (0 to 18) of integer;																				-- ROM amplitud frecuencia fundamental inst1
	constant MEM_a_1: ROM_a_1:=(0,0,155,138,155,150,154,152,104,116,136,110,152,100,138,129,119,0,0);	

	type ROM_a1_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 1 inst1
	constant MEM_a1_1: ROM_a1_1:=(0,0,45,62,52,61,35,55,61,34,36,26,40,34,20,111,76,0,0);	
									
	type ROM_a2_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 2 inst1
	constant MEM_a2_1: ROM_a2_1:=(0,0,11,68,67,74,60,57,82,55,64,96,78,76,52,137,111,0,0);
									
	type ROM_a3_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 3 inst1
	constant MEM_a3_1: ROM_a3_1:=(0,0,41,46,46,67,42,61,85,84,115,48,21,6,9,23,8,0,0);									

	type ROM_a4_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 4 inst1
	constant MEM_a4_1: ROM_a4_1:=(0,0,77,48,90,97,79,34,71,39,97,48,14,6,24,12,5,0,0);
									
	type ROM_a5_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 5 inst1
	constant MEM_a5_1: ROM_a5_1:=(0,0,83,36,25,13,21,30,18,14,15,8,6,4,4,31,24,0,0);

	type ROM_a6_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 6 inst1
	constant MEM_a6_1: ROM_a6_1:=(0,0,39,61,11,2,1,4,9,4,24,18,4,18,24,16,9,0,0);

	type ROM_a7_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 7 inst1
	constant MEM_a7_1: ROM_a7_1:=(0,0,4,20,1,3,1,7,8,19,5,6,18,6,1,4,1,0,0);									
						  
	type ROM_a8_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 8 inst1
	constant MEM_a8_1: ROM_a8_1:=(0,0,6,17,2,12,4,5,1,7,9,13,7,4,4,1,2,0,0);	

	type ROM_a9_1 is array (0 to 18) of integer;																				-- ROM amplitud arm 9 inst1
	constant MEM_a9_1: ROM_a9_1:=(0,0,11,21,9,4,6,3,6,2,3,2,2,5,2,2,1,0,0);	
									
	type ROM_a10_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 10 inst1
	constant MEM_a10_1: ROM_a10_1:=(0,0,8,8,13,11,1,3,1,1,0,2,1,0,1,1,2,0,0);	
									
	type ROM_a11_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 11 inst1
	constant MEM_a11_1: ROM_a11_1:=(0,0,2,11,8,4,0,0,0,1,1,5,0,1,0,1,0,0,0);
									
	type ROM_a12_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 12 inst1
	constant MEM_a12_1: ROM_a12_1:=(0,0,7,13,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0);
									
	type ROM_a13_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 13 inst1
	constant MEM_a13_1: ROM_a13_1:=(0,0,4,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0);
									 
	type ROM_a14_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 14 inst1
	constant MEM_a14_1: ROM_a14_1:=(0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a15_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 15 inst1
	constant MEM_a15_1: ROM_a15_1:=(0,0,0,5,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a16_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 16 inst1
	constant MEM_a16_1: ROM_a16_1:=(0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

	type ROM_a17_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 17 inst1
	constant MEM_a17_1: ROM_a17_1:=(0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);		

	type ROM_a18_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 18 inst1
	constant MEM_a18_1: ROM_a18_1:=(0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);											

	type ROM_a19_1 is array (0 to 18) of integer;																			-- ROM amplitud arm 19 inst1
	constant MEM_a19_1: ROM_a19_1:=(0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
	
-------------VIOLIN
									
	type ROM_a_2 is array (0 to 18) of integer;																				
	constant MEM_a_2: ROM_a_2:=(0,0,81,155,100,136,92,141,80,97,90,151,145,138,130,86,128,0,0);	

	type ROM_a1_2 is array (0 to 18) of integer;																				
	constant MEM_a1_2: ROM_a1_2:=(0,0,37,55,24,31,17,57,43,32,31,29,45,30,30,25,70,0,0);	
									
	type ROM_a2_2 is array (0 to 18) of integer;																				
	constant MEM_a2_2: ROM_a2_2:=(0,0,40,8,28,61,7,19,40,11,8,9,16,13,7,3,0,0,0);
									
	type ROM_a3_2 is array (0 to 18) of integer;																				
	constant MEM_a3_2: ROM_a3_2:=(0,0,12,1,6,5,3,9,9,3,4,5,1,3,1,7,3,0,0);									

	type ROM_a4_2 is array (0 to 18) of integer;																				
	constant MEM_a4_2: ROM_a4_2:=(0,0,12,2,5,2,0,6,3,4,2,1,1,0,0,7,2,0,0);
									
	type ROM_a5_2 is array (0 to 18) of integer;																				
	constant MEM_a5_2: ROM_a5_2:=(0,0,2,2,1,1,0,1,5,3,0,2,3,1,2,0,0,0,0);

	type ROM_a6_2 is array (0 to 18) of integer;																				
	constant MEM_a6_2: ROM_a6_2:=(0,0,3,1,3,4,1,1,2,1,1,0,0,0,1,2,2,0,0);

	type ROM_a7_2 is array (0 to 18) of integer;																				
	constant MEM_a7_2: ROM_a7_2:=(0,0,0,3,1,1,1,1,0,1,0,1,0,2,0,1,0,0,0);									
						  
	type ROM_a8_2 is array (0 to 18) of integer;																				
	constant MEM_a8_2: ROM_a8_2:=(0,0,0,1,1,0,1,1,0,0,0,1,1,1,0,2,0,0,0);	

	type ROM_a9_2 is array (0 to 18) of integer;																				
	constant MEM_a9_2: ROM_a9_2:=(0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0);	
									
	type ROM_a10_2 is array (0 to 18) of integer;																			
	constant MEM_a10_2: ROM_a10_2:=(0,0,0,0,0,0,1,0,1,1,0,2,0,0,0,0,0,0,0);	
									
	type ROM_a11_2 is array (0 to 18) of integer;																			
	constant MEM_a11_2: ROM_a11_2:=(0,0,0,0,0,0,0,0,3,1,0,0,0,0,0,0,0,0,0);
									
	type ROM_a12_2 is array (0 to 18) of integer;																			
	constant MEM_a12_2: ROM_a12_2:=(0,0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0);
									
	type ROM_a13_2 is array (0 to 18) of integer;																			
	constant MEM_a13_2: ROM_a13_2:=(0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a14_2 is array (0 to 18) of integer;																			
	constant MEM_a14_2: ROM_a14_2:=(0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a15_2 is array (0 to 18) of integer;																			
	constant MEM_a15_2: ROM_a15_2:=(0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a16_2 is array (0 to 18) of integer;																			
	constant MEM_a16_2: ROM_a16_2:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

	type ROM_a17_2 is array (0 to 18) of integer;																			
	constant MEM_a17_2: ROM_a17_2:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);		

	type ROM_a18_2 is array (0 to 18) of integer;																			
	constant MEM_a18_2: ROM_a18_2:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);											

	type ROM_a19_2 is array (0 to 18) of integer;																			
	constant MEM_a19_2: ROM_a19_2:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
	
	------------- TUBA		
									
	type ROM_a_3 is array (0 to 18) of integer;																				
	constant MEM_a_3: ROM_a_3:=(0,0,155,134,112,63,72,120,86,107,146,96,138,131,106,108,105,0,0);	

	type ROM_a1_3 is array (0 to 18) of integer;																				
	constant MEM_a1_3: ROM_a1_3:=(0,0,45,36,41,41,27,31,55,23,51,93,82,33,31,26,35,0,0);	
									
	type ROM_a2_3 is array (0 to 18) of integer;																				
	constant MEM_a2_3: ROM_a2_3:=(0,0,54,23,37,33,53,40,51,42,24,40,33,9,3,10,4,0,0);
									
	type ROM_a3_3 is array (0 to 18) of integer;																				
	constant MEM_a3_3: ROM_a3_3:=(0,0,31,32,18,30,22,14,21,7,1,9,7,2,2,4,1,0,0);									

	type ROM_a4_3 is array (0 to 18) of integer;																				
	constant MEM_a4_3: ROM_a4_3:=(0,0,12,13,5,1,5,7,10,8,1,8,3,1,0,0,1,0,0);
									
	type ROM_a5_3 is array (0 to 18) of integer;																				
	constant MEM_a5_3: ROM_a5_3:=(0,0,2,11,7,6,0,2,5,3,0,1,1,0,0,0,0,0,0);

	type ROM_a6_3 is array (0 to 18) of integer;																				
	constant MEM_a6_3: ROM_a6_3:=(0,0,7,2,3,4,2,1,3,1,0,0,0,0,0,0,0,0,0);

	type ROM_a7_3 is array (0 to 18) of integer;																				
	constant MEM_a7_3: ROM_a7_3:=(0,0,5,4,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0);									
						  
	type ROM_a8_3 is array (0 to 18) of integer;																				
	constant MEM_a8_3: ROM_a8_3:=(0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0);	

	type ROM_a9_3 is array (0 to 18) of integer;																				
	constant MEM_a9_3: ROM_a9_3:=(0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);	
									
	type ROM_a10_3 is array (0 to 18) of integer;																			
	constant MEM_a10_3: ROM_a10_3:=(0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);	
									
	type ROM_a11_3 is array (0 to 18) of integer;																		
	constant MEM_a11_3: ROM_a11_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
									
	type ROM_a12_3 is array (0 to 18) of integer;																			
	constant MEM_a12_3: ROM_a12_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
									
	type ROM_a13_3 is array (0 to 18) of integer;																		
	constant MEM_a13_3: ROM_a13_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a14_3 is array (0 to 18) of integer;																		
	constant MEM_a14_3: ROM_a14_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a15_3 is array (0 to 18) of integer;																	
	constant MEM_a15_3: ROM_a15_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
									 
	type ROM_a16_3 is array (0 to 18) of integer;																
	constant MEM_a16_3: ROM_a16_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

	type ROM_a17_3 is array (0 to 18) of integer;																
	constant MEM_a17_3: ROM_a17_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

	type ROM_a18_3 is array (0 to 18) of integer;																
	constant MEM_a18_3: ROM_a18_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);										

	type ROM_a19_3 is array (0 to 18) of integer;																	
	constant MEM_a19_3: ROM_a19_3:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
	
-------------------------------------------Signals----------------------------------------------
signal ampfunde : integer:=0;
signal amp1e : integer:=0;
signal amp2e : integer:=0;
signal amp3e : integer:=0;
signal amp4e : integer:=0;
signal amp5e : integer:=0;
signal amp6e : integer:=0;
signal amp7e : integer:=0;
signal amp8e : integer:=0;
signal amp9e : integer:=0;
signal amp10e : integer:=0;
signal amp11e : integer:=0;
signal amp12e : integer:=0;
signal amp13e : integer:=0;
signal amp14e : integer:=0;
signal amp15e : integer:=0;
signal amp16e : integer:=0;
signal amp17e : integer:=0;
signal amp18e : integer:=0;
signal amp19e : integer:=0;

signal ampfund : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp1 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp2 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp3 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp4 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp5 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp6 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp7 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp8 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp9 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp10 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp11 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp12 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp13 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp14 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp15 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp16 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp17 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp18 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
signal amp19 : STD_LOGIC_VECTOR (7 downto 0):= (others=>'0');
	
begin

Process (CLK)
begin
	if (CLK'event and CLK='1') then
		if
				-----------------------------------------------------OBOE-------------------------------------------------------------				
				(num_inst = "01") then

				ampfunde <= MEM_a_1(CONV_INTEGER(num_nota));
				ampfund <= conv_std_logic_vector(ampfunde,8);				
				
				amp1e <= MEM_a1_1(CONV_INTEGER(num_nota));				--	guardar en amp1e el valor que tenemos en la memoria
				amp1 <= conv_std_logic_vector(amp1e,8);					-- convertir el valor que tenemos en la memoria
				
				amp2e <= MEM_a2_1(CONV_INTEGER(num_nota));
				amp2 <= conv_std_logic_vector(amp2e,8);
				
				amp3e <= MEM_a3_1(CONV_INTEGER(num_nota));
				amp3 <= conv_std_logic_vector(amp3e,8);
				
				amp4e <= MEM_a4_1(CONV_INTEGER(num_nota));
				amp4 <= conv_std_logic_vector(amp4e,8);
				
				amp5e <= MEM_a5_1(CONV_INTEGER(num_nota));
				amp5 <= conv_std_logic_vector(amp5e,8);
				
				amp6e <= MEM_a6_1(CONV_INTEGER(num_nota));
				amp6 <= conv_std_logic_vector(amp6e,8);
				
				amp7e <= MEM_a7_1(CONV_INTEGER(num_nota));
				amp7 <= conv_std_logic_vector(amp7e,8);
				
				amp8e <= MEM_a8_1(CONV_INTEGER(num_nota));
				amp8 <= conv_std_logic_vector(amp8e,8);
				
				amp9e <= MEM_a9_1(CONV_INTEGER(num_nota));
				amp9 <= conv_std_logic_vector(amp9e,8);
				
				amp10e <= MEM_a10_1(CONV_INTEGER(num_nota));
				amp10 <= conv_std_logic_vector(amp10e,8);
				
				amp11e <= MEM_a11_1(CONV_INTEGER(num_nota));
				amp11 <= conv_std_logic_vector(amp11e,8);
				
				amp12e <= MEM_a12_1(CONV_INTEGER(num_nota));
				amp12 <= conv_std_logic_vector(amp12e,8);
				
				amp13e <= MEM_a13_1(CONV_INTEGER(num_nota));
				amp13 <= conv_std_logic_vector(amp13e,8);
				
				amp14e <= MEM_a14_1(CONV_INTEGER(num_nota));
				amp14 <= conv_std_logic_vector(amp14e,8);

				amp15e <= MEM_a15_1(CONV_INTEGER(num_nota));
				amp15 <= conv_std_logic_vector(amp15e,8);

				amp16e <= MEM_a16_1(CONV_INTEGER(num_nota));
				amp16 <= conv_std_logic_vector(amp16e,8);

				amp17e <= MEM_a17_1(CONV_INTEGER(num_nota));
				amp17 <= conv_std_logic_vector(amp17e,8);

				amp18e <= MEM_a18_1(CONV_INTEGER(num_nota));
				amp18 <= conv_std_logic_vector(amp18e,8);

				amp19e <= MEM_a19_1(CONV_INTEGER(num_nota));
				amp19 <= conv_std_logic_vector(amp19e,8);
				
				-----------------------------------------------------VIOLIN-----------------------------------------------------------
		elsif				
				(num_inst = "10") then
				
				ampfunde <= MEM_a_2(CONV_INTEGER(num_nota));
				ampfund <= conv_std_logic_vector(ampfunde,8);				
				
				amp1e <= MEM_a1_2(CONV_INTEGER(num_nota));				--	guardar en amp1e el valor que tenemos en la memoria
				amp1 <= conv_std_logic_vector(amp1e,8);					-- convertir el valor que tenemos en la memoria
				
				amp2e <= MEM_a2_2(CONV_INTEGER(num_nota));
				amp2 <= conv_std_logic_vector(amp2e,8);
				
				amp3e <= MEM_a3_2(CONV_INTEGER(num_nota));
				amp3 <= conv_std_logic_vector(amp3e,8);
				
				amp4e <= MEM_a4_2(CONV_INTEGER(num_nota));
				amp4 <= conv_std_logic_vector(amp4e,8);
				
				amp5e <= MEM_a5_2(CONV_INTEGER(num_nota));
				amp5 <= conv_std_logic_vector(amp5e,8);
				
				amp6e <= MEM_a6_2(CONV_INTEGER(num_nota));
				amp6 <= conv_std_logic_vector(amp6e,8);
				
				amp7e <= MEM_a7_2(CONV_INTEGER(num_nota));
				amp7 <= conv_std_logic_vector(amp7e,8);
				
				amp8e <= MEM_a8_2(CONV_INTEGER(num_nota));
				amp8 <= conv_std_logic_vector(amp8e,8);
				
				amp9e <= MEM_a9_2(CONV_INTEGER(num_nota));
				amp9 <= conv_std_logic_vector(amp9e,8);
				
				amp10e <= MEM_a10_2(CONV_INTEGER(num_nota));
				amp10 <= conv_std_logic_vector(amp10e,8);
				
				amp11e <= MEM_a11_2(CONV_INTEGER(num_nota));
				amp11 <= conv_std_logic_vector(amp11e,8);
				
				amp12e <= MEM_a12_2(CONV_INTEGER(num_nota));
				amp12 <= conv_std_logic_vector(amp12e,8);
				
				amp13e <= MEM_a13_2(CONV_INTEGER(num_nota));
				amp13 <= conv_std_logic_vector(amp13e,8);
				
				amp14e <= MEM_a14_2(CONV_INTEGER(num_nota));
				amp14 <= conv_std_logic_vector(amp14e,8);

				amp15e <= MEM_a15_2(CONV_INTEGER(num_nota));
				amp15 <= conv_std_logic_vector(amp15e,8);

				amp16e <= MEM_a16_2(CONV_INTEGER(num_nota));
				amp16 <= conv_std_logic_vector(amp16e,8);

				amp17e <= MEM_a17_2(CONV_INTEGER(num_nota));
				amp17 <= conv_std_logic_vector(amp17e,8);

				amp18e <= MEM_a18_2(CONV_INTEGER(num_nota));
				amp18 <= conv_std_logic_vector(amp18e,8);

				amp19e <= MEM_a19_2(CONV_INTEGER(num_nota));
				amp19 <= conv_std_logic_vector(amp19e,8);
				
		-----------------------------------------------------TUBA-----------------------------------------------------------
		elsif				
				(num_inst = "11") then			
				
				ampfunde <= MEM_a_3(CONV_INTEGER(num_nota));
				ampfund <= conv_std_logic_vector(ampfunde,8);				
				
				amp1e <= MEM_a1_3(CONV_INTEGER(num_nota));				--	guardar en amp1e el valor que tenemos en la memoria
				amp1 <= conv_std_logic_vector(amp1e,8);					-- convertir el valor que tenemos en la memoria
				
				amp2e <= MEM_a2_3(CONV_INTEGER(num_nota));
				amp2 <= conv_std_logic_vector(amp2e,8);
				
				amp3e <= MEM_a3_3(CONV_INTEGER(num_nota));
				amp3 <= conv_std_logic_vector(amp3e,8);
				
				amp4e <= MEM_a4_3(CONV_INTEGER(num_nota));
				amp4 <= conv_std_logic_vector(amp4e,8);
				
				amp5e <= MEM_a5_3(CONV_INTEGER(num_nota));
				amp5 <= conv_std_logic_vector(amp5e,8);
				
				amp6e <= MEM_a6_3(CONV_INTEGER(num_nota));
				amp6 <= conv_std_logic_vector(amp6e,8);
				
				amp7e <= MEM_a7_3(CONV_INTEGER(num_nota));
				amp7 <= conv_std_logic_vector(amp7e,8);
				
				amp8e <= MEM_a8_3(CONV_INTEGER(num_nota));
				amp8 <= conv_std_logic_vector(amp8e,8);
				
				amp9e <= MEM_a9_3(CONV_INTEGER(num_nota));
				amp9 <= conv_std_logic_vector(amp9e,8);
				
				amp10e <= MEM_a10_3(CONV_INTEGER(num_nota));
				amp10 <= conv_std_logic_vector(amp10e,8);
				
				amp11e <= MEM_a11_3(CONV_INTEGER(num_nota));
				amp11 <= conv_std_logic_vector(amp11e,8);
				
				amp12e <= MEM_a12_3(CONV_INTEGER(num_nota));
				amp12 <= conv_std_logic_vector(amp12e,8);
				
				amp13e <= MEM_a13_3(CONV_INTEGER(num_nota));
				amp13 <= conv_std_logic_vector(amp13e,8);
				
				amp14e <= MEM_a14_3(CONV_INTEGER(num_nota));
				amp14 <= conv_std_logic_vector(amp14e,8);

				amp15e <= MEM_a15_3(CONV_INTEGER(num_nota));
				amp15 <= conv_std_logic_vector(amp15e,8);

				amp16e <= MEM_a16_3(CONV_INTEGER(num_nota));
				amp16 <= conv_std_logic_vector(amp16e,8);

				amp17e <= MEM_a17_3(CONV_INTEGER(num_nota));
				amp17 <= conv_std_logic_vector(amp17e,8);

				amp18e <= MEM_a18_3(CONV_INTEGER(num_nota));
				amp18 <= conv_std_logic_vector(amp18e,8);

				amp19e <= MEM_a19_3(CONV_INTEGER(num_nota));
				amp19 <= conv_std_logic_vector(amp19e,8);
		
		end if;
	end if;
end Process;

af <= ampfund;
a1 <= amp1;
a2 <= amp2;
a3 <= amp3;
a4 <= amp4;
a5 <= amp5;
a6 <= amp6;
a7 <= amp7;
a8 <= amp8;
a9 <= amp9;
a10 <= amp10;
a11 <= amp11;
a12 <= amp12;
a13 <= amp13;
a14 <= amp14;
a15 <= amp15;
a16 <= amp16;
a17 <= amp17;
a18 <= amp18;
a19 <= amp19;

end Behavioral;

