版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、實驗十五 電子琴設(shè)計一、 音名與頻率的關(guān)系:音樂上的十二平均律規(guī)定:每兩個八度音之間的頻率相差一倍。在這兩個八度音之間,分成十二個半音,每兩個相鄰伴音的頻率比為122。另外還規(guī)定,音名A的頻率為440Hz。音名B到C、E到F之間為半音,其余為全音。這樣,可計算得從A(簡譜的低音6)到a1(簡譜的高音6)之間每個音名的頻率為:A(6):440Hza(6):880Hza1(6):1760HzB(7):493.88Hzb(7):987.76Hzc(1):523.25Hzc1(1):1046.50Hz d(2):587.33Hzd1(2):1174.66Hze(3):659.25Hze1(3):131
2、8.51Hzf(4):698.46Hzf1(4):1396.92Hzg(5):783.99Hzg1(5):1567.98Hz二、設(shè)計要求:設(shè)計一個電子琴,要求能演奏音名A到a1之間的全部音階。按下一個鍵,則演奏該音名,并用數(shù)碼管顯示音名,用發(fā)光二極管指示高、中、低音。三、設(shè)計提示:本實驗由鍵盤編碼,音頻輸出譯碼器、分頻器組成。取10MHz信號作為基準(zhǔn)。以基準(zhǔn)頻率除以上述頻率,可得各音名頻率的分頻系數(shù)。注意,為了減少輸出的偶次諧波成分,最后輸出應(yīng)為對稱方波。音頻輸出譯碼器實質(zhì)上是一個多路選擇器,根據(jù)鍵盤編碼的輸出,選擇音階發(fā)生器的不同的預(yù)置數(shù),分頻后輸出音頻。分頻器可以為加法計數(shù)器,以可以為減法
3、計數(shù)器,計算預(yù)置數(shù)時稍有不同,應(yīng)加以注意。另外,應(yīng)根據(jù)基準(zhǔn)頻率和輸出頻率,來確定計數(shù)器的位數(shù)。設(shè)計框圖如下圖所示:按鍵編碼預(yù)置數(shù)選擇可預(yù)置計數(shù)器T觸發(fā)器(二分頻)掃描時鐘按鍵輸入鍵碼10MHz時鐘音頻輸出預(yù)置數(shù)譯碼器顯示輸出電子琴框圖四、實驗步驟1、啟動ISE集成開發(fā)環(huán)境,創(chuàng)建工程并輸入設(shè)計源文件。2、對設(shè)計進(jìn)行時序仿真,分析設(shè)計的正確性。3、鎖定引腳,完成設(shè)計實現(xiàn)過程。并在實驗箱上連線,利用iMPACT進(jìn)行程序下載。4、在實驗箱上驗證電子琴的功能,觀察并記錄實驗結(jié)果.五、實驗報告1.music的VHDL 源程序:library ieee;use ieee.std_logic_1164.all
4、;entity music isport(kin: std_logic_vector(0 to 15); spk_out: out std_logic; led_out: out std_logic_vector(6 downto 0); index: out std_logic_vector(2 downto 0); clk: in std_logic);end music;architecture stru of music iscomponent tonetab port( index : in INTEGER range 0 to 15; tone : out INTEGER rang
5、e 0 to 16#3fff#; code : out INTEGER range 0 to 15; high : out STD_LOGIC_VECTOR(2 DOWNTO 0) );end component;component tonegen port( clk : in STD_LOGIC; tone : in integer range 0 to 16#3fff#; spks : out STD_LOGIC );end component;component hex2led port( hex : in integer range 0 to 15; led : out STD_LOG
6、IC_VECTOR(6 downto 0) );end component;component keybord port( kin : in STD_LOGIC_VECTOR(0 to 15);kout : out INTEGER range 0 to 15 );end component;signal kout: integer range 0 to 15;signal tone: INTEGER range 0 to 16#3fff#;signal digit: integer range 0 to 15;begin u1: keybord port map (kin=kin,kout=k
7、out); u2: tonetab port map (index=kout,tone=tone,code=digit,high=index); u3: tonegen port map (clk=clk,tone=tone,spks=spk_out); u4: hex2led port map (hex=digit,led=led_out);end stru;2. hex2led的VHDL 源程序 library IEEE;use IEEE.STD_LOGIC_1164.all;entity hex2led is port( hex : in integer range 0 to 15; l
8、ed : out STD_LOGIC_VECTOR(6 downto 0) );end hex2led;architecture rtl of hex2led issignal data : std_logic_vector(6 downto 0);beginled=not data; with hex select data= 1111001 when 1, -1 0100100 when 2, -2 0110000 when 3, -3 0011001 when 4, -4 0010010 when 5, -5 0000010 when 6, -6 1111000 when 7, -7 0
9、000000 when 8, -8 0010000 when 9, -9 0001000 when 10, -A 0000011 when 11, -b 1000110 when 12, -C 0100001 when 13, -d 0000110 when 14, -E 0001110 when 15, -F 1000000 when others; -0end rtl;3. keybord 的VHDL 源程序 library IEEE;use IEEE.STD_LOGIC_1164.all;entity keybord is port( kin : in STD_LOGIC_VECTOR(
10、0 to 15);kout : out INTEGER range 0 to 15 );end keybord;architecture rtl of keybord issignal data:std_logic_vector(0 to 15);begindata=kin;process(data)beginif data(0)=0 then kout=0;elsif data(1)=0 then kout=1;elsif data(2)=0 then kout=2;elsif data(3)=0 then kout=3;elsif data(4)=0 then kout=4;elsif d
11、ata(5)=0 then kout=5;elsif data(6)=0 then kout=6;elsif data(7)=0 then kout=7;elsif data(8)=0 then kout=8;elsif data(9)=0 then kout=9;elsif data(10)=0 then kout=10;elsif data(11)=0 then kout=11;elsif data(12)=0 then kout=12;elsif data(13)=0 then kout=13;elsif data(14)=0 then kout=14;elsif data(15)=0
12、then kout=15;else NULL;end if;end process;end rtl;4. tonegen的VHDL源程序 library IEEE;use IEEE.STD_LOGIC_1164.all;entity tonegen is port( clk : in STD_LOGIC; tone : in integer range 0 to 16#3fff#; spks : out STD_LOGIC );end tonegen;architecture rtl of tonegen issignal fullspks:std_logic;begingenspks:pro
13、cess(clk,tone)variable count14: integer range 0 to 16#3fff#;-std_logic_vector(0 to 13);beginif clkevent and clk=1 thenif count14=16#3fff# then -111111111111111 thencount14:=tone;fullspks=1;elsecount14:=count14+1;fullspks=0;end if;end if;end process;delayspks:process(fullspks)variable count2:std_logi
14、c;beginif fullspksevent and fullspks=1 thencount2:=not count2;end if;spkstone=5021;code=6;hightone=6262;code=7;hightone=6829;code=1;hightone=7872;code=2;hightone=8801;code=3;hightone=9226;code=4;hightone=10007;code=5;hightone=10703;code=6;hightone=11323;code=7;hightone=11607;code=1;hightone=12129;co
15、de=2;hightone=12593;code=3;hightone=12805;code=4;hightone=13196;code=5;hightone=13544;code=6;hightone=16383;code=0;highNULL;end case;end process;end rtl;實驗記錄:1、 設(shè)計記錄表,記錄引腳鎖定與連線情況。ISE軟件實驗箱端口名稱芯片引腳號IO類型編號clkB4InputIO1indexF9OutputIO13indexE9OutputIO14indexD11OutputIO15kinA4InputIO2kinD5InputIO3kinC5InputIO4kinA6InputIO5kinB6InputIO6kinE7InputIO7kinF7InputIO8kinD7InputIO9kinC7InputIO10kinF8InputIO11kinE8InputIO12kinA13InputIO21kinB13InputIO22kinA14InputIO23kinB14InputIO24kinC14InputIO25led_outC11OutputIO16led_outF11OutputIO17
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年詳細(xì)版農(nóng)家樂投資經(jīng)營合同
- 家政服務(wù)培訓(xùn)擦玻璃課件
- 家政收納員培訓(xùn)課件
- 安全培訓(xùn)證書含金量課件
- 《動畫場景設(shè)計(第二版)》課件 第一單元 動畫場景概述
- 培訓(xùn)討論議題
- 培訓(xùn)演講教學(xué)課件
- 汽車性能與檢測技術(shù) 課件 項目二 汽車底盤性能檢測
- 今冬明春安全培訓(xùn)會課件
- 務(wù)實求效培訓(xùn)課件模板
- DBJ-T 15-30-2022 鋁合金門窗工程技術(shù)規(guī)范
- 2024屆廣東省高三三校12月聯(lián)考英語試題及答案
- 城市設(shè)計編制標(biāo)準(zhǔn) DG-TJ08-2402-2022
- 粉煤灰在高速公路基層中的應(yīng)用
- 教學(xué)設(shè)計中的學(xué)科整合與跨學(xué)科學(xué)習(xí)
- 2024年廣東省粵科金融集團(tuán)有限公司招聘筆試參考題庫含答案解析
- 消防設(shè)施維保投標(biāo)方案(技術(shù)方案)
- 設(shè)備綜合效率OEE統(tǒng)計表(使用)
- WATERS公司的UPLCTQD培訓(xùn)資料MS7校正課件
- 【超星爾雅學(xué)習(xí)通】航空與航天網(wǎng)課章節(jié)答案
- 2022年福州大學(xué)計算機(jī)科學(xué)與技術(shù)專業(yè)《操作系統(tǒng)》科目期末試卷B(有答案)
評論
0/150
提交評論