闹钟设计实验报告.docVIP

  • 99
  • 0
  • 约1.54万字
  • 约 15页
  • 2021-08-07 发布于四川
  • 举报
闹钟设计实验报告 院系: 计算机与通信学院 专业: 计算机科学与技术 班级: 01154 班 姓名: 伍晨曦 (13号) 指导老师: 杨 华 实验目的: 学会VHDL语言的并发执行的特点; 熟悉VHDL的一些语法; 初步了解VHDL的编程思路; 内容实验: 一个电子钟.能用数码管显示时间.可以更改时间.可以闹铃.. 具有电子钟得功能.即可以正确的显示时间,可以更改时间.可以在规定的时间内闹铃,闹铃的时间为1分钟.闹铃的时间可调. 三.实验原理 根据VHDL语言编制底层模块,采用基本的图像法来完成顶层的布线,利用VHDL语言编制模块可以省去很多复杂的连线及列写复杂的逻辑函数关系。 其中的时间模块用计数器来模拟.一个24位计数器来模拟小时,两个60位计数器来模拟分钟和秒.其中闹铃里要加一个寄存器来存贮闹铃的设定.显示模块用数码管来显示. 按照本课程设计要求及提供的数字逻辑系统EDA实验设备,思路如下: 设计好小时、分钟、秒钟、按键、寄存器、扫描、闹铃、七段码、二选一、顶层电路的设计。这些模块采用VHDL语言设计,然后生成模块存放在库中供以后调用。采用图形法来设计顶层模块并编译、仿真并下载,生成大模块已完成课程要求。 四:源程序的实现 1.小时的模块: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity hour is port( clk :in std_logic; ho2,ho1 :out std_logic_vector(3 downto 0) ); end hour; architecture structure of hour is signal h2_temp :std_logic_vector(3 downto 0); signal h1_temp :std_logic_vector(3 downto 0); begin process(clk) begin if(clkevent and clk=1) then if(h2_temp=0010 and h1_temp=0011)then h2_temp=0000; h1_temp=0000; elsif(h1_temp=1001)then h1_temp=0000; h2_temp=h2_temp+1; else h1_temp=h1_temp+1; end if; end if; ho2=h2_temp; ho1=h1_temp; end process; end structure; 波形图 2.分钟的模块: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity minute is port( clk :in std_logic; cn :out std_logic; ho2,ho1 :out std_logic_vector(3 downto 0) ); end minute; architecture structure of minute is signal h2_temp :std_logic_vector(3 downto 0); signal h1_temp :std_logic_vector(3 downto 0); begin process(clk) begin if(clkevent and clk=1) then if(h2_temp=0101 and h1_temp=1001)then h2_temp=0

文档评论(0)

1亿VIP精品文档

相关文档