1、基于基于 Verilog HDL 的的 FPGA 的电子密码锁的设计的电子密码锁的设计报告报告 摘要:摘要:基于 FPGA 设计的电子密码锁是一个小型的数字系统,与普通机械锁相比, 具有许多独特的优点:保密性好,防盗性强,可以不用钥匙,记住密码即可开锁 等。目前使用的电子密码锁大部分是基于单片机技术,以单片机为主要器件。在 实际应用中,程序容易跑飞,系统的可靠性较差。本文介绍的一种基于现场可编 辑门阵列 FPGA 器件的电子密码锁的设计方法,采用 VHDL 语言对系统进行描述, 并在 EP3C10E144C8 上实现。 通过仿真调试, 利用可编程逻辑器件 FPGA 的电子密码锁的设计基本达到了
2、 预期目的。当然,该系统在一些细节的设计上还需要不断地完善和改进,特别是 对系统的扩展有很好的使用系统和设计的价值。 关键词关键词: :现场可编程门阵列;VHDL 语言;电子密码锁 The Report Of The Report Of Electronic Code Lock DesignElectronic Code Lock Design AbstractAbstract:FPGA-based design of the electronic code lock is a small digital system. It has many unique advantages:good p
3、rivacy and security , it do not need the key but remember password to unlock, and so on while it compare to ordinary mechanical locks. At present, the electronic code lock is most used of SCM technology .In practice, however, the process easy run to fly. So the reliability of this system is poor. Th
4、e paper introduced a field programmable gate arrays FPGA devices to design electronic password lock. The VHDL language is used to describe the system and achieved in EP3C10E144C8. Though the simulation tests, using FPGA-based design of the electronic code lock can achieve the expected goal. Of cours
5、e, 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. KeywordKeyword: FPGA; VHDL language; electronic password lock 一、设计内容与要求一、设计内容与要求 1设计一个密码锁,密码为一个 4 位的十进制数,密码固化在锁内 2用户输入密
6、码正确,则开锁(试验箱 D7 LED 灯亮);若不正确,则报警(试验 箱 D0 LED 灯亮) 3若用户输入密码不正确,可以按复位键重新输入密码。 二二、设计思想设计思想 2.1 系统原理框图 本系统由主控芯片(FPGA) ,键盘,显示电路,报警电路和开/关门电路组 成,而主控芯片又可分为按键处理部分,控制部分和译码显示部分。系统原理框 图如图 2.1 所示: 图 2.1 系统框图 2.2 总体实现原理 本系统有 8 个按键,K0,K1,K2,K3,K4,K5 代表数字 0-9 共 10 个数字和 1 个 确认键,1 个复位键。密码长度为四位,并且固化在锁内,输入正确密码后,按 确认键即可开门,本系统设置为 LED D7 灯亮。在输入密码的过程中,当用户键 入错误密码时,报警灯 LED D0 灯亮。按下复位键,可使报警停止,同时清除所 有密码显示。 键盘 按键处理 主控部分 译