EDA数字电子钟课程报告.doc_第1页
EDA数字电子钟课程报告.doc_第2页
EDA数字电子钟课程报告.doc_第3页
EDA数字电子钟课程报告.doc_第4页
EDA数字电子钟课程报告.doc_第5页
免费预览已结束,剩余9页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

课 程 设 计 报 告课程名称:EDA课程设计专 业:测控技术与仪器班 级:测 控 一 班指导老师:同组成员:2011年12月数字电子钟设计摘要:本课程设计侧重于逻辑电路设计同时采用VHDL硬件描述语言辅助完成对数字电子钟电路的功能仿真。在设计过程中,重点探讨了数字电子时钟的设计思路和功能模块的划分,对设计过程中出现的问题详细进行分析。系统主要由五个模块组成:时钟脉冲模块、计时模块、译码显示模块、复位模块、校时模块。关键词:数字电子钟 VHDL 功能模块一系统设计内容及要求1.系统设计内容(1)根据电路特点,用层次设计概念,将此设计任务分成若干模块,规定每一模块的功能和各模块之间的接口,同时加深层次化设计概念;(2)软件的元件管理深层含义,以及模块元件之间的连接概念,对于不同目录下的同一设计,如何融合;(3)适配划分前后的仿真内容有何不同概念,仿真信号对象有何不同,有更深一步了解;(4)按适配划分后的引脚锁定,同相关功能模块硬件电路的接口连线;(5)所有模块采用VHDL硬件描述语言设计。2.系统设计要求设计一台能显示时、分、秒的数字电子钟,具体要求如下:(1) 由试验箱上的时钟信号经分频产生秒计数脉冲;(2) 时计数器用24进制计时电路,分、秒计数器用60进制计分、计秒电路;(3) 可手动校时,能分别进行时、分的校正;(4) 能实现整点报时功能。二.系统硬件设计1.系统设计思路要实现一个数字电子时钟系统,整个系统由主要模块电路和外部输入输出端口以及显示模块组成。首先分别实现单个模块的功能,然后再通过级联组合的方式实现对整个系统的设计。其中,主要模块有五个,包括脉冲信号产生模块、时间计数模块(计数模块又分为时计数模块、分计数模块、秒计数模块) 、译码显示模块、复位模块和校时模块。各个模块先用EDA技术中的VHDL语言编程仿真,再生成各个模块的模拟元件,最后根据设计连接电路生成顶层原理图文件实现数字电子钟系统。2.整体设计方案框架图译码显示复位模块计时模块校时模块时钟脉冲 图1-13.顶层文件原理图图1-24.时序仿真及分析 图1-3时序仿真分析:程序仿真主要由计数器完成,在时钟脉冲作用下,完成始终功能,由时序图可以看出每个时钟上升沿到来时加一,当接受到REST信号,即REST为高电平,所有计数为零,并重新计数,SETMIN 和SETHOUR可以完成调节时钟功能,都是高电平调节,每来一个脉冲,相应的时或分加1。三系统电路模块设计1.分频模块FENPIN设计模块FENPIN原理图如下:图1-4FENPIN源程序:8library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenpin isport(clk:in std_logic;clk1:out std_logic);end;architecture one of fenpin issignal a:std_logic_vector(8 downto 0);signal b:std_logic;beginprocess(clk)beginif clkevent and clk=1 thenif a=100000000 thenb=1;a=000000000;elsea=a+1;b=0;end if;end if;end process;clk1=b;end;仿真波形如下: 图1-52秒计数模块SECOND设计模块SECOND原理图如下: 图1-6SECOND源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity second isport (clk1,reset,setmin: in std_logic;daout:out std_logic_vector(6 downto 0);enmin:buffer std_logic);end;architecture two of second issignal d:std_logic_vector(6 downto 0);signal enmin1,enmin2:std_logic;beginprocess(clk1,reset,setmin)beginif reset=1then d=0000000;elsif (clk1event and clk1=1) thenif d16#60# thenif d=1011001 thend=0000000;enmin1=1;else d=d+1;enmin1=0;if d(3 downto 0)=1001 then d=d+7;end if;end if;end if; end if; end process;daout=d;enmin=(enmin1 or enmin2);enmin2=(setmin and clk1);end;仿真波形如下:图1-73.分计数模块MINUTE设计模块MINUTE原理图如下: 图1-8MINUTE源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity minute isport (reset,clk2,sethour,clk1: in std_logic;daout: out std_logic_vector(6 downto 0);enhour:buffer std_logic);end;architecture two of minute issignal d:std_logic_vector(6 downto 0);signal enhour1,enhour2:std_logic;beginprocess(clk2,clk1,reset,sethour)beginif reset=1then d=0000000;elsif (clk2event and clk2=1) thenif d16#60# thenif d=1011001 thend=0000000;enhour1=1;else d=d+1;enhour1=0;if d(3 downto 0)=1001 then d=d+7;end if;end if;end if; end if; end process;daout=d;enhour=(enhour1 or enhour2);enhour2=(sethour and clk1);end;波形仿真如下: 图1-94.时计数模块HOUR设计模块HOUR原理图如下:图1-10HOUR源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity hour isport (reset,clk2: in std_logic;daout: out std_logic_vector (6 downto 0);end;architecture two of hour issignal d:std_logic_vector(6 downto 0);beginprocess(clk2,reset)beginif reset=1then d=0000000;elsif (clk2event and clk2=1) thenif d16#60# thenif d=0100011 thend=0000000;else d=d+1;if d(3 downto 0)=1001 then d=d+7;end if;end if;end if; end if; end process;daout=d;end;波形仿真如下: 图1-115译码模块SHUJUXUANZE设计模块SHUJUXUANZE原理图如下: 图1-12SHUJUXUANZE源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity shujuxuanze isport(clk,reset:in std_logic;second,minute:in std_logic_vector(6 downto 0);hour :in std_logic_vector(6 downto 0);daout:out std_logic_vector(3 downto 0);sel:out std_logic_vector(2 downto 0);end;architecture one of shujuxuanze issignal q: std_logic_vector(2 downto 0);beginprocess(clk,reset,second,minute,hour)beginif reset=1thenq=000;elsif (clkevent and clk=1) then q=q+1;end if;end process;process(q,reset)beginif reset=1thendaoutdaoutdaout(2 downto 0)=second(6 downto 4);daout(3)daoutdaout(2 downto 0)=minute(6 downto 4);daout(3)daoutdaout(2 downto 0)=hour(6 downto 4);daout(3 downto 2)null;end case; end if; end process;selddddddnull;end case; end process;process(d)begincase d iswhen 0000=yyyyyyyyyynull;end case;end process;end;波形仿真如下: 图1-157.报时模块BAOSHI设计模块BAOSHI原理图如下: 图1-16BAOSHI源程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity baoshi isport (clk: in std_logic;d: in std_logic_vector(6 downto 0);speak:out std_logic;lamp:out std_logic_vector(2 downto 0);end;architecture two of baoshi issignal a:std_logic_vector( 2 downto 0);beginprocess(clk)beginif (clkevent and clk=1) thenif d=0000000 thena lamp lamp lamp lamp=000;end case;end if;end if;end process;process(clk)beginif (clkevent and clk=1) thenif d=0000000 thenspeak=1;else speak=0;end if; end if; end process; end;波形仿真如下: 图1-17四调试与下载(1)在MAX+PLUS设计完成如图1-2的顶层原理图文件后,打开软件,点击“file”,选中“Project”,选择“set project to current file”设为工程文件,点击“MAX+PLUS”的“compiler”进行编译,编译无误后,新建“Waveform Editor file”波形仿真文件,点击“Node”中的“Enter Nodes from SNF”,去掉“Group”前面的勾选框,点击“list”将节点添加到右侧选框中,单击“OK”完成节点的导入。点击“MAX+PLUS”下的“Simulator”进行波形仿真;(2)在菜单栏点击“Assign”然后选择“Device”设置硬件,在“Device family”栏中选择“MAX7000S”系列,在“Device”栏中选择“EPM7128SLC84-15”型号,单击“OK”完成设定;(3)单击“Assign”然后选择“Pin/Location/Chip”设定引脚锁定。在“Node Name”栏输入引脚端口名,在“Chip Resource”栏中选中“Pin”输入相应的引脚号。引脚端口名和引脚号设置如下:clk-83,reset-46,sel0-70,sel1-69,sel2-68,sethour-45,setmin-44,y0-81,y1-80,y2-79,y3-77,y4-76.y5-75,y6-74;(4) 单击“file”,选中“project”,选择“set project to current file”设为工程文件,点击“MAX+PLUS”的“Compiler”进行编译,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论