項目四秒表設(shè)計實驗報告_第1頁
項目四秒表設(shè)計實驗報告_第2頁
項目四秒表設(shè)計實驗報告_第3頁
免費預(yù)覽已結(jié)束,剩余1頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、“項目四秒表設(shè)計”實驗報告專業(yè)班級:電子144 姓名: 秦慧樺學號: 2014014273 實驗日期: 一、實驗?zāi)康?)熟悉并掌握計數(shù)器的設(shè)計;2)熟悉數(shù)碼管的設(shè)計;3)熟悉VHDL語言的分層次設(shè)計;二實驗內(nèi)容:1)對50MHz晶振進行500000分頻,得到100Hz信號;2)對該100Hz信號進行0-9的循環(huán)計數(shù),并用一位數(shù)碼管顯示;3) 在2成功的基礎(chǔ)上進行擴展,實現(xiàn)100Hz信號的0-99循環(huán)計數(shù),并用兩位數(shù)碼管進行顯示;4)擴展內(nèi)容:計數(shù)初值可以設(shè)置,計數(shù)值可以人為干預(yù);三、實驗結(jié)果1. 對50MHz晶振進行500000分頻,得到100Hz信號的程序代碼library ieee;use

2、 ieee.std_logic_1164.AII;use ieee.std_logic_unsigned.All;use ieee.std_logic_arith.All;entity div25 isport(clkin:in std_logic;clkout:buffer std_logic);end;architecture ret1 of div25 isbeginprocess(clkin)variable count:integer range 0 to 249999;beginif clkin' event and clkin='1' then if co

3、unt<249999 then count:=count+1;elsecount:=0;clkout<=not clkout;end if;end if;end process;end;2. 對 100Hz 信號的 0-99 循環(huán)計數(shù)程序代碼及仿真結(jié)果library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity cnt99 isport (clkout:in std_logic;gw:out std_logic_vector(3

4、 downto 0);sw:out std_logic_vector(3 downto 0); end;architecture rtl of cnt99 isbeginprocess(clkout)variable num:std_logic_vector (3 downto 0) ;variable s:std_logic_vector (3 downto 0) ; beginif clkout' event and clkout='1' thenif (num<9) thennum:=num+1;else num:="0000"s:=s+

5、1; if (s>9) then s:="0000"end if;end if ;end if;gw<=num;sw<=s;end process;end ;3頂層文件的截屏、引腳鎖定及實驗現(xiàn)象截圖,并對實驗現(xiàn)象進行分析 © Edit: X 7Node NameDirectionLocationI/O Bankfnf GroupI/O StandarddkInputPIN G21>B6 N12.5 V (default)q6OutputPIN.F137B7 N12.5 V (default)OutputPIN F127B7N1乙 5 V (

6、deFault)Outputpm Gi21B7 hll2,5 V (defadt)OutputPIN屮苗?B7 N12-5 V (default)OutputPIN H12J*B7 N12.5 V (蟲fault)OutputP1N FL17B7 N12.5 V (default)OutputPIN EllJE7 N12.5 V (default)OutputPIN A157B7 N12-5 V (default)OutputPIN E1B7 N12.5 V (default)OutputP1N B147B7 N12.5 V (default)OutputPIN A147B7 N1乙 5 V

7、(default)OutputPIN C137B7 N1V (default)OutputPIN B137B7 N1N5 V (deFault)s0Outpu tPIN A137B7 N12.5 V (default)實驗現(xiàn)象分析:單片機數(shù)碼管顯示從 099秒的計時四、如何實現(xiàn)秒表的倒計時功能?請給出程序及實驗結(jié)果library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity cntd99 isport (clkout:in std_logi

8、c;gw:out std_logic_vector(3 downto 0);sw:out std_logic_vector(3 downto 0);end;architecture rtl of cntd99 isbeginprocess(clkout)variable num:std_logic_vector (3 downto 0);variable s:std_logic_vector (3 downto 0);beginif clkout' event and clkout='1' thenif (num<9) thennum:=num+1;else nu

9、m:="0000"s:=s+1;if (s>9) then s:="0000"end if;end if ;end if;gw<=9_num;sw<=9-s;end process;end ;實驗總結(jié)Ll_psA) ns.itu. U ns Z4U. U ns JU. U ns 4UJ. U ns ilm t»U. U ns t*iU. U ns fZU. U ns.占HI II liIie.9 nsJArmniwiwiMmnmwuinnjinnjinwmnwumnminnjuinjumijmnmnwuuVUC91XmX7JC引rnr5X4】;(131)G本次實驗是在上次實驗的基礎(chǔ)上進行的,上次實驗中,我們做了059的計數(shù),這次我們

溫馨提示

  • 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論