




免费预览已结束,剩余11页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
目 录 前言:1 一、设计任务:2二、题目分析与整体构思:3 三、硬件电路设计:4四、程序设计:5五、心得体会:6附录:7参考文献:8前言 EDA(Electronic Design Automation)技术作为现代电子设计技术的核心,它依赖功能强大的计算机,在EDA工具软件平台上,对以硬件描述语言HDL(Hardware Description Language)为系统逻辑描述手段完成的设计文件,自动地完成逻辑编译、逻辑化简、逻辑分割、逻辑综合、结构综合(布局布线),以及逻辑优化和仿真测试,直至实现既定的电子系统功能。EDA技术使得设计者的工作仅限于利用软件的方式,即利用硬件描述语言和EDA软件来完成对系统功能的实现。 电子时钟的设计过程就是一个充分利用EDA软件的过程,利用VHDL语言对硬件进行描述,充分利用软件的逻辑综合与仿真的功能完成对电子时钟的设计,然后将程序写入实验箱,实现其电子时钟的各种功能。一、设计任务1、24小时精准计时 2、十、分、秒可调 3、每逢整点让蜂鸣器鸣叫1秒钟(可以自行发挥加上闹钟设置)二、题目分析与整体构思1、24小时精准计数并显示(1)、电子时钟的小时部分是24进制,时与分之间是60进制,分与秒之间也是60进制,那么要完成电子时钟的正常计数,就需要设计两个60进制计数器和一个24进制计数器,并用合适的端口使他们相连接,以满足24小时的精准计数。(2)、显示部分可以做一个数码管模块,另外为了时、分、秒同时显示,需要做一个扫描仪模块。2、时、分、秒可调 可以在各模块中添加按键设置,以满足这一要求。3、每逢整点让蜂鸣器鸣叫一秒种可以做一个整点报时模块,引出一个合适的脉冲,使之满足每逢整点时报时。4、入下图是电子时钟的整体设计思路。三、硬件电路设计(一)、先用VHDL语言对各个模块进行描述,编译通过后,利用综合仿真系统对其进行时序仿真,然后由程序生成各个模块。1、如图根据程序生成各模块(1)、小时模块和其仿真波形(2)、分钟模块及其仿真波形(3)、秒钟模块及其仿真波形(4)、整点报时模块及其仿真波形(5)、数码管模块及其仿真波形(6)、扫描仪模块2、根据各模块连接电路原理图及其仿真波形(二)、管脚的设定四、程序设计(1)、顶层文件library ieee;use ieee.std_logic_1164.all;entity clock_top isport (clk,reset,setmin,sethour,clkdsp:in std_logic;speaker:out std_logic;lamp:out std_logic_vector(2 downto 0);sel:out std_logic_vector(2 downto 0);a,b,c,d,e,f,g,dp:out std_logic);end clock_top;-*architecture a of clock_top is-*-second counterCOMPONENT secondPORT(clk, reset,setmin: INSTD_LOGIC;daout:out std_logic_vector(6 downto 0);enmin: OUTSTD_LOGIC);END COMPONENT;-*- minute counterCOMPONENT minutePORT(clk, clk1,reset,sethour: INSTD_LOGIC;enhour: OUTSTD_LOGIC;daout:out std_logic_vector(6 downto 0);END COMPONENT;-*-hour counterCOMPONENT hourPORT(clk, reset: INSTD_LOGIC;daout:out std_logic_vector(5 downto 0);END COMPONENT;-*COMPONENT alertPORT(clk: INSTD_LOGIC;dain:in std_logic_vector(6 downto 0);lamp:out std_logic_vector(2 downto 0);speak: OUTSTD_LOGIC);END COMPONENT;-*COMPONENT seltimePORT(clk1, reset: INSTD_LOGIC;sec,min:in std_logic_vector(6 downto 0);hour:in std_logic_vector(5 downto 0);daout:out std_logic_vector(3 downto 0);sel: OUTSTD_LOGIC_vector(2 downto 0);END COMPONENT;-*COMPONENT deledPORT(num: INSTD_LOGIC_vector(3 downto 0);led:out std_logic_vector(6 downto 0);END COMPONENT;-*signal ledout:std_logic_vector(6 downto 0);signal enmin_re,enhour_re: std_logic;signal second_daout,minute_daout:std_logic_vector(6 downto 0);signal hour_daout:std_logic_vector(5 downto 0);signal seltime_daout:std_logic_vector(3 downto 0);-*begina=ledout(0);b=ledout(1);c=ledout(2);d=ledout(3);e=ledout(4);f=ledout(5);g=ledout(6);dpreset,clk=clk,setmin=setmin,enmin=enmin_re,daout=second_daout);u2:minute port map(clk=enmin_re,clk1=clk,reset=reset,sethour=sethour,enhour=enhour_re,daout=minute_daout);u3:hour port map(clk=enhour_re,reset=reset,daout=hour_daout);u4:alert port map(clk=clk,dain=minute_daout,speak=speaker,lamp=lamp);u5:seltime port map(clk1=clkdsp,reset=reset,sec=second_daout,min=minute_daout,hour=hour_daout,daout=seltime_daout,sel=sel);u6:deled port map(num=seltime_daout,led=ledout);end a;(2)、小时模块程序LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY hour ISPORT(clk,reset: INSTD_LOGIC;daout: out std_logic_vector (5 downto 0);END entity hour;ARCHITECTURE fun OF hour ISSIGNAL count: STD_LOGIC_VECTOR( 5 downto 0);BEGIN daout = count; process ( clk,reset) begin if (reset=0) then count = 000000; elsif (clk event and clk=1) then if (count(3 downto 0)=1001) then if (count 16#24#) then count=count + 7; else count=000000; end if; elsif(count 16#24#) then count = count + 1; else count=000000; end if; end if; end process;END fun;(3)、分钟模块程序LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY minute ISPORT(clk, clk1,reset,sethour : INSTD_LOGIC;enhour : OUTSTD_LOGIC;daout: out std_logic_vector (6 downto 0);END entity minute;ARCHITECTURE fun OF minute ISSIGNAL count: STD_LOGIC_VECTOR( 6 downto 0);BEGIN daout = count; process ( clk,reset,sethour) begin if (reset=0) then count = 0000000; elsif (sethour=0) then enhour = clk1; elsif (clk event and clk=1) then if (count(3 downto 0)=1001) then if (count 16#60#) then if (count=1011001) then enhour=1; count=0000000; ELSE count=count+7; end if; else count=0000000; end if; elsif(count 16#60#) then count = count + 1; enhour=0 after 100 ns; else count=0000000; end if; end if; end process;END fun;(4)、秒种模块程序LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY second ISPORT(clk, reset,setmin : INSTD_LOGIC;enmin : OUTSTD_LOGIC;daout: out std_logic_vector (6 downto 0);END entity second;ARCHITECTURE fun OF second ISSIGNAL count: STD_LOGIC_VECTOR( 6 downto 0);BEGIN daout = count; process ( clk , reset , setmin) begin - enmin=k; if (reset=0) then count = 0000000; elsif (setmin=0) then enmin = clk; elsif (clk event and clk=1) then if (count(3 downto 0)=1001) then if (count 16#60#) then if (count=1011001) then enmin=1; count=0000000; ELSE count=count+7; end if; else count=0000000; end if; elsif (count 16#60#) then count = count+1; enmin=0 after 100 ns; else count=0000000; end if; end if; end process;END fun;(5)、整点报时模块程序LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY alert ISPORT(clk : INSTD_LOGIC;dain : INSTD_LOGIC_VECTOR(6 DOWNTO 0);speak: OUTSTD_LOGIC);END alert ;ARCHITECTURE fun OF alert ISsignal count : std_logic_vector( 1 downto 0);signal count1: std_logic_vector( 1 downto 0);BEGINspeaker:process (clk)begin speak =10) then count1=00;elsecount1 = count1 + 1;end if; end if;end if;end process speaker;END fun ;(6)、数码管模块程序LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ENTITY deled ISPORT(num: INstd_logic_vector( 3 downto 0); led: OUT std_logic_vector(6 downto 0);END deled;ARCHITECTURE fun OF deled ISBEGIN led = 1111110 when num= 0000 else 0110000 when num= 0001 else 1101101 when num= 0010 else 1111001 when num= 0011 else 0110011 when num= 0100 else 1011011 when num= 0101 else 1011111 when num= 0110 else 1110000 when num= 0111 else 1111111 when num= 1000 else 1111011 when num= 1001 else 1110111 when num= 1010 else 0011111 when num= 1011 else 1001110 when num= 1100 else 0111101 when num= 1101 else 1001111 when num= 1110 else 1000111 when num= 1111 ;END fun;(7)、扫描仪模块程序LIBRARY ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;ENTITY seltime ISPORT(clk1, reset: INSTD_LOGIC;sec,min : INSTD_LOGIC_VECTOR(6 downto 0);hour : in std_logic_vector (5 downto 0);daout: OUTSTD_LOGIC_vector (3 downto 0);sel : out std_logic_vector ( 2 downto 0);END seltime;ARCHITECTURE fun OF seltime ISSIGNAL count: STD_LOGIC_vector ( 2 downto 0);BEGIN sel = count; process ( clk1,reset) begin if (reset =0) then count = 101) then count = 000; else count daout daout(3) = 0; daout(2
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年度物业服务合同范本
- 2025公寓式酒店客房租赁协议(合同样本)
- 2024年煤炭生产经营单位开采爆破安全管理人员试题及答案
- 2025年消防执业资格考试题库:消防设施检测与维护消防设备操作技能试题
- 2025调研服务合同协议书范本
- 2025年育婴师职业技能大赛模拟试卷:育婴师婴幼儿化学培养试题
- 2025年大学辅导员招聘考试题库:学生职业生涯规划中的心理辅导试题
- 2025年统计学期末考试:数据可视化在地理信息系统中的应用试题
- 2025年统计学专业期末考试题库:抽样调查方法与样本量计算试题
- 2025年安全生产有限空间作业安全防护设备试题型
- 银行安全用电知识培训课件
- 2025鄂尔多斯市国源矿业开发有限责任公司社会招聘75人笔试参考题库附带答案详解
- 2025年解除租赁合同协议书
- 工业废水零排放技术解决方案创新创业项目商业计划书
- 黄冈市2025年高三年级9月调研考试(一模)生物试卷(含答案)
- 人工搬运培训课件
- 2025年哈尔滨投资集团有限责任公司校园招聘笔试备考题库含答案详解(精练)
- DB4406∕T 47-2024 养老机构安全风险管理规范
- 城乡垃圾压缩站建设施工组织设计方案
- 安徽省合肥市六校联考2025-2026年高三上学期开学考试语文试卷(含答案)
- 医院住院综合大楼项目监理大纲
评论
0/150
提交评论