第三部, 在QuartusII下,點擊選取New/Memory/Hexadecimal(Intel-Fomat)File,如下圖建立波形文件。

點擊Ok后在新界面窗口輸入必行點數(shù)Number,如64,128,256,512,1024…
位寬選8位,或更多。一般選8位。

出現(xiàn)hex1.hex如圖,

在填入數(shù)據(jù)后保存為與項目名稱相同的.hex文件,如sindata.hex,數(shù)據(jù)填入先打開第一步產(chǎn)生的后綴為.mif的文件如圖:

用鼠標全選復(fù)制粘貼到.hex文件中,保存。關(guān)閉mif文件。
第四部:選擇Tools如圖




直接下一步next
Finsh后就生成了一個sinxdata的波形數(shù)據(jù)項目文件,綜合后就可元件化使用。
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.std_logic_unsigned.all;
Entity sinx is
Port(clk:in std_logic;
Q:out std_logic_vector(7 downto 0));
end;
Architecture ss of sinx is
signal qq:std_logic_vector(9 downto 0);
component sinxdata IS --調(diào)用剛生成的波形數(shù)據(jù)文件。
PORT ( address : IN STD_LOGIC_VECTOR (9 DOWNTO 0);
clock : IN STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) );
end component;
begin
process(clk)
begin
if clk'event and clk='1' then
qq<=qq+1;
end if;
end process;
U:sinxdata port map(qq,clk,q);
end;