1学号14082200163成绩《现代数字系统设计》课程论文题目基于FPGA的密码锁设计作者嘿嘿班级0803BF院别信息与通信工程专业电子信息工程完成时间2011年5月8日评语2基于FPGA的密码锁设计【摘要】基于FPGA设计的电子密码锁是一个小型的数字系统,与普通机械锁相比,具有许多独特的优点:保密性好,防盗性强,可以不用钥匙,记住密码即可开锁等。目前使用的电子密码锁大部分是基于单片机技术,以单片机为主要器件,其编码器与解码器的生成为软件方式。在实际应用中,由于程序容易跑飞,系统的可靠性能较差。本文介绍一种基于现场可编程门阵列FPGA器件的电子密码锁的设计方法采用VerilogHDL语言对系统进行描述,并在EP1K10TC100-3上实现。系统所实现的功能:用户给电子密码锁设定一个密码,当使用本机键盘开锁时,该密码与用户设定的密码比较,如果密码正确,则开锁;如果密码不正确,则允许用户重新输入密码,最多可输入三次,若三次都不正确,则扬声器报警,直到按复位键才允许再次输入代码。通过仿真调试,利用可编程器件FPGA的电子密码锁的设计基本达到了预期目的。当然,该系统在一些细节的设计上还需要不断的完善和改进,特别是对系统的扩展有很好的实用和设计的价值。【关键词】:现场可编程门阵列,硬件描述语言,电子密码锁,扬声器3【Abstract】FPGA-baseddesignoftheelectroniccodelockisasmalldigitalsystem,electronicpasswordlockcomparedwithordinarymechanicallocks,withmanyuniqueadvantages:goodprivacy,securityandstrong,cannotkeytorememberpasswordstounlock,andsoon.AtpresenttheuseoftheelectroniccodelockonmostofSCMtechnologytoSCMasthemaindevices,encodersanddecodersofHealthandthesoftwareapproach.Inpractice,sincetheprocesseasyruntofly,thereliabilityofthesystemcanbepoor.Basedonthispaper,afieldprogrammablegatearraysFPGAdeviceselectronicpasswordlockdesign,VerilogHDLlanguageusedtodescribethesystemandachieveEP1K10TC100-3.Implementationofthesystemfeatures:usersofelectronicpasswordlocktosetapassword,whenusingthekeyboardunlockthemachine,theuserpasswordandsetthepassword,ifthecorrectpassword,thenunlockifthepasswordisnotcorrect,allowsUserstoenterapassword,canenteruptothreetimes,threetimesifnotcorrect,thespeakeralarm,untiltheresetbuttononlyallowedtore-enterthecode.ThesimulationtestsusingprogrammabledevicesFPGAelectronicpasswordlockthebasicdesigntoachievetheexpectedgoal.Ofcourse,someofthedetailsofthesysteminthedesignoftheneedtoconstantlyrefinedandimproved,inparticulartheexpansionofthesystemhaveagooddesignandpracticalvalue.【Keywords】:FPGA,VerilogHDL,electronicpasswordlock,speaker4基于FPGA的密码锁设计........................................................................................................................2一、概述...................................................................................................................................................51.1电子密码锁的现状......................................................................................................................51.2论文主要完成的工作..................................................................................................................6二、系统硬件设计...................................................................................................................................62.1系统设计方案..............................................................................................................................62.1.1系统功能需求分析...........................................................................................................62.1.2系统实现方案的论证比较...............................................................................................62.1.3系统方案的总体设计.......................................................................................................72.2主控模块......................................................................................................................................82.2.1主控芯片EP1K10TC100-3的介绍.................................................................................82.3键盘模块......................................................................................................................................82.4显示模块......................................................................................................................................92.5报警模块....................................................................................................................................10三、系统软件设计...................................................................................................................................103.1系统主控制流程框图.................................................................................................................103.2键盘扫描程序框图....................................................................................................................113.3获取键值程序框图....................................................................................................................113.4解码、报警模块........................................................................................................................123.5系统软件设计总RTL级图......................................................................................................13四、系统测试与总结.............................................................................................................................134.1仿真波形图................................................................................................................................134.2本次课题设计体会....................................................................................................................14参考文献...................................................................................................................................................14附录.............