EDA课程设计数字秒表(共11页).doc

上传人:飞****2 文档编号:13911299 上传时间:2022-05-01 格式:DOC 页数:11 大小:672KB
返回 下载 相关 举报
EDA课程设计数字秒表(共11页).doc_第1页
第1页 / 共11页
EDA课程设计数字秒表(共11页).doc_第2页
第2页 / 共11页
点击查看更多>>
资源描述

《EDA课程设计数字秒表(共11页).doc》由会员分享,可在线阅读,更多相关《EDA课程设计数字秒表(共11页).doc(11页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、精选优质文档-倾情为你奉上课 程 设 计题 目 数字秒表设计 院 系 信息工程学院 班级 姓名 指导教师 专心-专注-专业目录第一章 :系统设计要求.3第二章 :实验目的.3第三章 :实验原理.3第四章 :系统设计方案.3第五章 :主要VHDL源程序.4 1) 十进制计数器的VHDL源程序.42) 六进制计数器的VHDL源程序.5 3)蜂鸣器的VHDL源程序.5 4)译码器的VHDL源程序.65)控制选择器的VHDL源程序.76)元原件例化的VHDL源程序.8第六章:系统仿真.10第七章:系统扩展思路.11第八章:设计心得总结.11数字秒表的设计一、 系统设计要求 1.秒表共有6个输出显示,分

2、别为百分之一秒、十分之一秒、秒、十秒、分、十分,所以共有6个计数器与之相对应,6个计数器的输出全都为BCD码输出,这样便于和显示译码器的连接。当计时达60分钟后,蜂鸣器鸣响10声。 2.整个秒表还需有一个启动信号和一个归零信号,以便秒表能随意停止及启动。 3.秒表的逻辑结构较简单,它主要由显示译码器、分频器、十进制计数器、六进制计数器和报警器组成。在整个秒表中最关键的是如何获得一个精确的100HZ计时脉冲。二、 实验目的通过本次课设,加深对EDA技术设计的理解,学会用Quartus工具软件设计基本电路,熟练掌握VHDL语言,为以后工作使用打下坚实的基础。三、 实验原理秒表由于其计时精确,分辨率

3、高(0.01秒),在各种竞技场所得到了广泛的应用。秒表的工作原理与数字时基本相同,唯一不同的是秒表的计时时钟信号,由于其分辨率为0.01秒,所以整个秒表的工作时钟是在100Hz的时钟信号下完成。当秒表的计时小于1个小时时,显示的格式是mm-ss-xx(mm表示分钟:059;ss表示秒:059;xx表示百分之一秒:099),当秒表的计时大于或等于一个小时时,显示的和多功能时钟是一样的,就是hh-mm-ss(hh表示小时:099),由于秒表的功能和钟表有所不同,所以秒表的hh表示的范围不是023,而是099,这也是和多功能时钟不一样的地方。在设计秒表的时候,时钟的选择为100Hz。变量的选择:因为

4、xx(0.01秒)和hh(小时)表示的范围都是099,所以用两个4位二进制码(BCD码)表示;而ss(秒钟)和mm(分钟)表示的范围是059,所以用一个3位的二进制码和一个4位的二进制码(BCD)码表示。显示的时候要注意的问题就是小时的判断,如果小时是00,则显示格式为mm-ss-xx,如果小时不为00,则显示hh-mm-ss。四、 系统设计方案秒表的逻辑结构较简单,它主要由显示译码器、分频器、十进制计数器、六进制计数器和报警器组成。四个10进制计数器:用来分别对百分之一秒、十分之一秒、秒和分进行计数;两个6进制计数器:用来分别对十秒和十分进行计数;分频器:用来产生100HZ计时脉冲;显示译码

5、器:完成对显示的控制。 根据电路持点,用层次设计概念将此设计任务分成若干模块,规定每一模块的功能和各模块之间的接口。按适配划分后的管脚定位,同相关功能块硬件电路接口连线。用VHDL语言描述所有底层模块。清零信号为异步清零。当最高位记到6时 停止计数 显示译码器全部显示零,并发出十声警报声。按下复位按钮后继续计数。数字秒表拟由单片的CPLD/FPGA来实现,经分析设计要求,拟定整个系统由10个模块组成,原理图如下:五、 主要VHDL源程序1. 十进制计数器的VHDL源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_uns

6、igned.all;entity count10 isport (clk,start,clr : in std_logic;cout : out std_logic;daout : out std_logic_vector(3 downto 0);end count10;architecture one of count10 issignal q0 : std_logic_vector(3 downto 0);signal q1 : std_logic;beginprocess(clk,clr)beginif clr=1 then q0=0000;elsif ( clkevent and cl

7、k=1) thenif start=1 then if q0=1001 then q0=0000;q1=1; else q0=q0+1;q1=0; end if;end if;end if;end process;daout= q0;cout=q1;end one;2. 六进制计数器的VHDL源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count6 isport (clk,start,clr : in std_logic;cout : out std_logic;daout

8、 : out std_logic_vector(3 downto 0);end count6;architecture two of count10 issignal q0 : std_logic_vector(3 downto 0);signal q1 : std_logic;beginprocess(clk,clr)beginif clr=1 then q0=0000;elsif ( clkevent and clk=1) thenif start=1 then if q0=0101 then q0=0000;q1=1; else q0=q0+1;q1=0; end if;end if;e

9、nd if;end process;daout= q0;cout=q1;end two;3. 蜂鸣器的VHDL源程序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:integer range 0 to 20;signal q0:std_logic;beginprocess(clk)begin

10、if clkevent and clk=1thenif i=0 then q0=0;n=0;elsif n=19 and i=1 thenq0=not q0;n=n+1;else q0=0;end if;end if;end process;qledledledledledledledledledledled=; end case; end process; end a;5. 控制选择器的VHDL源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity seltime isport(cl

11、r,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 a of seltime is signal temp:integer range 0 to 5;begin process(clk) begin if (clr=1) then daout=0000; sel=000;

12、temp=0; elsif (clk=1and clkevent) then if temp=5 then temp=0; else tempsel=000;daoutsel=001;daoutsel=010;daoutsel=011;daoutsel=100;daoutsel=101;daout=dain5; end case; end if; end process;end a;6. 分频器的VHDL源程序library ieee;use ieee.std_logic_1164.all;entity div isport(clr,clk: in std_logic; q: buffer s

13、td_logic);end div;architecture a of div is signal count:integer range 0 to 99999; beginprocess(clr,clk)beginif (clkevent and clk=1) thenif clr=1 thencount=0;elsif count=99999 thencount=0;q= not q;elsecount=count+1;end if;end if;end process;end a;7. 元原件例化的VHDL源程序library ieee;use ieee.std_logic_1164.a

14、ll;entity mb_top isport ( stop,start,clk:in std_logic; a,b,c,d,e,f,g,speaker:out std_logic; sel:out std_logic_vector(2 downto 0);end mb_top;architecture a of mb_top iscomponent divport(clr,clk: in std_logic; q: buffer std_logic);end component;component count10port( clr,start,clk:in std_logic; cout:o

15、ut std_logic; daout:buffer std_logic_vector(3 downto 0);end component;component count6 port( clr,start,clk:in std_logic; cout:out std_logic; daout:buffer std_logic_vector(3 downto 0);end component;component seltimeport( clr,clk:in std_logic; dain1:in std_logic_vector(3 downto 0); dain2:in std_logic_

16、vector(3 downto 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 deledport( num:in std_l

17、ogic_vector(3 downto 0); led:out std_logic_vector(6 downto 0);end component;component alarmport( clk,i:in std_logic; q:out std_logic);end component;signal div_q,b_cout,s_cout,m_cout,sm_cout,f_cout,sf_cout:std_logic;signal b_daout,s_daout,m_daout,sm_daout,f_daout,sf_daout,seltime_daout:std_logic_vect

18、or(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:div port map(stop,clk,div_q);u2:count10 port map(stop,start,div_q,b_cout,b_daout);u3:count10 port map(stop,start,b_cout,s_cout,s_daout);u4:count10 por

19、t map(stop,start,s_cout,m_cout,m_daout);u5:count6 port map(stop,start,m_cout,sm_cout,sm_daout);u6:count10 port map(stop,start,sm_cout,f_cout,f_daout);u7:count6 port map(stop,start,f_cout,sf_cout,sf_daout);u8:seltime port map(stop,div_q,b_daout,s_daout,m_daout,sm_daout,f_daout,sf_daout,sel,seltime_da

20、out);u9:deled port map(seltime_daout,ledout);u10:alarm port map(div_q,sf_cout,speaker);end a;六、 系统仿真1. 十进制2. 六进制3. 蜂鸣器4. 译码器5. 控制选择器七、 系统扩展思路根据实验的内容可以适当的添加一些有实际作用和可行性的功能,如可以记录并显示多个数据。根据扩展的内容设计相应的电路和模块来完成扩展的内容。比如记录和显示多个数据,可以用多个秒表进行计数,在秒表电路的后面可以添加一个选择电路,运用选择电路选择需要输出的那个秒表的数值。八、 设计心得及体会通过此次课程设计,让我对EDA这门

21、技术有了更深的体会,并更好的学会了使用Quartus软件进行硬件设计。在编写程序的过程中,遇到了很多问题,使我发现自己以前学习上存在的不足。通过与同学探讨和请教老师,终于把问题都解决了,并加深了对数字时钟原理和设计思路的了解。同时我也掌握了做课程设计的一般流程,为以后的电子设计这块积累了一定的经验,为以后从事相关工作有一些帮助。最终解决了问题,攥写成报告。通过对设计对实现和对报告对撰写,深深体会到了VHDL语言和EDA技术的一些技巧和设计思想,在完成设计的过程中,应该具有很清晰地思路,才可以使电路更完美和简便,要敢想敢做但是不应该有投机取巧的心理。在完成每一步的时候都有意想不到的收获也有可能导

22、致错误,所以在设计对过程中要集中精神。在写报告的过程中,更加凸显了细心二字。不可自认为完美,必须按照格式要求来撰写自己的报告,所以必须做到足够的精确。利用EDA工具,电子设计师可以从概念、算法、协议等开始设计电子系统,大量工作可以通过计算机完成,并可以将电子产品从电路设计、性能分析到设计版图的整个过程的计算机上自动处理完成。在进行设计时并不束缚设计者的想象力,这使得自学、扩展也可以很容易实现。在设计中充分的认识到EDA课程对硬件设计的重要性,若把本门课程学好、学精,对硬件设计将有很大对帮助。以后若有机会我将会利用更多时间来学习EDA技术、更加深入的学习EDA技术。EDA技术以其独有的优点和应用范围有着非常好的发展前景,是近几年电子工业的发展趋向,中国的EDA行业发展十分迅速,有着很大的潜力。所以我们学好这门课程是十分必要的,我们不应该仅仅拘泥于一门课程的学习,要结合各学科的连接点,把我们的知识串联起来。为我们的未来做好知识储备。以上就我关于这次课程设计的想法,在以后,我会用更多的时间去了解EDA。并且提高自己的知识水平。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁