《電子琴電路設(shè)計》由會員分享,可在線閱讀,更多相關(guān)《電子琴電路設(shè)計(5頁珍藏版)》請在裝配圖網(wǎng)上搜索。
1、單擊此處編輯母版標(biāo)題樣式,單擊此處編輯母版文本樣式,第二級,第三級,第四級,第五級,*,電子琴電路設(shè)計,鍵盤譯碼器,音調(diào)發(fā)生器,基準(zhǔn)時鐘發(fā)生器,(12,MHz),Tone,Speaker,U1,U2,Speaker,構(gòu)成,12分頻器,11位可,預(yù)置計數(shù)器,喇叭驅(qū)動,clk1,PreCLK,Tone1,FullSpks,spks,divide_,clk,:PROCESS(,clk1,),VARIABLE count4:INTEGER RANGE 0 TO 15;,BEGIN,preclk,11)THEN,preclk,=,1,;count4:=0;,ELSIF,clk1,EVENT AND,cl
2、k1,=,1,THEN count4:=count4+1;,END IF;,END PROCESS,divide_,clk,;,genspks,:PROCESS(,preclk,tone1,),VARIABLE count11:INTEGER RANGE 0 TO 16#7FF#;,BEGIN,IF,preclk,EVENT AND,preclk,=,1,THEN,IF(count11=16#7FF#)THEN count11:=tone1;,fellspks,=,1,;,ELSE count11:=count11+1;,fullspks,=,0,;,END IF;,END IF;,END P
3、ROCESS,genspks,;,delayspks,:PROCESS(,fullspks,),VARIABLE count2:STD_LOGIC;,BEGIN,IF,fullspks,EVENT AND,fullspks,=,1,THEN,count2:=NOT count2;,IF count2=,1,THEN,spks,=,1,;,ELSE,spks,=,0,;,END IF;,END IF;,END PROCESS,delayspks,;,LIBRARY IEEE;,USE IEEE.STD_LOGIC_1164.ALL;,ENTITY speaker IS,PORT(,tone1,:
4、IN INTEGER RANGE 0 TO 16#7FF#;,clk1,:IN STD_LOGIC;,spks,:OUT STD_LOGIC);,END speaker;,ARCHITECTURE one OF speaker IS,SIGNAL,preclk,fullspks,:STD_LOGIC;,BEGIN,divide_,clk,:PROCESS(,clk1,),VARIABLE count4:INTEGER RANGE 0 TO 15,BEGIN,preclk,11)THEN,preclk,=,1,;count4:=0;,ELSIF clk1,EVENT AND clk1=,1,TH
5、EN count4:=count4+1;,END IF;,END PROCESS,divide_,clk,;,genspks,:PROCESS(,preclk,tone1,),VARIABLE count11:INTEGER RANGE 0 TO 16#7FF#;,BEGIN,IF,preclk,EVENT AND,preclk,=,1,THEN,IF(count11=16#7FF#)THEN,count11:=,tone1,;,fullspks,=,1,;,ELSE count11:=count11+1;,fullspks,=,0,;,END IF;,END IF;,END PROCESS,
6、genspks,;,delayspks,:PROCESS(,fullspks,),VARIABLE count2:STD_LOGIC;,BEGIN,IF,fullspks,EVENT AND,fullspks,=,1,THEN count2:=NOT count2;,IF count2=,1,THEN,spks,=,1,;ELSE,spks,tone=773;code=,1,;high tone=912;code=,2,;high tone=1036;code=,3,;high tone=1116;code=,4,;high tone=1197;code=,5,;high tone=1290;code=,6,;high tone=1372;code=,7,;high tone=1410;code=,1,;high tone=2047;code=,0,;high,index1,tone=,tone2,code=,code1,high=,high1,);,U2:speaker PORT MAP(clk1=,clk12MHz,tone1=,tone2,spks,=,spkout,);,END one;,TOP,