




版權(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 技術(shù)賦能課堂變革打造高效教學(xué)環(huán)境研討會(huì)
- 教育政策在醫(yī)療設(shè)備研發(fā)中的作用
- 打造智能教育資源體系設(shè)計(jì)思維的探索與實(shí)踐
- 煙草制絲培訓(xùn)課件
- 公交優(yōu)先戰(zhàn)略2025年對(duì)城市交通擁堵治理的影響研究報(bào)告
- 浙江警官職業(yè)學(xué)院《戲曲劇目研習(xí)》2023-2024學(xué)年第一學(xué)期期末試卷
- 鄭州電力高等??茖W(xué)?!缎?dòng)物麻醉與監(jiān)護(hù)》2023-2024學(xué)年第一學(xué)期期末試卷
- 公共衛(wèi)生應(yīng)急物資儲(chǔ)備體系建設(shè)實(shí)施方案在2025年的技術(shù)創(chuàng)新與應(yīng)用報(bào)告
- 成都紡織高等??茖W(xué)?!吨型饷佬g(shù)史A》2023-2024學(xué)年第一學(xué)期期末試卷
- 公路貨運(yùn)行業(yè)2025年數(shù)字化轉(zhuǎn)型與智能運(yùn)力調(diào)度策略研究
- 2025年7月浙江省普通高中學(xué)業(yè)水平考試化學(xué)試題(原卷版)
- 天臺(tái)保安考試題及答案
- 2025年高考全國(guó)二卷英語高考真題含解析
- 2024年民族出版社招聘事業(yè)編制專業(yè)技術(shù)人員真題
- 2025年食品安全管理員考試試題及答案
- 2025-2030骨科植入器材產(chǎn)業(yè)市場(chǎng)深度分析及發(fā)展趨勢(shì)與投資戰(zhàn)略研究報(bào)告
- 陜西省西工大附中第二次2025屆數(shù)學(xué)八下期末考試試題含解析
- 2025年中央八項(xiàng)規(guī)定精神學(xué)習(xí)教育應(yīng)知應(yīng)會(huì)考試題庫(含答案)
- 建立有效的風(fēng)險(xiǎn)管理體系試題及答案
- 聯(lián)想電腦展廳設(shè)計(jì)方案
- Arduino智能小車避障系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
評(píng)論
0/150
提交評(píng)論