




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、北 华 航 天 工 业 学 院EDA技术综合设计课程设计报告报告题目: 数字秒表设计 作者所在系部: 电子工程系 作者所在专业: 自动化专业 作者所在班级: 作 者 姓 名 : 指导教师姓名: 完 成 时 间 : 2011年12月2日 6 / 17内 容 摘 要应用VHDL语言设计数字系统,很多设计工作可以在计算机上完成,从而缩短了数字系统的开发时间。我们尝试利用VHDL为开发工具设计数字秒表。秒表的逻辑结构较简单,它主要由十进制计数器、六进制计数器、数据选择器、和显示译码器等组成。在整个秒表中最关键的是如何获得一个精确的100HZ计时脉冲,除此之外,整个秒表还需有一个启动信号和一个清零信号,
2、以便秒表能随意停止及启动。 秒表有共有6个输出显示,分别为百分之一秒、十分之一秒、秒、十秒、分、十分,所以共有6个计数器与之相对应,6个计数器的输出全都为BCD码输出,这样便与同显示译码器连接。关键词: VHDL,数字钟,MAX+plusII,时序仿真图。 目 录1、 实验目的1二、硬件要求1三、方案论证1四、模块说明11. 六进制计数器12. 十进制计数器23. 蜂鸣器34. 译码器45. 控制器56. 顶层文件8五、整体连接图9六、实验步骤10七、实验结果10八、实验总结10九、参考文献10 课程设计任务书课题名称数字秒表完成时间12.02指导教师职称学生姓名班 级总体设计要求和技术要点设
3、计要求:秒表共有6个输出显示,分别为百分之一秒、十分之一秒、秒、十秒、分、十分,所以共有6个计数器与之相对应,6个计数器的输出全都为BCD码输出,这样便于和显示译码器的连接。当计时达60分钟后,蜂鸣器鸣响10声。除此之外,整个秒表还需有一个启动信号和一个归零信号,以便秒表能随意停止及启动。设计要点:秒表的逻辑结构较简单,它主要由显示译码器、分频器、十进制计数器、六进制计数器和报警器组成。在整个秒表中最关键的是如何获得一个精确的100HZ计时脉冲。工作内容及时间进度安排工作内容:在软件上编辑、编译程序,并仿真到达实验要求。进度安排;课下编写程序,并要求程序能通过编译仿真;第十四周的周三在实验板上
4、下载调试程序;周四课设答辩课程设计成果1与设计内容对应的软件程序2课程设计报告书3成果使用说明书一、 实验目的 学习使用VHDL语言,以及EDA芯片的下载仿真二、硬件要求(1)主芯片EPF10K10LC84-4。(2)蜂鸣器。(3)8位八段扫描共阴极数码显示管。(4)二个按键开关(清零,开始)。三、方案论证数字秒表计时控制电路控制状态机计时电路显示电路分频电路计数器六进制计数器扫描电路七段译码器十进制计数器 系统组成框图四、模块说明时钟的设计共化分为6个模块:六进制计数器(count6),十进制计数器(count10),报警电路(bs),扫描电路(seltime),译码电路(ym)。下面具体分
5、析各个模块的原理、内容和功能。(1)六进制计数器(count6)能够实现6进制循环计数,带有清零端stop、开始端start、时钟信号端clk、其文本语言(文件名:count6.vhd)为底层文本,图1为六进制计数器的仿真波形图。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count6 is port (clk,clr,start:in std_logic; daout:out std_logic_vector(3 downto 0); cout:buffer std_logic
6、 );end count6;architecture behave of count6 is signal temp:std_logic_vector(3 downto 0);beginprocess(clk,clr) begin if clr='1' then temp<="0000" cout<='0' elsif clk'event and clk='1' then if start='1'then if temp="0101" then temp<=&quo
7、t;0000" cout<='1' else temp<=temp+1;cout<='0' end if; elsif start='0' then temp<=temp;cout<=cout; end if; end if; end process;daout<=temp; end behave;图1. 六进制计数器的仿真波形(2)十进制计数器(COUNT10)能够实现10进制循环计数,带有清零端stop、开始端start、时钟信号端clk、其文本语言(文件名:COUNT10.vhd)为底层文本,图
8、2为十进制计数器的仿真波形图library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count10 is port (clk,clr,start:in std_logic; daout:out std_logic_vector(3 downto 0); cout:buffer std_logic );end count10;architecture behave of count10 is signal temp:std_logic_vector(3 downto 0);beginproce
9、ss(clk,clr) begin if clr='1' then temp<="0000" cout<='0' elsif clk'event and clk='1' then if start='1'then if temp="1001" then temp<="0000" cout<='1' else temp<=temp+1; cout<='0' end if; elsif start=&
10、#39;0' then temp<=temp;cout<=cout; end if; end if; end process;daout<=temp; end behave;图2. 十进制分计数器的仿真波形(3)蜂鸣器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity alarm isport(clk,I:in std_logic; q:out std_logic );end alarm;architecture ar of alarm issignal n:i
11、nteger range 0 to 20;signal q0:std_logic;beginprocess(clk)begin if clk'event and clk='1' thenif i='0' then q0<='0'n<=0;else if n<=19 then q0<=not(q0);n<=n+1;else q0<='0'n<=0;end if;end if;end if;end process;q<=q0;end ar;(4)译码器library ieee;
12、use ieee.std_logic_1164.all; entity ym is port(num:in std_logic_vector(3 downto 0); led:out std_logic_vector(6 downto 0); end ym ; architecture a of ym is begin process(num) begin case num is when"0000"=>led<="0111111" when"0001"=>led<="0000110" wh
13、en"0010"=>led<="1011011" when"0011"=>led<="1001111" when"0100"=>led<="1100110" when"0101"=>led<="1101101" when"0110"=>led<="1111101" when"0111"=>led<=&quo
14、t;0100111" when"1000"=>led<="1111111" when"1001"=>led<="1101111" when others=>led<="0000000" end case; end process; end a;(5)控制器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity seltime is port(clr
15、,clk: in bit; dain0,dain1,dain2,dain3,dain4,dain5: in std_logic_vector(3 downto 0); sel: out std_logic_vector(2 downto 0); daout: out std_logic_vector(3 downto 0);end seltime;architecture b of seltime is signal temp:integer range 0 to 5;begin process(clk) begin if clr='1' then daout<=&quo
16、t;0000";sel<="000";temp<=0; else if clk'event and clk='1' then if temp=5 then temp<=0; else temp<=temp + 1; end if; end if; case temp is when 0=>sel<="000"daout<=dain0; when 1=>sel<="001"daout<=dain1; when 2=>sel<=&qu
17、ot;010"daout<=dain2; when 3=>sel<="011"daout<=dain3; when 4=>sel<="100"daout<=dain4; when 5=>sel<="101"daout<=dain5; end case; end if; end process;end b;(6)整个的例话语句library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;us
18、e ieee.std_logic_unsigned.all;entity chengpin isport( stop,clk,clk2,start:in std_logic; sel :out std_logic_vector(2 downto 0); a,b,c,d,e,f,g :out std_logic; speak :out std_logic);end chengpin;architecture c of chengpin iscomponent count10 port( clk,clr,start: in std_logic; daout :out std_logic_vecto
19、r(3 downto 0); cout :out std_logic);end component;component count6 port( clk,clr,start:in std_logic; daout :out std_logic_vector(3 downto 0); cout :out std_logic);end component;component seltime port( clr,clk :in std_logic; dain1 :in std_logic_vector(3 downto 0); dain2 :in std_logic_vector(3 downto
20、0); dain3 :in std_logic_vector(3 downto 0); dain4 :in std_logic_vector(3 downto 0); dain5 :in std_logic_vector(3 downto 0); dain6 :in std_logic_vector(3 downto 0); sel :out std_logic_vector(2 downto 0); daout :out std_logic_vector(3 downto 0);end component;component alarm port( clk,i :in std_logic;
21、q :out std_logic);end component;component ym port( num :in std_logic_vector(3 downto 0); led :out std_logic_vector(6 downto 0);end component;component cfq port( clk,d :in std_logic; y :out std_logic);end cfq;beginsignal count_cout :std_logic_vector(6 downto 0);signal daout1,daout2,daout3,daout4,daou
22、t5,daout6,daout7:std_logic_vector(3 downto 0);signal ledout :std_logic_vector(6 downto 0);begina=>ledout(0);b=>ledout(1);c=>ledout(2);d=>ledout(3);e=>ledout(4);f=>ledout(5);g=>ledout(6);u1: count10 port map(clk,stop,start,daout1,count_cout(0);u2: count10 port map(count_cout(0),s
23、top,start,daout2,count_cout(1);u3: count10 port map(count_cout(1),stop,start,daout3,count_cout(2);u4: count6 port map(count_cout(2),stop,start,daout4,count_cout(3);u5: count10 port map(count_cout(3),stop,start,daout5,count_cout(4);u6: count6 port map(count_cout(4),stop,start,daout6,count_cout(5);u7:
24、cfq port map(clk2,count_cout(5),count_cout(6);u7:seltime port map(stop,clk,daout1,daout2,daout3,daout4,daout5,daout6,sel,daout7);u8: ym port map(daout7,ledout);u9: alarm port map(clk,count_cout(6),speak);end c;五、数字钟的整体连接图9 图6. 数字钟各个模块连接示意图六、实验步骤(1)安装MAX+plus软件,为本项设计建立文件夹。(2)输入设计项目的各个模块,存盘检查,编译并仿真至无误。(3)调用底层文件的各个模块,连接整体原理图,进行存盘检查,编译仿真至无误。(4)将PC机与试验箱进行连接选择器件并锁定引脚,然后进行编译下载。(5)按照锁定好的引脚进行连线,进行硬件测试,验证仿真和测试结果。七、实验结果 通过硬件测试,得到如下测试结果:(1)数码管能够正确显示时钟数字。(2)给复位端(reset)低电平时,能够进行复位。(3)给手动调时(sethour)调分(setmin)信号端
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年智慧港口自动化装卸设备市场应用与产业链分析报告
- 2024年水利水电考试复习畅谈试题及答案
- 2024年阜新高等专科学校单招职业技能测试题库及解析答案
- 行政管理学解题方法试题及答案
- 行政管理重要概念试题及答案
- 行政管理心理学考试指南试题及答案
- 年产20万吨生化水项目可行性研究报告
- 2025年建筑工程考试年终试题及答案
- 基因检测在环境监测中的实际应用与市场前景分析报告
- 公文写作小技巧应对试题及答案
- 工程造价咨询服务投标方案(技术方案)
- 网络传播概论(第5版)课件 第9、10章 网络重塑的文化、网络时代新的社会特征
- 癌症患者生活质量量表EORTC-QLQ-C30
- 14.促织《变形记》联读教学设计 2023-2024学年统编版高中语文必修下册
- 闽教版(2020版)三年级下册信息技术整册教案
- GB/T 20290-2024家用电动洗碗机性能测试方法
- 一般工商贸(轻工)管理人员安全生产考试题库(含答案)
- LNG卸车操作和储罐安全培训试题及答案
- 2024届上海市上海师大附中高一下数学期末检测模拟试题含解析
- 医院培训课件:《PPD试验》
- 英文版中国故事绘本愚公移山
评论
0/150
提交评论