基于vhdl的密码锁设计内容摘要:

case a is when 00 = p1=c。 当 a 为 0 时,将 c 的值赋给 p1。 when 01 = p2=c。 当 a 为 1 时,将 c 的值赋给 p2。 when 10 = p3=c。 当 a 为 2 时,将 c 的值赋给 p3。 when 11 = p4=c。 当 a 为 3 时,将 c 的值赋给 p4。 end case。 end if。 end process t1。 t2: process(b,esc) begin if esc=39。 039。 then 当 esc 为低电平时, a 赋值为 11。 a=11。 elsif b39。 event and b=39。 139。 then a=a+1。 当 b 为高电平时, a 为 a+1。 end if。 end process t2。 end behave。 当按下键盘时, a 为高电平,键盘输入一个值,此时输入的值存储在 c 中,当 b 为低电平时,根据 a 对应的取值,给对应的 p 赋值。 基于 VHDL 的密码锁设计 12 主控制 模块 程序 LIBRARY IEEE。 USE。 USE。 USE。 ENTITY xia IS PORT( vc,m,enter,esc: IN STD_LOGIC。 m 为密码锁修改控制键,高电平有效。 key: IN STD_LOGIC_VECTOR(15 DOWNTO 0)。 l: buffer STD_LOGIC l 为输出控制键,高电平有效,为高电平时,密码锁打开。 )。 END ENTITY xia。 ARCHITECTURE behave OF xia IS SIGNAL keyin:STD_LOGIC_VECTOR(15 DOWNTO 0)。 16 位二进制密码输入。 BEGIN process (enter,esc,vc) begin if (vc=39。 139。 ) then keyin=1000011100110000。 当 vc 为 1 时,初始密码为8730。 elsif (esc=39。 039。 ) THEN l=39。 039。 当 esc 为低电平时, l 为 0。 elsif (enter39。 event and enter=39。 139。 and m=39。 139。 and l=39。 139。 ) then keyin=key。 当 m 为 1 时,修改密码。 elsif (enter39。 event and enter=39。 139。 and m=39。 039。 and l=39。 039。 ) then if key=keyin then 当 m 为 0 时,判定输入密码。 l=39。 139。 else l=39。 039。 end if。 end if。 end process。 end behave。 当 vc 为 1 时,初始密码为 8730,此时若输入密码正确,打开密码锁,此时 l 为 m 为 1 时,此时为修改密码状态,此时可以输入新的密码,按 esc 键退出,密码设置结束。 基于 VHDL 的密码锁设计 13 第四章 密码锁的仿真结果 密码判断仿真结果 图 41 密码锁判断仿真结果 如图 41 所示,初始密码为 8730,开始密码输入为 0000,密码锁没有打开, l 为 0。 当 m 为 1 时,因为密码锁没有打开,所以即使密码锁修改键为高电平,此时无法修改密码。 当 esc 为低电平时,此时从新输入, m 为 0,为输入验证阶 段,此时输入为 8730,与初始密码一致,密码锁打开, l 为 1. 密码修改判断仿真结果 图 42 密码锁修改判断仿真结果 基于 VHDL 的密码锁设计 14 如图 42 所示,初始密码设为 0000,当 enter 为 1 时,此时输入为初始密码状态,密码锁打开, l 为 1。 当 m 为 1 时,此时修改密码,将密码设为 8739,然后按 esc 退出键。 若在输入密码 8739,则密码锁打开, l 为 1. 基于 VHDL 的密码锁设计 15 第五章 总结 毕业设计马上就要结束了,意味着大学生涯的结束。 在做毕业设计的过程中让我学到了很多东西,也知道自己 远远不够好。 还差的很多。 在这几个月的学习中,让我又重新学习了一边 VHDL 语言,也才知道自己之前学的有多差。 通过这次学习让我更进一步的了解 VHDL 语言,我相信这些对我的以后的学习和工作都会起到很大的帮助。 本论文通过 VHDL 语言实现了数字密码锁的设计,该密码锁虽然是有 键盘 输入的,但是可以实现密码位数的自设定。 本程序的重点就在与密码的比较。 通过与自设定的密码相比较,看正确与否。 致谢 行文至此,我的毕业设计就要结束了,我的大学生涯也快画上句号了。 在此次毕业设计的撰写能够顺利结束,要特别感谢那些帮助过我 的人,要谢谢我的导师,本学位论文是在我的导师的细心指导下完成的,从选题到论文的最终定稿,都离不开导师的指导;也要谢谢我的同学,在我遇到难题时给我帮助。 基于 VHDL 的密码锁设计 16 参考文献 [1]刘昌华 . 数字逻辑 EDA 设计与实践: MAX+plus Ⅱ与 Quartus Ⅱ双剑合壁 ,国防工业出版社, 2020:115 [2]侯伯 亨 、 顾新 、 刘凯 .VHDL 硬件描述语言与数字逻辑电路设计 .第 3 版 ,西安电子科技大学出版社, 2020:2225 [3] 杨刚 、 龙海燕 .现代电子技术 :VHDL 与数字系统设计,电子工业出版社, 2020:1213 [4] 刘欲晓 、 方强 、 黄婉宁 .EDA 技术与 VHDL 电路开发应用实践 电子工业出版社,2020:112114 [5] 郑燕 、 郝建国 、 党建华 .基于 VHDL 语言与 Quartus Ⅱ软件的可编程逻辑器件应用与开发 , 2020:98100 [6] (美 ) Kevin VHDL 设计技术,东南大学出版社,1998:100115 [7]王振红 .VHDL 数字电路设计与应用实践教程,机械工业出版社, 2020:2326 [8]张亦华 、 延明 .数字电路 EDA 入门 :VHDL 程序实例集 ,北京邮电大学出版社,2020:5760 [9]刘明业 .集成电路 /计算机硬件描述语 言 VHDL高等教程 ,清华大学出版社, 2020:7698 [10]姜波 、 郭宏 .EDA 技术及应用,哈尔滨工业大学出版社, 2020:3235 [11] James R. Armstrong、 F. Gail Gray. VHDL design representation and synthesis , China Machine Press,2020:0120 [12] Douglas L. :programming by example , McGrawHill, 112 [13] 王道宪 、 贺名臣 、 刘伟 .VHDL 电路设计技术 , 国防工业出版社 2020: 2334 [14] 张太镒 、 宁改娣 、 刘和平 .DSP 技术与应用 , 机械工业出版社 ,2020: 112 基于 VHDL 的密码锁设计 17 附录 1 英文参考资料 To introduce digital circuit definition digital circuit: With the pletion of the digital signal for digital arithmetic and logic operations of puting circuits known as digital circuits, or digital systems. Because of its logic operations and processing logic, therefore, also known as digital logic circuits. Classification of digital logic circuits (according to the functions of points): the bination of logic Referred to as the bination of circuit, which isthe most basic logic gate bination. Characterized by: the output value and only then enter the value, that is, the only output from the input value at the time the decision. No memory circuit, with the input output status of a state of change, similar to the resistance of the circuit, such as the adder, decoder, encoder, data selector and so on, belong to this category. sequential logic circuits Referred to as the timing circuit, which is the most basic logic gates together with the logic of the feedback loop (output to the input) device or a bination of the circuit, with the bination of the na。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。