




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、VHDL數(shù)字秒表設(shè)計(jì) 專 業(yè): 自動(dòng)化 班級(jí)學(xué)號(hào): 5090629 姓 名: 劉丹 2011年 6 月14 日VHDL語言課程設(shè)計(jì)-秒表設(shè)計(jì)一、設(shè)計(jì)實(shí)驗(yàn)?zāi)康模涸贛AX+plusII軟件平臺(tái)上,熟練運(yùn)用VHDL語言,完成數(shù)字時(shí)鐘設(shè)計(jì)的軟件編程、編譯、綜合、仿真,使用EDA實(shí)驗(yàn)箱,實(shí)現(xiàn)數(shù)字秒表的硬件功能。二、設(shè)計(jì)實(shí)驗(yàn)說明及要求:1、數(shù)字秒表主要由:分頻器、掃描顯示譯碼器、一百進(jìn)制計(jì)數(shù)器、六十進(jìn)制計(jì)數(shù)器(或十進(jìn)制計(jì)數(shù)器與6進(jìn)制計(jì)數(shù)器)、十二進(jìn)制計(jì)數(shù)器(或二十四進(jìn)制計(jì)數(shù)器)電路組成。在整個(gè)秒表中最關(guān)鍵的是如何獲得一個(gè)精確的100HZ計(jì)時(shí)脈沖,除此之外,數(shù)字秒表需有清零控制端,以及啟動(dòng)控制端、保持保持,
2、以便數(shù)字時(shí)鐘能隨意停止及啟動(dòng)。2、數(shù)字秒表顯示由時(shí)(12或24進(jìn)制任選)、分(60進(jìn)制)、秒(60進(jìn)制)、百分之一秒(一百進(jìn)制)組成,利用掃描顯示譯碼電路在八個(gè)數(shù)碼管顯示。3、能夠完成清零、啟動(dòng)、保持(可以使用鍵盤或撥碼開關(guān)置數(shù))功能。4、時(shí)、分、秒、百分之一秒顯示準(zhǔn)確。三、我的設(shè)計(jì)思路: 1、四個(gè)十進(jìn)制計(jì)數(shù)器:用來分別對(duì)百分之一秒、十分之秒、秒和分進(jìn)行計(jì)數(shù); 2、兩個(gè)6進(jìn)制計(jì)數(shù)器:用來分別對(duì)十秒和十分進(jìn)行計(jì)數(shù);3、一個(gè)24進(jìn)制計(jì)數(shù)器,用來對(duì)小時(shí)進(jìn)行計(jì)數(shù); 3、分頻率器:用來產(chǎn)生100H
3、z的計(jì)數(shù)脈沖; 4、顯示譯碼器:完成對(duì)顯示譯碼的控制。四、設(shè)計(jì)過程:1.分頻器:由10MHz變?yōu)?00Hz,10MHz的周期是10的(-7)次方,而100Hz的周期是10的(-2)次方,而且方波是高低相間,只有高電平有效,所以100Hz的周期需要取一半,即0.02秒,這樣算出的分頻倍數(shù)就是50000分頻器代碼:將10MHz脈沖變成100Hz程序:library ieee;use ieee.std_logic_1164.all;entity fenpin is port(clr,clk: in bit;q: buffer bit);end fenpi
4、n;architecture a of fenpin is signal counter:integer range 0 to 49999;begin process(clr,clk) begin if (clk='1' and clk'event) then if clr='1' then
5、60; counter<=0; elsif counter=49999 then counter<=0; q<= not q; else
6、60; counter<=counter+1; end if; end if; end process;end a;分頻器的仿真圖:2.十進(jìn)制計(jì)數(shù)器:原理為加法計(jì)數(shù)器,從0加到9,計(jì)到10個(gè)數(shù)時(shí)由cout進(jìn)位程序:library ieee; use ieee.std_l
7、ogic_1164.all;use ieee.std_logic_unsigned.all;entity c10 is port(clr,start,clk: in bit; cout: out bit; daout: out std_logic_vector(3 downto 0);end c10;,architecture a of c10 is signal temp:std_l
8、ogic_vector(3 downto 0);begindaout<=temp; process(clk,clr) begin if clr='1' then temp<="0000"
9、0; cout<='0' elsif (clk'event and clk='1') then if start='1' then
10、0; if temp>="1001" then temp<="0000"
11、; cout<='1' else temp<=temp+1;
12、60; cout<='0' end if;
13、160; end if; end if; end process;end a;十進(jìn)制計(jì)數(shù)器仿真圖:3.六進(jìn)制計(jì)數(shù)器:原理為加法計(jì)數(shù)器,從0 加到5計(jì)到第六個(gè)數(shù)時(shí)由cout進(jìn)位。程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity c6 is port(cl
14、r,start,clk: in bit; daout: out std_logic_vector(3 downto 0); cout: out std_logic);end c6;architecture a of c6 is signal temp:std_logic_vector(3 downto 0);begindaout<=temp;
15、; process(clk,clr) begin if clr='1' then temp<="0000" cout<='0'
16、 elsif (clk'event and clk='1') then if start='1' then if temp>="0101" then
17、 temp<="0000" cout<='1' else
18、160; temp<=temp+1; cout<='0'
19、; end if; end if; end if; end process; end a;6進(jìn)制計(jì)數(shù)器仿真圖:4、二十四進(jìn)制計(jì)數(shù)器采用一個(gè)二進(jìn)制的計(jì)數(shù)器和一個(gè)四進(jìn)制的計(jì)數(shù)器相結(jié)合到一起,低位從0到9,到9向高位進(jìn)一,當(dāng)?shù)臀挥?jì)到四,高位計(jì)到2,進(jìn)行進(jìn)位輸出,即每二十四個(gè)數(shù)進(jìn)行一次進(jìn)位輸
20、出library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity c24 isport(clr,start,clk:in std_logic;hour1,hour0:out std_logic_vector(3 downto 0);end c24;architecture a of c24 isbegin process(clr,clk)variable cnt1,cnt0:std_logic_vector(3 downto 0);beginif clr='1' then cnt0:
21、="0000" cnt1:="0000"elsif clk'event and clk='1' thenif start='1' thenif cnt1="0010" and cnt0="0011"then cnt1:="0000"cnt0:="0000"elsif cnt0<"1001" then cnt0:=cnt0+1;else cnt0:="0000"cnt1:=cnt1+1;end
22、 if;end if;end if;hour1<=cnt1;hour0<=cnt0;end process;end a;24進(jìn)制計(jì)數(shù)器仿真圖:5.數(shù)據(jù)選擇和數(shù)碼管選擇模塊代碼:其功能是選擇計(jì)數(shù)端口來的數(shù)據(jù),當(dāng)相應(yīng)的數(shù)據(jù)到來時(shí)數(shù)據(jù)選擇器數(shù)據(jù)后輸數(shù)給數(shù)碼管,并由數(shù)碼管顯示。八個(gè)數(shù)碼管分別顯示小時(shí),分鐘,秒,百分秒library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity seltime isport(clk: in bit;dain0,dain1,dain2,dain3,dain4,da
23、in5,dain6,dain7: in std_logic_vector(3 downto 0);sel: out std_logic_vector(2 downto 0);daout: out std_logic_vector(3 downto 0);end seltime;architecture a of seltime issignal temp:integer range 0 to 7;beginprocess(clk)beginif (clk='1'and clk'event) thenif temp=7 then temp<=0;else temp&
24、lt;=temp + 1;end if;case temp iswhen 0=>sel<="000"daout<=dain0;when 1=>sel<="001"daout<=dain1;when 2=>sel<="010"daout<=dain2;when 3=>sel<="011"daout<=dain3;when 4=>sel<="100"daout<=dain4;when 5=>sel<
25、="101"daout<=dain5;when 6=>sel<="110"daout<=dain6;when 7=>sel<="111"daout<=dain7;end case;end if;end process;end a;仿真圖:5.數(shù)碼管驅(qū)動(dòng)模塊代碼:數(shù)碼管驅(qū)動(dòng)電路,驅(qū)動(dòng)數(shù)碼管發(fā)光。library ieee;use ieee.std_logic_1164.all;entity deled isport(num:in std_logic_vector(3 downto 0);led:out std_logic_vector(6 downto 0);end deled ;architecture a of deled isbeginprocess(num)begincase num iswhen"0000"=>led<="0111111"-3FHwhen"0001"=>led<="0000110"-06Hwhen"0010&quo
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 公司組織建黨節(jié)目活動(dòng)方案
- 2025年智能制造與工業(yè)轉(zhuǎn)型相關(guān)知識(shí)考試試卷及答案
- 2025年生物醫(yī)學(xué)工程師職業(yè)資格考試題及答案
- 2025年青少年心理健康教育課程考試試題及答案
- 2025年民俗文化與社會(huì)變遷考試試題及答案
- 2025年就業(yè)指導(dǎo)與職業(yè)規(guī)劃考試試卷及答案
- 2025年婚姻家庭咨詢師職業(yè)資格考試試卷及答案
- 2025年國(guó)際貿(mào)易知識(shí)考試及其答案
- 2025年法律法規(guī)與社會(huì)責(zé)任考試試卷及答案
- 2025護(hù)理科內(nèi)自查分析討論
- 個(gè)人車位租賃合同電子版 個(gè)人車位租賃合同
- 普惠性托育機(jī)構(gòu)申請(qǐng)托育中心情況說明基本簡(jiǎn)介
- 外輪理貨業(yè)務(wù)基礎(chǔ)-理貨單證的制作
- 《水火箭制作》課件
- 網(wǎng)絡(luò)安全預(yù)防電信詐騙主題班會(huì)PPT
- 農(nóng)村垃圾清運(yùn)投標(biāo)方案
- 優(yōu)秀物業(yè)管理項(xiàng)目評(píng)選方案
- 圖書管理系統(tǒng)畢業(yè)論文參考文獻(xiàn)精選,參考文獻(xiàn)
- 中國(guó)當(dāng)代舊體詩選讀幻燈片
- 吉林省全省市縣鄉(xiāng)鎮(zhèn)衛(wèi)生院街道社區(qū)衛(wèi)生服務(wù)中心基本公共衛(wèi)生服務(wù)醫(yī)療機(jī)構(gòu)信息名單目錄995家
- 倔強(qiáng)的小紅軍-精講版課件
評(píng)論
0/150
提交評(píng)論