




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;ENTITY fengping ISPORT(clk:IN STD_LOGIC;clk4hz:OUTSTD_LOGIC;clk1mhz:OUTSTD_LOGIC);END fengping;ARCHITECTURE ONE OF fengping ISsignal count:integer;signal count1:integer;beginprocess(clk)begin if(clkeve
2、nt and clk=1) then if(count1=12500000)thencount1=0; elsecount1=count1+1; if count16250000 then clk4hz=0; else clk4hz=1; end if; end if;end if;end process;process(clk)begin if(clkevent and clk=1) then if(count=50)thencount=0; elsecount=count+1; if count25 thenclk1mhz=0; elseclk1mhz=1; end if; end if;
3、end if;end process; end;library ieee;use ieee.std_logic_1164.all;entity notetabs isport( clk : in std_logic; toneindex : out integer range 0 to 15);end notetabs;architecture behav of notetabs issignal counter : integer range 0 to 138;begincnt8: process(clk,counter)beginif counter=138 then counter=0;
4、elsif clkevent and clk=1 then countertoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindexto
5、neindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextonei
6、ndextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneinde
7、xtoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindexto
8、neindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindextoneindexnull;end case;end process;end behav;library ieee;use ieee.std_logic_1164.all;entity speaker isport( clk : in std_logic; tone : in integer range 0 to 16#7ff#; -2047; spks : out std_logic);end speaker;architecture
9、behav of speaker issignal fullspks : std_logic;begingenspks : process(clk,tone) -clk=1MHZ;variable count11 : integer range 0 to 16#7ff#; -2047;beginif clkevent and clk=1 thenif count11=16#7ff# then -b111,1111,1111;count11:=tone;fullspks=1;else count11:=count11+1;fullspks=0;end if;end if;end process;
10、delay: process(fullspks) -fullspks=488.2815HZ;variable count2 : std_logic;beginif fullspksevent and fullspks=1 thencount2:=not count2;if count2=1 thenspks=1;elsespkstone=2047; codetone=773; codetone=912; codetone=1036; codetone=1197; codetone=1290; codetone=1372; codetone=1410; codetone=1480; codeto
11、ne=1542; codetone=1622; codetone=1668; codetone=1728; codenull;end case;end process;end behav;頻率計library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity testctl isport( clk : in std_logic; tsten : out std_logic; clr_cnt : out std_logic; load : out std_logic);end testctl;archi
12、tecture behav of testctl issignal div2clk : std_logic;beginprocess(clk)beginif(clkevent and clk=1) then div2clk=not div2clk;end if;end process;process(clk,div2clk)beginif(clk=0 and div2clk=0) thenclr_cnt=1;elseclr_cnt=0;end if;end process;load=not div2clk;tsten=div2clk;end behav; library ieee;use ie
13、ee.std_logic_1164.all;entity reg32b isport( load : in std_logic; din : in std_logic_vector(31 downto 0); dout :out std_logic_vector(31 downto 0);end reg32b;architecture behav of reg32b isbeginprocess(load,din)beginif(loadevent and load=1) thendout=din;end if;end process;end behav;library ieee;use ie
14、ee.std_logic_1164.all;entity cnt10 isport(clk: in std_logic; clr: in std_logic; ena: in std_logic; cq : out integer range 0 to 15; carry_out: out std_logic);end cnt10;architecture behav of cnt10 issignal cqi: integer range 0 to 15;beginprocess(clr,clk,ena)beginif(clr=1) then cqi=0;elsif(clkevent and
15、 clk=1) thenif(ena=1) thenif(cqi9) then cqi=cqi+1;else cqi=0;end if;end if;end if;end process;process(cqi)beginif(cqi=9) thencarry_out=1;elsecarry_out=0;end if;end process;cq=cqi;end behav;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity seltime isport( clk : in std_lo
16、gic; rst : in std_logic; din : in std_logic_vector(31 downto 0); daout: out std_logic_vector(3 downto 0); sel : out std_logic_vector(2 downto 0);end seltime;architecture behav of seltime issignal sec : std_logic_vector(2 downto 0);beginprocess(rst,clk)beginif(rst=0) thensec=000;elsif(clkevent and cl
17、k=1) then if(sec=111) then sec=000;else secdaoutdaoutdaoutdaoutdaoutdaoutdaoutdaoutdaout=XXXX;end case;end process;seldig_rdig_rdig_rdig_rdig_rdig_rdig_rdig_r=01111111;-選擇第八個數(shù)碼管顯示END CASE;END PROCESS;dig=dig_r;end one;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity di
18、v_f isport(clk :in std_logic; onehz_out :out std_logic; five_h_hz_out :out std_logic; one_h_khz_out :out std_logic; one_M_hz_out :out std_logic; five_M_hz_out:out std_logic; two_h_hz_out:out std_logic; fifty_hz_out:out std_logic; ten_hz_out:out std_logic; twnty_f_hz_out:out std_logic; zeros_one_hz_o
19、ut:out std_logic; one_h_hz_out:out std_logic; five_h_khz_out :out std_logic); end div_f;architecture behave of div_f isbegin p1:process(clk)variable cnt:integer range 0 to 24999999; -分頻系數(shù)為24999999variable ff:std_logic;beginif clkevent and clk=1 thenif cnt24999999 thencnt:=cnt+1;elsecnt:=0;ff:=not ff
20、; -反向end if;end if;onehz_out=ff;end process p1;p2:process(clk)variable cnn:integer range 0 to 49999; -分頻系數(shù)為12499999variable dd:std_logic;beginif clkevent and clk=1 thenif cnn49999 thencnn:=cnn+1;elsecnn:=0;dd:=not dd; -反向end if;end if;five_h_hz_out =dd;end process p2;p3:process(clk)variable cnn1:int
21、eger range 0 to 24999; -分頻系數(shù)為24999variable dd1:std_logic;beginif clkevent and clk=1 thenif cnn124999 thencnn1:=cnn1+1;elsecnn1:=0;dd1:=not dd1; -反向end if;end if;one_h_khz_out =dd1;end process p3;p4:process(clk)variable cnn2:integer range 0 to 24; -分頻系數(shù)為24variable dd2:std_logic;beginif clkevent and c
22、lk=1 thenif cnn224 thencnn2:=cnn2+1;elsecnn2:=0;dd2:=not dd2; -反向end if;end if;one_M_hz_out =dd2;end process p4;p5:process(clk)variable cnn3:integer range 0 to 4999; -分頻系數(shù)為499999variable dd3:std_logic;beginif clkevent and clk=1 thenif cnn34999 thencnn3:=cnn3+1;elsecnn3:=0;dd3:=not dd3; -反向end if;end
23、 if;five_h_khz_out =dd3;end process p5;p6:process(clk)variable cnn4:integer range 0 to 4; -分頻系數(shù)為5variable dd4:std_logic;beginif clkevent and clk=1 thenif cnn44 thencnn4:=cnn4+1;elsecnn4:=0;dd4:=not dd4; -反向end if;end if;five_M_hz_out =dd4;end process p6;p7:process(clk)variable cnn5:integer range 0 t
24、o 124999; -分頻系數(shù)為125000variable dd5:std_logic;beginif clkevent and clk=1 thenif cnn5124999 thencnn5:=cnn5+1;elsecnn5:=0;dd5:=not dd5; -反向end if;end if;two_h_hz_out =dd5;end process p7;p8:process(clk)variable cnn6:integer range 0 to 499999; -分頻系數(shù)為500000variable dd6:std_logic;beginif clkevent and clk=1 thenif cnn6499999 thencnn6:=cnn6+1;elsecnn6:=0;dd6:=not dd6; -反向end if;end if;fifty_hz_out =dd6;end process p8;p9:process(clk)variable cnn7:integer range 0 to 2499999; -分頻系數(shù)為500000variable dd7:std_logic;beginif clkevent and clk=1 thenif cnn
溫馨提示
- 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 南京大學(xué)金陵學(xué)院《商業(yè)大數(shù)據(jù)項目管理綜合實驗》2023-2024學(xué)年第二學(xué)期期末試卷
- 2025年物聯(lián)網(wǎng)是考試題及答案
- 2025年護(hù)心游戲測試題及答案
- 2025年金泉小學(xué)面試題及答案
- 2025年資展金融面試題及答案
- 2025年育嬰班結(jié)業(yè)考試題及答案
- 2025年五法普法考試試題及答案
- 醫(yī)生綜合復(fù)習(xí)試題附答案
- 2025年圖案簡筆畫考試題及答案
- 2025年教育資格面試試題及答案
- 名人介紹l梁啟超
- 幼兒繪本故事:波西和皮普大怪獸
- 譯林版五年級英語下冊 Unit 5 第2課時 教學(xué)課件PPT小學(xué)公開課
- 全套電子課件:混凝土結(jié)構(gòu)設(shè)計
- 數(shù)據(jù)結(jié)構(gòu)英文教學(xué)課件:chapter2 Array
- 新版PEP小學(xué)英語3-6年級單詞表(共14頁)
- 2022年城市軌道交通行車值班員三級考試題庫(附答案)
- 入門級新概念英語青少版A unit8
- 應(yīng)用隨機(jī)過程PPT課件
- 鋁合金門窗檢測資料
- 腫瘤學(xué)總論ppt課件
評論
0/150
提交評論