基于VHDL的多功能電子密碼鎖設(shè)計教材_第1頁
基于VHDL的多功能電子密碼鎖設(shè)計教材_第2頁
基于VHDL的多功能電子密碼鎖設(shè)計教材_第3頁
基于VHDL的多功能電子密碼鎖設(shè)計教材_第4頁
基于VHDL的多功能電子密碼鎖設(shè)計教材_第5頁
已閱讀5頁,還剩49頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

II軟件的操作方法。同樣也認(rèn)識到自己的很多不足之處,自己還有很多知識沒有掌握,還有很多需要學(xué)習(xí)的地方。只有不斷的學(xué)習(xí)才能取得進(jìn)步,并提升個人能力。參考文獻(xiàn)[1]侯伯亨,劉凱,顧新:VHDL硬件描述語言與數(shù)字邏輯電路設(shè)計[M],西安電子科技大學(xué)出版社,2009.8。[2]郭照男等.電子技術(shù)與EDA技術(shù)課程設(shè)計[M].中南大學(xué)出版社,2010.[3]VolneiA.Pedroni:CircuitDesignwithVHDL[M],電子工業(yè)出版社,2013.1。[4]U.Meyer-Baese,劉凌.數(shù)字信號處理的FPGA實現(xiàn)[M].清華大學(xué)出版社,2011.03.[5]邢建平.VHDL程序設(shè)計教程[M].北京:清華大學(xué)出版社,2006.[6]楊健,岳珣,王永喜:EDA技術(shù)與VHDL基礎(chǔ)[M],清華大學(xué)出版社,2013.3。[7]武超,靳孝峰:EDA技術(shù)與應(yīng)用[M],北京航空航天大學(xué)出版社,2013.5。[8]蘇陽,蔣銀坪.那些年,我們拿下了FPGA[M].北京航空航天大學(xué)出版社,2013.10.[9]江國強(qiáng).EDA技術(shù)與應(yīng)用[M].電子工業(yè)出版社,2006.[10]李國麗,朱維勇.EDA與數(shù)字系統(tǒng)設(shè)計[M].北京:機(jī)械工業(yè)出版社,2009.[11]潘松,黃繼業(yè).EDA技術(shù)實用教程第三版[M].科學(xué)出版社,2010.[12]潘松.VHDL實用教程[M].電子科技大學(xué)出版社,2006.[13]盧毅.VHDL與數(shù)字電路設(shè)計[M].科學(xué)出版社,2009.[14]黃任,VHDL入門/解惑/經(jīng)典實例/經(jīng)驗總結(jié)[M].北航出版社,2009.[15]楊恒.零起點(diǎn)學(xué)單片機(jī)與CPLD/FPGA[M].北航出版社,2005.[16]EDA先鋒工作室.AlteraFPGA/CPLD設(shè)計[M].人民郵電出版社,2008.[17]田耕,徐文波.xilinxFPGA開發(fā)實用教程[M].北京:清華大學(xué)出版社,2010.[18]夏宇聞,Verilog數(shù)字系統(tǒng)設(shè)計教程[M].北京航空航天大學(xué)出版社,2013.07.[19]威廉斯,李林等.Verilog數(shù)字VLSI設(shè)計教程[M].電子工業(yè)出版社,2010.07.[20]RichardE.Haskell,DarrinM.Hanna,鄭利浩,王荃.FPGA數(shù)字邏輯設(shè)計教程Verilog[M].電子工業(yè)出版社,2010.09.致謝畢業(yè)設(shè)計是大學(xué)生活的最后一個課題,在感受收獲的喜悅的同時,心中更是充滿了感激之情。由衷的感謝導(dǎo)師岳改麗老師對我的指導(dǎo)。設(shè)計從開題到定稿,都離不開岳老師的悉心教導(dǎo)。設(shè)計既是一個開發(fā)過程也是一個學(xué)習(xí)過程,感謝岳老師的悉心指導(dǎo)和監(jiān)督,岳老師教會了我很多東西,在此過程中我受益匪淺。最開始做的時候有我很多不懂的地方,每次遇到的問題老師都深入淺出的幫我分析。每周老師都檢查我們的進(jìn)度,督促我們完成設(shè)計。感謝老師的幫助和關(guān)心。在我四年的學(xué)習(xí)生活中,我也得到了電氣與控制工程學(xué)院各位領(lǐng)導(dǎo)和老師對我的幫助和鼓勵。電氣與控制工程學(xué)院各位老師對待科研工作勤勤懇懇、兢兢業(yè)業(yè)的工作態(tài)度以及積極向上的生活態(tài)度,讓我從中獲益良多。在此,我也感謝電氣與控制工程學(xué)院各位老師對我的悉心教導(dǎo)。同樣感謝我的同學(xué)和朋有們,他們也幫了我許多,每次我向他們請教時都不厭其煩的指導(dǎo)我、鼓勵我,謝謝各位朋友。感謝我的家人!感謝父母多年的養(yǎng)育之恩!感謝他們對我各方面的關(guān)心、鼓勵和支持!附錄附錄1硬件原理圖圖1硬件原理圖附錄2硬件實物圖圖2硬件實物圖附錄3系統(tǒng)頂層文件圖圖3系統(tǒng)頂層文件圖附錄4部分模塊代碼1)秒計時模塊libraryieee;useieee.std_logic_1164.all;useieee.std_logic_arith.all;useieee.std_logic_unsigned.all;entitymiao60isport(clk1:instd_logic; jj:instd_logic_vector(1downto0); data_f:instd_logic_vector(3downto0); dlag_f:instd_logic;s_outh,s_outl:outstd_logic_vector(3downto0); s_linkm:outstd_logic);--計滿60次產(chǎn)生一個進(jìn)位信號給分計時模塊endentitymiao60;architecturebehaviorofmiao60issignalsh,sl:std_logic_vector(3downto0);signalcnt:std_logic_vector(5downto0);beginprocess(clk1,data_f)beginifrising_edge(clk1)then if(flag_f='0')then--無功能鍵輸入時 if(sh="0101"andsl="1001")thensh<="0000";sl<="0000"; s_linkm<='1'; elsif(sh/="0101"andsl="1001")thensh<=sh+"0001";sl<="0000";s_linkm<='0';elsesh<=sh;sl<=sl+"0001";s_linkm<='0';endif;elsif(data_f="0011"andjj="00")then--加鍵按下,同時計數(shù)信號為0時 if(sh="0101"andsl="1001")thensh<="0000";sl<="0000"; elsif(sh/="0101"andsl="1001")thensh<=s_h+"0001";sl<="0000";elsesh<=sh;sl<=sl+"0010";endif;elsif(dataf="0100"andjj="00")then--減鍵按下,計數(shù)信號為0時控制秒的加減,計數(shù)信號為1時控制分的加減,計數(shù)信號為2時控制時的加減if(sh="0000"andsl="0000")thensh<="0101";sl<="1000"; elsif(sh/="0000"andsl="0000")thensh<=sh-"0001";sl<="1001";elsesh<=sh;sl<=sl-"0010";endif;endif;endif;endprocess;s_outh<=sh;s_outl<=sl;endbehavior;2)時計時模塊libraryieee;useieee.std_logic_1164.all;useieee.std_logic_arith.all;useieee.std_logic_unsigned.all;entityshi24isport(clk:instd_logic;--分計時模塊產(chǎn)生的進(jìn)位信號flag_f:instd_logic; jj:instd_logic_vector(1downto0); data_f:instd_logic_vector(3downto0);h_outh,h_outl:outstd_logic_vector(3downto0));endentityshi24;architecturebehaviorofshi24issignalh_h,h_l:std_logic_vector(3downto0);beginprocess(clk,data_f)beginifrising_edge(clk)thenif(flag_f='0')thenif(hh="0010"andhl="0011")thenhh<="0000";hl<="0000"; elsif(hh/="0010"andhl="0011")thenhh<=hh+"0001";hl<="0000";elsehh<=hh;hl<=hl+"0001";endif;elsif(data_f="0011"andjj="10")then--加鍵按下同時計數(shù)信號為2時 if(hh="0010"andhl="0011")thenhh<="0000";hl<="0000"; elsif(hh/="0010"andhl="0011")thenhh<=hh+"0001";hl<="0000";elsehh<=hh;hl<=hl+"0001";endif;elsif(data_f="0100"andjj="10")then--減鍵按下同時計數(shù)信號為2時if(hh="0000"andhl="0000")thenhh<="0010";hl<="0011"; elsif(hh/="0000"andhl="0000")thenhh<=hh-"0001";hl<="0011";elsehh<=hh;hl<=hl-"0001";endif;endif; endif;endprocess;h_outh<=hh;h_outl<=hl;endbehavior;3)顯示模塊libraryieee;useieee.std_logic_1164.all;useieee.std_logic_arith.all;useieee.std_logic_unsigned.all;entityzym4isport(clk:instd_logic;qhjs:instd_logic_vector(1downto0); majs:instd_logic_vector(1downto0);inge,inshi,m_1,m_2,m_3,m_4,m_5,m_6,sh,sl,mh,ml,hh,hl:instd_logic_vector(3downto0);Dataou_t:outstd_logic_vector(7downto0); Pxou_t:outstd_logic_vector(7downto0));endentityzym4;architectureartofzym4issignalse_l:std_logic_vector(2downto0);signaldat_a:std_logic_vector(3downto0);beginprocess(clk)beginif(clk'eventandclk='1')thenif(se_l="111")then Se_l<="000"; else Se_l<=se_l+'1'; endif; if(qhjs="00")thencasese_liswhen"000"=>dat_a<=inshi;pxou_t<="10000000";--數(shù)碼管第1位顯示溫度十位when"001"=>dat_a<=inge;pxou_t<="01000000";--數(shù)碼管第2位顯示溫度個位when"010"=>dat_a<=hh;pxou_t<="00100000";--數(shù)碼管第3位顯示時十位when"011"=>dat_a<=hl;pxou_t<="00010000";--數(shù)碼管第4位顯示時個位when"100"=>dat_a<=mh;pxou_t<="00001000";--數(shù)碼管第5位顯示分十位when"101"=>dat_a<=ml;pxou_t<="00000100";--數(shù)碼管第6位顯示分個位when"110"=>dat_a<=sh;pxou_t<="00000010";--數(shù)碼管第7顯示秒十位when"111"=>dat_a<=sl;pxou_t<="00000001";--數(shù)碼管第8位顯示秒個位endcase;elsif(qhjs="01")thencaseseliswhen"000"=>dat_a<=inshi;pxou_t<="10000000";when"001"=>dat_a<=inge;pxou_t<="01000000";when"010"=>dat_a<=m1;pxou_t<="00100000";when"011"=>dat_a<=m2;pxou_t<="00010000";when"100"=>dat_a<=m3;pxou_t<="00001000";when"101"=>dat_a<=m4;pxou_t<="00000100";when"110"=>dat_a<=m5;pxou_t<="00000010";when"111"=>dat_a<=m6;pxou_t<="00000001"; endcase; endif;endif;endprocess;process(dat_a,majs)beginif(majs="01")then casedat_aiswhen"0000"=>dataou_t<="00111111"; when"0001"=>dataou_t<="00000110"; when"0010"=>dataou_t<="01011011"; when"0011"=>dataou_t<="01001111"; when"0100"=>dataou_t<="01100110"; when"0101"=>dataou_t<="01101101"; when"0110"=>dataou_t<="01111101"; when"0111"=>dataou_t<="00000111"; when"1000"=>dataou_t<="01111111"; when"1001"=>dataou_t<="01101111"; whenothers=>null;endcase; elsif(majs="00")then dataout<="01000000";--顯示“—” endif;endprocess;endarchitectureart;4)溫度模塊libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.STD_LOGIC_UNSIGNED.ALL;entityds1820isport(clk:instd_logic;dq:inoutstd_logic; out16:outstd_logic_vector(7downto0));endds1820;architectureBehavioralofds1820isTYPESTATE_TYPEis(RESE_T,CMDC_C,WRITEBYT_E,WRITELO_W,WRITEHIG_H,READBI_T,CMD4_4,CMDB_E,WAIT800M_S,GETTM_P,WAIT4M_S);signalSTATE:STATETYP_E:=RESET;signalclktemp:std_logic:='0';signalclk1m:std_logic;--1Msignalwritetemp:std_logic_vector(7downto0):="00000000";signalTMP:std_logic_vector(11downto0);signaltmpbit:std_logic;signalWRITEBYTE_CNT:integerrange0to8:=0;signalWRITELOW_CNT:integerrange0to2:=0;signalWRITEHIGH_CNT:integerrange0to2:=0;signalREADBIT_CNT:integerrange0to3:=0;signalGETTMP_CNT:integerrange0to13:=0;signalcnt:integerrange0to100_001:=0;signalcnt2:integerrange0to4000001:=0;signalsegtemp:std_logic_vector(7downto0);signaltem_p:std_logic;signaldatatemp0:std_logic_vector(15downto0);signaldcimal0:std_logic_vector(15downto0);signaldcimal1:std_logic_vector(15downto0);signaldcimal2:std_logic_vector(15downto0);signaldcimal3:std_logic_vector(15downto0);signaldatatmep1:std_logic_vector(7downto0);signalintger0:std_logic_vector(7downto0);signalintger1:std_logic_vector(7downto0);signalintger2:std_logic_vector(7downto0);signalintger3:std_logic_vector(7downto0);signalintger4:std_logic_vector(7downto0);signalintger5:std_logic_vector(7downto0);signalintger6:std_logic_vector(7downto0);signalsign:std_logic_vector(7downto0);signalcount:integerrange0to51:=0;signalWRITE_BYTE_FLAG:integerrange0to4:=0;beginClkDivider:process(clk,clk_temp)beginifrising_edge(clk)thenif(count=12)thencount<=0;clk_temp<=notclk_temp;elsecount<=count+1;endif;endif;clk1m<=clk_temp;endProcess;STATE_TRANSITION:process(STATE,clk1m)beginifrising_edge(clk1m)thencaseSTATEiswhenRESET=>if(cnt>=0andcnt<500)thendq<='0';cnt<=cnt+1;STATE<=RESET;elsif(cnt>=500andcnt<510)thendq<='Z';cnt<=cnt+1;STATE<=RESET;elsif(cnt>=510andcnt<750)thentemp<=dq;if(cnt=580)thentemp<=dq;endif;cnt<=cnt+1;STATE<=RESET;elsif(cnt>=750)thencnt<=0;STATE<=CMD_CC;endif;whenCMD_CC=>write_temp<="11001100";STATE<=WRITE_BYTE;whenWRITE_BYTE=>caseWRITE_BYTE_CNTiswhen0to7=>if(write_temp(WRITE_BYTE_CNT)='0')thenSTATE<=WRITE_LOW;elseSTATE<=WRITE_HIGH;endif;WRITE_BYTE_CNT<=WRITE_BYTE_CNT+1;when8=>if(WRITE_BYTE_FLAG=0)thenSTATE<=CMD_44;WRITE_BYTE_FLAG<=1;elsif(WRITE_BYTE_FLAG=1)thenSTATE<=RESET;WRITE_BYTE_FLAG<=2;elsif(WRITE_BYTE_FLAG=2)thenSTATE<=CMD_BE;WRITE_BYTE_FLAG<=3;elsif(WRITE_BYTE_FLAG=3)thenSTATE<=GET_TMP;WRITE_BYTE_FLAG<=0;endif;WRITE_BYTE_CNT<=0;whenothers=>STATE<=RESET;endcase;whenWRITE_LOW=>caseWRITE_LOW_CNTiswhen0=>dq<='0';if(cnt=70)thencnt<=0;WRITE_LOW_CNT<=1;elsecnt<=cnt+1;endif;when1=>dq<='Z';if(cnt=5)thencnt<=0;WRITE_LOW_CNT<=2;elsecnt<=cnt+1;endif;when2=>STATE<=WRITE_BYTE;WRITE_LOW_CNT<=0;whenothers=>WRITE_LOW_CNT<=0;endcase;whenWRITE_HIGH=>caseWRITE_HIGH_CNTiswhen0=>dq<='0';if(cnt=8)thencnt<=0;WRITE_HIGH_CNT<=1;elsecnt<=cnt+1;endif;when1=>dq<='Z';if(cnt=72)thencnt<=0;WRITE_HIGH_CNT<=2;elsecnt<=cnt+1;endif;when2=>STATE<=WRITE_BYTE;WRITE_HIGH_CNT<=0;whenothers=>WRITE_HIGH_CNT<=0;endcase;whenCMD_44=>write_temp<="01000100";STATE<=WRITE_BYTE;whenCMD_BE=>write_temp<="10111110";STATE<=WRITE_BYTE;whenREAD_BIT=>caseREAD_BIT_CNTiswhen0=>dq<='0';if(cnt=4)thenREAD_BIT_CNT<=1;cnt<=0;elsecnt<=cnt+1;endif;when1=>dq<='Z';if(cnt=4)thenREA

溫馨提示

  • 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論