【正文】
I 摘要 基于 FPGA設(shè)計(jì)的電子密碼鎖是一個(gè)小型的數(shù)字系統(tǒng),與普通機(jī)械鎖相比 , 具有許多獨(dú)特的優(yōu)點(diǎn) : 保密性好 , 防盜性強(qiáng) , 可以不用鑰匙 , 記住密碼即可開鎖等。目前使用的電子密碼鎖大部分是基于單片機(jī)技術(shù) , 以單片機(jī)為主要器件 , 其編碼器與解碼器的生成為軟件方式。在實(shí)際應(yīng)用中 , 由于程序容易跑飛 , 系統(tǒng)的可靠性能較差。本文介紹一種基于現(xiàn)場可編程門陣列 FPGA 器件的電子密碼鎖的設(shè)計(jì)方法 采用VHDL語言對系統(tǒng)進(jìn)行描述,并在 FLEX10K10LC844上實(shí)現(xiàn)。 系統(tǒng)所實(shí)現(xiàn)的功能:用戶給電子密碼鎖 設(shè)定一個(gè)密碼,當(dāng)使用本機(jī)鍵盤開鎖時(shí),該密碼與用戶設(shè)定的密碼比較,如果密碼正確,則開鎖;如果密碼不正確,則允許用戶重新輸入密碼,最多可輸入三次,若三次都不正確,則揚(yáng)聲器報(bào)警,直到按復(fù)位鍵才允許再次輸入代碼。 通過仿真調(diào)試,利用可編程器件 FPGA 的電子密碼鎖的設(shè)計(jì)基本達(dá)到了預(yù)期目的。當(dāng)然,該系統(tǒng)在一些細(xì)節(jié)的設(shè)計(jì)上還需要不斷的完善和改進(jìn),特別是對系統(tǒng)的擴(kuò)展有很好的實(shí)用和設(shè)計(jì)的價(jià)值。 關(guān)鍵詞: 現(xiàn)場可編程門陣列 , 硬件描述語言 , 電子密碼鎖 , 揚(yáng)聲器 II Abstract FPGAbased design of the electronic code lock is a small digital system, electronic password lock pared with ordinary mechanical locks, with many unique advantages: good privacy, security and strong, can not key to remember passwords to unlock, and so on. At present the use of the electronic code lock on most of SCM technology to SCM as the main devices, encoders and decoders of Health and the software approach. In practice, since the process easy run to fly, the reliability of the system can be poor. Based on this paper, a field programmable gate arrays FPGA devices electronic password lock design, VHDL language used to describe the system and achieve FLEX10K10LC844. Implementation of the system features: users of electronic password lock to set a password, when using the keyboard unlock the machine, the user password and set the password, if the correct password, then unlock if the password is not correct, allows Users to enter a password, can enter up to three times, three times if not correct, the speaker alarm, until the reset button only allowed to reenter the code. The simulation tests using programmable devices FPGA electronic password lock the basic design to achieve the expected goal. Of course, some of the details of the system in the design of the need to constantly refined and improved, in particular the expansion of the system have a good design and practical value. Key words: FPGA , VHDL, electronic password lock , speaker III 目 錄 摘要 .................................................................. I ABSTRACT ............................................................. II 目錄 ................................................................ III 1 緒言 ................................................................. 1 課題背景 ........................................................... 1 課題研究的目的和意義 ............................................... 1 國內(nèi)外概況 ......................................................... 2 課題的主要研究工作 ................................................. 3 2FPGA 的相關(guān)介紹 ....................................................... 4 可編程邏輯器件 ..................................................... 4 的簡介 ......................................................... 4 的應(yīng)用特點(diǎn) ..................................................... 5 的應(yīng)用前景 ..................................................... 6 3 基于 FPGA 設(shè)計(jì)的硬件描述語言 VHDL ..................................... 8 語言簡介 ....................................................... 8 語言的特點(diǎn) ............................................... 8 語言的優(yōu)點(diǎn) ..................................................... 8 VHDL 語言的基本結(jié)構(gòu) ............................................... 9 語言的應(yīng)用 .................................................... 10 4 系統(tǒng)設(shè)計(jì)方案的研究 .................................................. 11 系統(tǒng)功能需求分析 .................................................. 11 系統(tǒng)實(shí)現(xiàn)方案的論證比較 ............................................ 11 系統(tǒng)方案的總體設(shè)計(jì) ................................................ 11 系統(tǒng)原理框圖 .................................................... 11 總體設(shè)計(jì)原理 .................................................... 12 5 系統(tǒng)硬件設(shè)計(jì) ........................................................ 13 系統(tǒng)的硬件模塊實(shí)現(xiàn) ................................................ 13 基于 FPGA 的設(shè)計(jì) ................................................... 13 主控芯片 EPF10K10LC844 的介紹 ................................... 13 邏輯功能結(jié)構(gòu)及開發(fā) .......................................... 14 鍵盤控制電路結(jié)構(gòu)與原理 ............................................ 14 顯示器結(jié)構(gòu)與原理 ............................................... 15 報(bào)警電路 .......................................................... 17 6 系統(tǒng)的軟件設(shè)計(jì) ...................................................... 18 系統(tǒng)主控制流程框圖 ................................................ 18 鍵盤掃描程序框圖 .................................................. 19 獲取鍵值程序框圖 .................................................. 20 解碼、報(bào)警模塊 .................................................... 21 7 系統(tǒng)的原理實(shí)現(xiàn) ...................................................... 22 系統(tǒng)的層次化設(shè)計(jì) .................................................. 22 頂層圖形設(shè)計(jì) ...................................................... 22 系統(tǒng)仿真演示結(jié)果 .................................................. 23 IV 總結(jié)與展望 ........................................................... 24 致謝 ................................................................. 25 參考文獻(xiàn) ............................................................. 26 附錄 ................................................................. 28 1 1 緒言 系統(tǒng)以利用可編程器件實(shí)現(xiàn)電子密碼鎖的設(shè)計(jì)為研究背景、現(xiàn)狀以及發(fā)展方向,明確指出了電子密碼鎖面臨的問題和所解決的方法。 課題背景 基于 FPGA的電子密碼鎖是新型現(xiàn)代化安全管理系統(tǒng),它集微機(jī)自動(dòng)識別技術(shù)和現(xiàn)代安全管理措施為一體,它涉及電子,機(jī)械,計(jì)算機(jī)技術(shù),通訊技術(shù),生物技術(shù)等諸多新技術(shù)。它是解決重要部門出入口實(shí)現(xiàn)安全防范管理的有效措 施,適用各種場合,如銀行、賓館、機(jī)房、軍械庫、機(jī)要室、辦公間、智能化小區(qū)、工廠、家庭等。 在數(shù)字技術(shù)網(wǎng)絡(luò)技術(shù)飛速發(fā)展的今天,電子密碼鎖技術(shù)得到了迅猛的發(fā)展。它早已超越了單純的門道及鑰匙管理,逐漸發(fā)展成為一套完整的出入管理系統(tǒng) [1]。它在工作環(huán)境安全、人事考勤管理等行政管理工作中發(fā)揮著巨大的作用。在該系統(tǒng)的基礎(chǔ)上增加相應(yīng)的輔助設(shè)備可以進(jìn)行電梯控制、車輛進(jìn)出控制,物業(yè)消防監(jiān)控、餐飲收費(fèi)、私家車庫管理等,真正實(shí)現(xiàn)區(qū)域內(nèi)一卡智能管理。 目前使用的電子密碼鎖大部分是基于單片機(jī)技術(shù) , 以單片機(jī)為主要器件 , 其 編碼器與解碼器的生成為軟件方式。在實(shí)際應(yīng)用中 , 由于程序容易跑飛 , 系統(tǒng)的可靠性能較差 [2]。 基于 FPGA 的電子密碼鎖已經(jīng)是現(xiàn)代生活中經(jīng)常用到的工具之一,用于各類保險(xiǎn)柜、房門、防盜門等等。用電子密碼鎖代替?zhèn)鹘y(tǒng)的機(jī)械式密碼鎖,克服了機(jī)械式密碼鎖密碼量少、安全性能差的缺點(diǎn)。由于采用的是可編程邏輯器件FPGA,使得系統(tǒng)有相當(dāng)大的靈活性,隨時(shí)可以進(jìn)行硬件升級、擴(kuò)展,而且系統(tǒng)設(shè)計(jì)完善以后還可