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

entity fase 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);
				f1 : out STD_LOGIC_VECTOR (8 downto 0);
				f2 : out STD_LOGIC_VECTOR (8 downto 0);
				f3 : out STD_LOGIC_VECTOR (8 downto 0);
				f4 : out STD_LOGIC_VECTOR (8 downto 0);
				f5 : out STD_LOGIC_VECTOR (8 downto 0);
				f6 : out STD_LOGIC_VECTOR (8 downto 0);
				f7 : out STD_LOGIC_VECTOR (8 downto 0);
				f8 : out STD_LOGIC_VECTOR (8 downto 0);
				f9 : out STD_LOGIC_VECTOR (8 downto 0);
				f10 : out STD_LOGIC_VECTOR (8 downto 0);
				f11 : out STD_LOGIC_VECTOR (8 downto 0);
				f12 : out STD_LOGIC_VECTOR (8 downto 0);
				f13 : out STD_LOGIC_VECTOR (8 downto 0);
				f14 : out STD_LOGIC_VECTOR (8 downto 0);
				f15 : out STD_LOGIC_VECTOR (8 downto 0);
				f16 : out STD_LOGIC_VECTOR (8 downto 0);
				f17 : out STD_LOGIC_VECTOR (8 downto 0);
				f18 : out STD_LOGIC_VECTOR (8 downto 0);
				f19 : out STD_LOGIC_VECTOR (8 downto 0)									
				);
end fase;

architecture Behavioral of fase is

--------------------------------------------ROMs-------------------------------------------------
------------- OBOE

	type ROMf1_1 is array (0 to 18) of integer;																				-- ROM fases del primer armonico del instrumento 1 (oboe) para cada frecuencia
	constant MEMf1_1: ROMf1_1:=(0,0,357,496,13,507,356,44,185,384,268,153,60,191,25,2,492,0,0);

	type ROMf2_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 2 inst1
	constant MEMf2_1: ROMf2_1:=(0,0,395,191,233,237,404,304,142,34,373,24,351,95,253,166,154,0,0);					

	type ROMf3_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 3 inst1
	constant MEMf3_1: ROMf3_1:=(0,0,347,319,402,368,444,67,83,175,351,350,181,248,504,113,162,0,0);				 		

	type ROMf4_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 4 inst1
	constant MEMf4_1: ROMf4_1:=(0,0,394,61,135,100,345,94,31,439,498,262,420,12,400,29,5,0,0);		
	
	type ROMf5_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 5 inst1
	constant MEMf5_1: ROMf5_1:=(0,0,376,240,473,118,264,236,438,174,204,330,121,368,462,225,128,0,0);	
									
	type ROMf6_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 6 inst1
	constant MEMf6_1: ROMf6_1:=(0,0,272,482,149,81,276,275,246,66,286,279,299,493,452,289,158,0,0);

	type ROMf7_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 7 inst1
	constant MEMf7_1: ROMf7_1:=(0,0,216,248,318,211,264,126,178,126,342,12,415,106,71,476,6,0,0);									

	type ROMf8_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 8 inst1
	constant MEMf8_1: ROMf8_1:=(0,0,468,73,435,51,418,320,484,242,58,197,97,452,237,413,135,0,0);

	type ROMf9_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 9 inst1
	constant MEMf9_1: ROMf9_1:=(0,0,474,271,260,237,498,100,265,110,40,85,263,239,301,438,277,0,0);

	type ROMf10_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 10 inst1
	constant MEMf10_1: ROMf10_1:=(0,0,499,478,30,483,352,267,159,298,418,250,391,494,386,108,286,0,0);

	type ROMf11_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 11 inst1
	constant MEMf11_1: ROMf11_1:=(0,0,97,129,149,125,332,79,477,21,485,6,63,129,286,136,280,0,0);

	type ROMf12_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 12 inst1
	constant MEMf12_1: ROMf12_1:=(0,0,84,301,340,291,79,326,356,79,7,242,312,414,316,333,167,0,0);

	type ROMf13_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 13 inst1
	constant MEMf13_1: ROMf13_1:=(0,0,41,472,482,483,98,22,445,30,334,451,287,188,175,509,102,0,0);

	type ROMf14_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 14 inst1
	constant MEMf14_1: ROMf14_1:=(0,0,30,126,435,362,472,202,25,89,360,67,48,39,220,476,66,0,0);

	type ROMf15_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 15 inst1
	constant MEMf15_1: ROMf15_1:=(0,0,21,310,121,23,33,353,53,391,434,167,130,7,434,420,375,0,0);						

	type ROMf16_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 16 inst1
	constant MEMf16_1: ROMf16_1:=(0,0,482,445,205,371,102,384,237,69,180,157,417,174,348,164,286,0,0);	
	
	type ROMf17_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 17 inst1
	constant MEMf17_1: ROMf17_1:=(0,0,403,69,414,227,308,424,274,278,433,339,85,116,329,141,0,0,0);	
									
	type ROMf18_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 18 inst1
	constant MEMf18_1: ROMf18_1:=(0,0,485,277,84,195,175,246,278,205,331,266,488,36,99,0,0,0,0);	
									
	type ROMf19_1 is array (0 to 18) of integer;																				-- ROM fases del armonico 19 inst1
	constant MEMf19_1: ROMf19_1:=(0,0,411,69,128,24,215,107,31,216,292,92,252,225,510,0,0,0,0);	

-------------VIOLIN

	type ROMf1_2 is array (0 to 18) of integer;																				
	constant MEMf1_2: ROMf1_2:=(0,0,307,130,195,348,388,404,407,130,401,383,399,137,388,114,120,0,0);

	type ROMf2_2 is array (0 to 18) of integer;																				
	constant MEMf2_2: ROMf2_2:=(0,0,422,498,29,384,342,292,360,509,241,427,208,55,187,227,187,0,0);					

	type ROMf3_2 is array (0 to 18) of integer;																				
	constant MEMf3_2: ROMf3_2:=(0,0,306,333,401,412,374,316,263,248,344,216,49,467,292,76,323,0,0);				 		

	type ROMf4_2 is array (0 to 18) of integer;																				
	constant MEMf4_2: ROMf4_2:=(0,0,510,433,231,130,413,405,33,136,147,96,289,44,451,26,40,0,0);		
	
	type ROMf5_2 is array (0 to 18) of integer;																				
	constant MEMf5_2: ROMf5_2:=(0,0,133,126,18,205,217,156,410,11,112,181,335,412,268,103,106,0,0);	
									
	type ROMf6_2 is array (0 to 18) of integer;																				
	constant MEMf6_2: ROMf6_2:=(0,0,279,491,105,246,234,87,99,339,386,132,177,198,284,289,37,0,0);

	type ROMf7_2 is array (0 to 18) of integer;																				
	constant MEMf7_2: ROMf7_2:=(0,0,452,210,194,349,35,235,507,461,84,316,459,142,314,102,89,0,0);									

	type ROMf8_2 is array (0 to 18) of integer;																				
	constant MEMf8_2: ROMf8_2:=(0,0,246,214,186,197,430,419,9,35,356,367,467,315,449,5,274,0,0);

	type ROMf9_2 is array (0 to 18) of integer;																				
	constant MEMf9_2: ROMf9_2:=(0,0,287,413,114,405,144,412,408,261,509,32,325,335,399,0,0,0,0);

	type ROMf10_2 is array (0 to 18) of integer;																				
	constant MEMf10_2: ROMf10_2:=(0,0,361,98,43,352,311,306,464,487,171,330,5,489,0,0,0,0,0);

	type ROMf11_2 is array (0 to 18) of integer;																				
	constant MEMf11_2: ROMf11_2:=(0,0,349,462,25,477,268,2,344,242,0,341,0,0,0,0,0,0,0);

	type ROMf12_2 is array (0 to 18) of integer;																				
	constant MEMf12_2: ROMf12_2:=(0,0,24,408,421,288,269,432,27,265,56,0,0,0,0,0,0,0,0);

	type ROMf13_2 is array (0 to 18) of integer;																				
	constant MEMf13_2: ROMf13_2:=(0,0,377,373,221,493,9,340,379,0,0,0,0,0,0,0,0,0,0);

	type ROMf14_2 is array (0 to 18) of integer;																				
	constant MEMf14_2: ROMf14_2:=(0,0,296,36,102,492,510,258,0,0,0,0,0,0,0,0,0,0,0);

	type ROMf15_2 is array (0 to 18) of integer;																				
	constant MEMf15_2: ROMf15_2:=(0,0,346,449,66,273,342,0,0,0,0,0,0,0,0,0,0,0,0);						

	type ROMf16_2 is array (0 to 18) of integer;																				
	constant MEMf16_2: ROMf16_2:=(0,0,450,204,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0);	
	
	type ROMf17_2 is array (0 to 18) of integer;																				
	constant MEMf17_2: ROMf17_2:=(0,0,390,348,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0);	
									
	type ROMf18_2 is array (0 to 18) of integer;																				
	constant MEMf18_2: ROMf18_2:=(0,0,108,236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);	
									
	type ROMf19_2 is array (0 to 18) of integer;																				
	constant MEMf19_2: ROMf19_2:=(0,0,292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);	
	
	------------- TUBA		

	type ROMf1_3 is array (0 to 18) of integer;																				
	constant MEMf1_3: ROMf1_3:=(0,0,319,324,78,442,439,449,443,114,415,413,94,400,114,125,376,0,0);

	type ROMf2_3 is array (0 to 18) of integer;																				
	constant MEMf2_3: ROMf2_3:=(0,0,25,65,114,368,385,383,331,113,302,291,199,277,186,133,52,0,0);					

	type ROMf3_3 is array (0 to 18) of integer;																				
	constant MEMf3_3: ROMf3_3:=(0,0,285,412,220,311,325,304,217,136,141,81,135,19,148,36,486,0,0);				 		

	type ROMf4_3 is array (0 to 18) of integer;																				
	constant MEMf4_3: ROMf4_3:=(0,0,26,103,103,428,295,183,22,133,110,358,108,330,129,446,161,0,0);		
	
	type ROMf5_3 is array (0 to 18) of integer;																				
	constant MEMf5_3: ROMf5_3:=(0,0,378,395,117,422,208,181,448,143,131,169,102,94,220,337,355,0,0);	
									
	type ROMf6_3 is array (0 to 18) of integer;																				
	constant MEMf6_3: ROMf6_3:=(0,0,452,270,193,321,431,355,354,283,62,345,53,41,424,511,302,0,0);

	type ROMf7_3 is array (0 to 18) of integer;																				
	constant MEMf7_3: ROMf7_3:=(0,0,184,311,29,411,412,281,192,304,418,169,207,263,80,292,99,0,0);									

	type ROMf8_3 is array (0 to 18) of integer;																				
	constant MEMf8_3: ROMf8_3:=(0,0,247,184,202,49,243,203,22,309,310,472,126,243,60,404,320,0,0);
 
	type ROMf9_3 is array (0 to 18) of integer;																				
	constant MEMf9_3: ROMf9_3:=(0,0,142,340,204,504,153,105,416,352,226,309,272,206,329,286,441,0,0);

	type ROMf10_3 is array (0 to 18) of integer;																				
	constant MEMf10_3: ROMf10_3:=(0,0,442,137,183,381,74,85,344,319,119,171,485,102,495,421,382,0,0);

	type ROMf11_3 is array (0 to 18) of integer;																				
	constant MEMf11_3: ROMf11_3:=(0,0,161,401,282,286,59,376,79,472,76,20,249,46,38,193,51,0,0);

	type ROMf12_3 is array (0 to 18) of integer;																				
	constant MEMf12_3: ROMf12_3:=(0,0,385,184,297,314,87,359,470,50,465,400,310,34,0,429,488,0,0);

	type ROMf13_3 is array (0 to 18) of integer;																				
	constant MEMf13_3: ROMf13_3:=(0,0,102,11,264,223,295,382,278,285,503,19,252,60,184,301,10,0,0);

	type ROMf14_3 is array (0 to 18) of integer;																				
	constant MEMf14_3: ROMf14_3:=(0,0,420,183,375,95,252,236,142,275,164,21,288,98,343,137,495,0,0);

	type ROMf15_3 is array (0 to 18) of integer;																				
	constant MEMf15_3: ROMf15_3:=(0,0,438,125,466,509,221,466,466,288,470,424,291,495,408,338,13,0,0);						

	type ROMf16_3 is array (0 to 18) of integer;																				
	constant MEMf16_3: ROMf16_3:=(0,0,41,415,413,466,280,410,202,335,3,482,264,507,309,340,436,0,0);	
	
	type ROMf17_3 is array (0 to 18) of integer;																				
	constant MEMf17_3: ROMf17_3:=(0,0,348,91,489,417,242,143,79,330,352,152,487,382,95,322,276,0,0);	
									
	type ROMf18_3 is array (0 to 18) of integer;																				
	constant MEMf18_3: ROMf18_3:=(0,0,391,173,133,140,127,132,495,341,214,380,140,507,214,156,188,0,0);	
									
	type ROMf19_3 is array (0 to 18) of integer;																				
	constant MEMf19_3: ROMf19_3:=(0,0,460,271,45,200,11,36,217,406,213,254,305,433,169,319,1,0,0);	
	
-------------------------------------------Signals----------------------------------------------
signal fasefe : integer:=0;
signal fase1e : integer:=0;
signal fase2e : integer:=0;
signal fase3e : integer:=0;
signal fase4e : integer:=0;
signal fase5e : integer:=0;
signal fase6e : integer:=0;
signal fase7e : integer:=0;
signal fase8e : integer:=0;
signal fase9e : integer:=0;
signal fase10e : integer:=0;
signal fase11e : integer:=0;
signal fase12e : integer:=0;
signal fase13e : integer:=0;
signal fase14e : integer:=0;
signal fase15e : integer:=0;
signal fase16e : integer:=0;
signal fase17e : integer:=0;
signal fase18e : integer:=0;
signal fase19e : integer:=0;

signal fase1 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase2 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase3 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase4 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase5 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase6 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase7 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase8 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase9 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase10 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase11 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase12 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase13 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase14 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase15 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase16 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase17 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase18 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');
signal fase19 : STD_LOGIC_VECTOR (8 downto 0):= (others=>'0');

begin

Process (CLK)
begin
	if (CLK'event and CLK='1') then
		if	
				-----------------------------------------------------OBOE-------------------------------------------------------------
				
				(num_inst = "01") then		
				
				fase1e <= MEMf1_1(CONV_INTEGER(num_nota));				--	guardar en fase1e el valor que tenemos en la memoria
				fase1 <= conv_std_logic_vector(fase1e,9);					-- convertir el valor que tenemos en la memoria
				
				fase2e <= MEMf2_1(CONV_INTEGER(num_nota));
				fase2 <= conv_std_logic_vector(fase2e,9);
				
				fase3e <= MEMf3_1(CONV_INTEGER(num_nota)); 
				fase3 <= conv_std_logic_vector(fase3e,9);
				
				fase4e <= MEMf4_1(CONV_INTEGER(num_nota));
				fase4 <= conv_std_logic_vector(fase4e,9);
				
				fase5e <= MEMf5_1(CONV_INTEGER(num_nota));
				fase5 <= conv_std_logic_vector(fase5e,9);
				
				fase6e <= MEMf6_1(CONV_INTEGER(num_nota));
				fase6 <= conv_std_logic_vector(fase6e,9);
				
				fase7e <= MEMf7_1(CONV_INTEGER(num_nota));
				fase7 <= conv_std_logic_vector(fase7e,9);
				
				fase8e <= MEMf8_1(CONV_INTEGER(num_nota));
				fase8 <= conv_std_logic_vector(fase8e,9);
				
				fase9e <= MEMf9_1(CONV_INTEGER(num_nota));
				fase9 <= conv_std_logic_vector(fase9e,9);
				
				fase10e <= MEMf10_1(CONV_INTEGER(num_nota));
				fase10 <= conv_std_logic_vector(fase10e,9);
				
				fase11e <= MEMf11_1(CONV_INTEGER(num_nota));
				fase11 <= conv_std_logic_vector(fase11e,9);
				
				fase12e <= MEMf12_1(CONV_INTEGER(num_nota));
				fase12 <= conv_std_logic_vector(fase12e,9);
				
				fase13e <= MEMf13_1(CONV_INTEGER(num_nota));
				fase13 <= conv_std_logic_vector(fase13e,9);
				
				fase14e <= MEMf14_1(CONV_INTEGER(num_nota));
				fase14 <= conv_std_logic_vector(fase14e,9);

				fase15e <= MEMf15_1(CONV_INTEGER(num_nota));
				fase15 <= conv_std_logic_vector(fase15e,9);

				fase16e <= MEMf16_1(CONV_INTEGER(num_nota));
				fase16 <= conv_std_logic_vector(fase16e,9);

				fase17e <= MEMf17_1(CONV_INTEGER(num_nota));
				fase17 <= conv_std_logic_vector(fase17e,9);

				fase18e <= MEMf18_1(CONV_INTEGER(num_nota));
				fase18 <= conv_std_logic_vector(fase18e,9);

				fase19e <= MEMf19_1(CONV_INTEGER(num_nota));
				fase19 <= conv_std_logic_vector(fase19e,9);
				
				
				-----------------------------------------------------VIOLIN-----------------------------------------------------------
		elsif				
				(num_inst = "10") then		
				
				fase1e <= MEMf1_2(CONV_INTEGER(num_nota));				--	guardar en fase1e el valor que tenemos en la memoria
				fase1 <= conv_std_logic_vector(fase1e,9);					-- convertir el valor que tenemos en la memoria
				
				fase2e <= MEMf2_2(CONV_INTEGER(num_nota));
				fase2 <= conv_std_logic_vector(fase2e,9);
				
				fase3e <= MEMf3_2(CONV_INTEGER(num_nota)); 
				fase3 <= conv_std_logic_vector(fase3e,9);
				
				fase4e <= MEMf4_2(CONV_INTEGER(num_nota));
				fase4 <= conv_std_logic_vector(fase4e,9);
				
				fase5e <= MEMf5_2(CONV_INTEGER(num_nota));
				fase5 <= conv_std_logic_vector(fase5e,9);
				
				fase6e <= MEMf6_2(CONV_INTEGER(num_nota));
				fase6 <= conv_std_logic_vector(fase6e,9);
				
				fase7e <= MEMf7_2(CONV_INTEGER(num_nota));
				fase7 <= conv_std_logic_vector(fase7e,9);
				
				fase8e <= MEMf8_2(CONV_INTEGER(num_nota));
				fase8 <= conv_std_logic_vector(fase8e,9);
				
				fase9e <= MEMf9_2(CONV_INTEGER(num_nota));
				fase9 <= conv_std_logic_vector(fase9e,9);
				
				fase10e <= MEMf10_2(CONV_INTEGER(num_nota));
				fase10 <= conv_std_logic_vector(fase10e,9);
				
				fase11e <= MEMf11_2(CONV_INTEGER(num_nota));
				fase11 <= conv_std_logic_vector(fase11e,9);
				
				fase12e <= MEMf12_2(CONV_INTEGER(num_nota));
				fase12 <= conv_std_logic_vector(fase12e,9);
				
				fase13e <= MEMf13_2(CONV_INTEGER(num_nota));
				fase13 <= conv_std_logic_vector(fase13e,9);
				
				fase14e <= MEMf14_2(CONV_INTEGER(num_nota));
				fase14 <= conv_std_logic_vector(fase14e,9);

				fase15e <= MEMf15_2(CONV_INTEGER(num_nota));
				fase15 <= conv_std_logic_vector(fase15e,9);

				fase16e <= MEMf16_2(CONV_INTEGER(num_nota));
				fase16 <= conv_std_logic_vector(fase16e,9);

				fase17e <= MEMf17_2(CONV_INTEGER(num_nota));
				fase17 <= conv_std_logic_vector(fase17e,9);

				fase18e <= MEMf18_2(CONV_INTEGER(num_nota));
				fase18 <= conv_std_logic_vector(fase18e,9);

				fase19e <= MEMf19_2(CONV_INTEGER(num_nota));
				fase19 <= conv_std_logic_vector(fase19e,9);
				
		-----------------------------------------------------TUBA-----------------------------------------------------------
		elsif				
				(num_inst = "11") then
				
				fase1e <= MEMf1_3(CONV_INTEGER(num_nota));				--	guardar en fase1e el valor que tenemos en la memoria
				fase1 <= conv_std_logic_vector(fase1e,9);					-- convertir el valor que tenemos en la memoria
				
				fase2e <= MEMf2_3(CONV_INTEGER(num_nota));
				fase2 <= conv_std_logic_vector(fase2e,9);
				
				fase3e <= MEMf3_3(CONV_INTEGER(num_nota)); 
				fase3 <= conv_std_logic_vector(fase3e,9);
				
				fase4e <= MEMf4_3(CONV_INTEGER(num_nota));
				fase4 <= conv_std_logic_vector(fase4e,9);
				
				fase5e <= MEMf5_3(CONV_INTEGER(num_nota));
				fase5 <= conv_std_logic_vector(fase5e,9);
				
				fase6e <= MEMf6_3(CONV_INTEGER(num_nota));
				fase6 <= conv_std_logic_vector(fase6e,9);
				
				fase7e <= MEMf7_3(CONV_INTEGER(num_nota));
				fase7 <= conv_std_logic_vector(fase7e,9);
				
				fase8e <= MEMf8_3(CONV_INTEGER(num_nota));
				fase8 <= conv_std_logic_vector(fase8e,9);
				
				fase9e <= MEMf9_3(CONV_INTEGER(num_nota));
				fase9 <= conv_std_logic_vector(fase9e,9);
				
				fase10e <= MEMf10_3(CONV_INTEGER(num_nota));
				fase10 <= conv_std_logic_vector(fase10e,9);
				
				fase11e <= MEMf11_3(CONV_INTEGER(num_nota));
				fase11 <= conv_std_logic_vector(fase11e,9);
				
				fase12e <= MEMf12_3(CONV_INTEGER(num_nota));
				fase12 <= conv_std_logic_vector(fase12e,9);
				
				fase13e <= MEMf13_3(CONV_INTEGER(num_nota));
				fase13 <= conv_std_logic_vector(fase13e,9);
				
				fase14e <= MEMf14_3(CONV_INTEGER(num_nota));
				fase14 <= conv_std_logic_vector(fase14e,9);

				fase15e <= MEMf15_3(CONV_INTEGER(num_nota));
				fase15 <= conv_std_logic_vector(fase15e,9);

				fase16e <= MEMf16_3(CONV_INTEGER(num_nota));
				fase16 <= conv_std_logic_vector(fase16e,9);

				fase17e <= MEMf17_3(CONV_INTEGER(num_nota));
				fase17 <= conv_std_logic_vector(fase17e,9);

				fase18e <= MEMf18_3(CONV_INTEGER(num_nota));
				fase18 <= conv_std_logic_vector(fase18e,9);

				fase19e <= MEMf19_3(CONV_INTEGER(num_nota));
				fase19 <= conv_std_logic_vector(fase19e,9);
				
		end if;
	end if;
end Process;

f1 <= fase1;
f2 <= fase2;
f3 <= fase3;
f4 <= fase4;
f5 <= fase5;
f6 <= fase6;
f7 <= fase7;
f8 <= fase8;
f9 <= fase9;
f10 <= fase10;
f11 <= fase11;
f12 <= fase12;
f13 <= fase13;
f14 <= fase14;
f15 <= fase15;
f16 <= fase16;
f17 <= fase17;
f18 <= fase18;
f19 <= fase19;

end Behavioral;

