萬年歷課程設計報告_第1頁
萬年歷課程設計報告_第2頁
萬年歷課程設計報告_第3頁
萬年歷課程設計報告_第4頁
萬年歷課程設計報告_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、EDA技術(shù)及其應用實 訓 報 告 班 級 姓 名 學 號 指導教師 目 錄一 設計要求21.0 設計目的及意義21.1 設計要求2二 設計流程:22.0 原理框圖22.1 VHDL設計思路3三 VHDL程序33.0 天計數(shù)模塊63.1 月計數(shù)模塊73.2 年計數(shù)模塊93.3 調(diào)時控制模塊113.4 譯碼模塊12 3.5 掃描模塊.12四 心得體會144.014五 附錄.155.0 頂層文件151、 設計目的及意義1.0 設計目的及意義 在掌握EDA理論知識的基礎(chǔ)上進一步了解EDA開發(fā)軟件QuartusII的使用,掌握VHDL編程的技巧及方法,學會并熟練掌握PC機與實驗箱的連接下載及使用,進一步

2、提高自己的動手操作能力。1.1 設計要求 利用QuartusII編寫程序在實驗箱上實現(xiàn)萬年歷的 年月日的顯示,要求能夠區(qū)分閏年與平年;年月日,時分秒可以自由調(diào)整并能隨意切換;能夠清楚地分辨出年月日,時分秒的顯示狀態(tài)。2、 設計流程2.0 原理框圖2.1 VHDL設計思路 編寫年月日模塊,年模塊要有一個反饋端口控制月;月也要有一個反饋端口控制日;最后編寫調(diào)時模塊和掃描模塊,以及譯碼模塊,可以用k1,k2調(diào)節(jié)年月,用對應的LED等的亮滅來表示調(diào)節(jié)狀態(tài)。3、 VHDL程序3.0 天計數(shù)模塊library ieee;use ieee.std_logic_1164.all;use ieee.std_lo

3、gic_unsigned.all; entity tian isport(clk:in std_logic;pan:in std_logic_vector(1 downto 0);T1:out std_logic_vector(6 downto 0); cout:out std_logic);end tian; architecture one of tian is signal q1:std_logic_vector(3 downto 0);signal q2:std_logic_vector(2 downto 0);signal ab:std_logic_vector(1 downto 0

4、);begin process(clk,pan) begin if clk'event and clk='1' then q1<=q1+1; if q1=9 then q1<="0000"q2<=q2+1; end if;case pan iswhen "00"=>if q2=3 and q1=1 then q2<="000" ;q1<="0001"cout<='1'else cout<='0' end if;w

5、hen "01"=>if q2=3 and q1=0 then q2<="000" ;q1<="0001"cout<='1'else cout<='0' end if;when "10"=>if q2=2 and q1=8 then q2<="000" ;q1<="0001"cout<='1'else cout<='0' end if;when &quo

6、t;11"=>if q2=2 and q1=9 then q2<="000" ;q1<="0001"cout<='1'else cout<='0' end if;when others=>null;end case;end if;end process;T1(3 downto 0)<=q1;T1(6 downto 4)<=q2;end one;3.1 月計數(shù)模塊library ieee;use ieee.std_logic_1164.all;use ieee.std

7、_logic_unsigned.all;entity yue isport(clk,run:in std_logic;cout:out std_logic;pan:out std_logic_vector(1 downto 0);Y1:out std_logic_vector(6 downto 0);end yue; architecture behav of yue issignal q1:std_logic_vector(3 downto 0);signal q2:std_logic_vector(2 downto 0);signal q3:std_logic_vector(6 downt

8、o 0);beginprocess(clk,run,q1,q2)beginif clk'event and clk='1' then q1<=q1+1; if q1=9 then q1<="0000" q2<=q2+1; end if; if q1=2 and q2=1 thenq1<="0001"q2<="000"cout<='1'else cout<='0' end if;q3<=q2&q1;case q3 is whe

9、n "0000001"=>pan<="00"when "0000010"=>if run='1' then pan<="11"else pan<="10"end if; when "0000011"=>pan<="00" when "0000100"=>pan<="01"when "0000101"=>pan<=&q

10、uot;00"when "0000110"=>pan<="01" when "0000111"=>pan<="00"when "0001000"=>pan<="00"when "0001001"=>pan<="01"when "0001010"=>pan<="00"when "0001011"=>pan

11、<="01"when "0001100"=>pan<="00"when others=>null;end case;end if;Y1(3 downto 0)<=q1;Y1(6 downto 4)<=q2;end process;end behav; 3.2 年計數(shù)模塊library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity nian isport(clk :in std_logic;n1:out

12、std_logic_vector(6 downto 0); run:out std_logic);end entity;architecture one of nian issignal q1,q3:std_logic_vector(3 downto 0);signal q2:std_logic_vector(2 downto 0);beginprocess(clk) beginif clk'event and clk='1' then q1<=q1+1;q3<=q3+1; if q1=9 then q2<=q2+1;q1<="0000

13、"end if;if q3=3 thenq3<="0000"run<='1'else run<='0'end if; if q1=9 and q2<=7 then q1<="0001"q2<="000"end if; end if;end process;n1(3 downto 0)<=q1;n1(6 downto 4)<=q2;end one;3.3 調(diào)時模塊library ieee;use ieee.std_logic_1164.all;us

14、e ieee.std_logic_unsigned.all;entity tiaoshi isport(k1,k2:in std_logic; m1,m2:in std_logic;n1,n2,d1,d2:out std_logic);end entity;architecture one of tiaoshi issignal q:std_logic_vector(3 downto 0); beginprocess(k1,q,m1,m2) begin if k1'event and k1='1' then q<=q+1;if q=2 then q<=&qu

15、ot;0000" end if;end if; case q is when"0000"=>n1<=m1;n2<=m2;d1<='0'd2<='0' when"0001"=>n1<=k2;n2<='0' d1<='1'd2<='0' when"0010"=>n1<='0'n2<=k2; d1<='0'd2<='1

16、9; when others=>NULL;end case;end process;end one;3.4 掃描模塊library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity seltime isport(clk1:in std_logic;tian,yue:in std_logic_vector(6 downto 0);nian:in std_logic_vector(6 downto 0);daout:out std_logic

17、_vector(3 downto 0);dp:out std_logic;sel:out std_logic_vector(2 downto 0);end seltime;architecture fun of seltime issignal count:std_logic_vector(2 downto 0);beginsel<=count;process(clk1)beginif(clk1'event and clk1='1')thenif(count>="101")thencount<="000"else

18、count<=count+1;end if;end if;case count iswhen "000"=>daout<=tian(3 downto 0);dp<='0'when"001"=>daout(3)<='0'daout(2 downto 0)<=tian(6 downto 4);dp<='0'when "010"=>daout<=yue(3 downto 0);dp<='1'when"0

19、11"=>daout(3)<='0'daout(2 downto 0)<=yue(6 downto 4);dp<='0'when "100"=>daout<=nian(3 downto 0);dp<='1'when others=>daout(3 downto 2)<="00"daout(2 downto 0)<=nian(6 downto 4);dp<='0'end case;end process;end fun

20、;3.5 譯碼模塊 library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity led isport(ledi:in std_logic_vector(3 downto 0);ledo:out std_logic_vector(6 downto 0); end entity;architecture one of led isbeginprocess(ledi)begincase ledi iswhen "0000"=>ledo<="1111110&qu

21、ot;when "0001"=>ledo<="0110000"when "0010"=>ledo<="1101101"when "0011"=>ledo<="1111001"when "0100"=>ledo<="0110011"when "0101"=>ledo<="1011011"when "0110"=>l

22、edo<="1011111"when "0111"=>ledo<="1110000"when "1000"=>ledo<="1111111"when "1001"=>ledo<="1111011"when others=>null;end case;end process;end one; 4、 心得體會 通過本次萬年歷實訓,讓我從中收獲很多,感觸也很多。在實訓這段時間里,我對EDA有了更深的理解,以前很多不

23、知道的東西,實訓中一大部分的問題都得到了解決,比如說:以前學EDA理論課時,只知道在電腦上敲程序,然后仿真,生成模塊,它能實現(xiàn)的功能在老師的解說下也知道,但是它功能實現(xiàn)的形式是什么樣的,只能靠著想象力去猜測。做了實訓后才明白它是通過實驗箱上的模塊和一些電路來實現(xiàn)的。平時我總是眼高手低,不想去做一些實際的東西,通過這次實訓,我明白了,只有自己親手做,才會對每一個細節(jié)了如指掌,即使在中間遇到一些小問題,自己也能夠有條理的尋找錯誤,尋找漏洞,不至于不知道該從哪里開始找錯誤。實訓過程中切身體會到理論和實踐的差別有多大,老師在課堂上講時講的很清楚,聽課也比較認真,能聽的懂老師講的什么,所以就以為自己真的

24、懂了,但在實訓時當我們動手寫程序時,就出了問題,各底層文件總是出現(xiàn)小錯誤,導致頂層文件萬年歷不能實現(xiàn)功能。萬年歷一路編來可謂是坎坎坷坷,但大家都沒有放棄項目的開發(fā),在做的過程中遇到問題時,同學們都積極主動的找老師找同學幫忙解決難題,使得整個實訓能夠順利進行直至完成。通過這次實訓,我不僅在知識上得到很大程度的提升,而且還讓我意識到合作的重要性,作為一個小組,一個團隊,就要有合作精神,彼此之間要有很好的溝通,要及時提出自己的見解,這樣才能使整個小組的工作順利的進展下去。此次萬年歷實訓我們是四個人作為一個團隊,在實訓過程中,有時候一個人在編寫程序時出現(xiàn)一點很小的錯誤(例如:程序中少了一個分號或者少了

25、一個字母)就會導致整個程序編譯不能通過,而四個人在一起,出現(xiàn)錯誤時一起去尋找,總會有一個人及時發(fā)現(xiàn)錯誤的,發(fā)現(xiàn)后及時糾正錯誤,然后繼續(xù)開展下面的工作。這樣三個人互相協(xié)作,共同努力,各自發(fā)揮自身的優(yōu)勢,這樣工作便能順利的進行下去,如果是一個人單獨去完成,在出現(xiàn)錯誤的時候自己要想發(fā)現(xiàn)錯誤便需要很長的時間才能發(fā)現(xiàn),這樣很浪費時間,浪費時間的結(jié)果就是直接導致工作效率低。而在如今的社會工作中,許多公司企業(yè)都要求應聘者要有很好的團隊合作精神,工作時要有高效的工作效率。因此,在這次實訓中我也切身體會到了團隊合作的重要性。實訓是對每個學生綜合能力的檢驗是讓我們能夠更好的鞏固專業(yè)知識,積累工作經(jīng)驗,掌握工作技能

26、。通過這次實訓,讓我深深的體會到要想做好每一件事情,除了自己平時要有一定的專業(yè)知識外,還需要一定的實踐動手能力,操作能力,說實話,這次實訓讓我學到了很多東西,也明白了很多事情。在此還要感謝王老師耐心、認真的指導。謝謝薛老師!5、 附錄5.0 頂層文件 library ieee;use ieee.std_logic_1164.all;entity nianli isport(clk,clkdsp:in std_logic;k1,k2:in std_logic;dpout,d10,d20:out std_logic;ledout :out std_logic_vector(6 downto 0);

27、sel1:out std_logic_vector(2 downto 0); end entity;architecture one of nianli iscomponent tian port(clk:in std_logic;pan:in std_logic_vector(1 downto 0);T1:out std_logic_vector(6 downto 0); cout:out std_logic); end component; component yue port(clk,run:in std_logic;cout:out std_logic;pan:out std_logic_vector(1 downto 0);Y1:out std_logic_vector(6 downto 0);end component;component nianport(clk :in std_logic;n1:out std_logic_vector(6 downto 0); run:

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 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

提交評論