EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc

上传人:仙人指路1688 文档编号:4146508 上传时间:2023-04-07 格式:DOC 页数:25 大小:280KB
返回 下载 相关 举报
EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc_第1页
第1页 / 共25页
EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc_第2页
第2页 / 共25页
EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc_第3页
第3页 / 共25页
EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc_第4页
第4页 / 共25页
EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc_第5页
第5页 / 共25页
点击查看更多>>
资源描述

《EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc》由会员分享,可在线阅读,更多相关《EDA课程设计(VHDL语言数字秒表的设计)毕业设计(论文)word格式.doc(25页珍藏版)》请在三一办公上搜索。

1、摘要EDA技术作为电子工程领域的一门新技术,极大的提高了电子系统设计的效率和可靠性。本次课程设计就是利用VHDL语言结合硬件电路来实现数字秒表的功能,数字秒表有4个模块构成,分别为分频电路模块,去抖电路模块,时间计数电路模块,显示模块。用VHDL语言编程来实现各个模块的功能,再用原件例化的方法实现各模块之间的连接,从而实现整个数字秒表电路的功能。关键词:EDA,VHDL,数字秒表AbstractThe technology of EDA as a new technology in electronic engineering has greatly improved the efficien

2、cy and reliability of electronic system design. The course design is the use of VHDL language combination of hardware circuitry to achieve digital stopwatch function. Digital Stopwatch is made up of four modules, such as: sub-frequency circuit module, debounce circuit module, counting circuit module

3、 and display module. I used VHDL language programming to achieve the functions of each module and connected each module with the method of original cases to realize the entire digital stopwatch function.Keywords: EDA,VHDL, digital stopwatch1绪论EDA是20实际90年代初以来迅速发展起来的现代电子工程领域的一门新技术。它以可编程逻辑器件(PLD)为载体,以计

4、算机为工作平台,以EDA工作软件为工作环境,以硬件描述语言(HDL)作为电子系统功能描述方式,以电子系统设计为应用方向的电子产品自动化设计过程。在当今以数字化和网络化为特征的信息技术革命大潮中,电子技术得到了飞速发展,现代电子产品渗透到了社会的各个领域。现代电子产品的性能进一步提高,功能越来越复杂,集成化智能化程度越来越高,更新换代的节奏越来越快,开发风险越来越大,而且向着功能多样化,体积小型化,功耗最低化的趋势发展。所有这些都给电子系统的设计带来了前所未有的压力,唯一的出路是熟练掌握EDA技术,并获得其有力支持。EDA技术的出现,极大的提高了电子系统设计的效率和可靠性,减轻了设计者的劳动强度

5、,EDA是电子产品开发研制的动力源和加速器,是现代电子技术的核心。随着基于PLD的EDA技术的发展和应用领域的扩大和深入,它在电子信息,通信工程,自动控制及计算机应用等领域的重要性日益突出。随着电子技术与计算机技术的发展,熟练掌握和应用EDA技术已成为电子类及相关专业学生不可或缺的一项技能,因此本次课程设计突出应用性,以加强学生的工程实践能力和工程设计能力。2 数字秒表的设计2.1 系统设计要求(1)计时精度应大于1/100s,计时器能显示1/100s的时间,提供给计数器内部定时的时钟频率应大于100HZ,这里选用1KHZ。(2)计数器最大计数时间为1小时,为此需要6位的显示器,现实的最长时间

6、为59分59.99秒。(3)设置有复位和起/停开关,复位开关用来使计数器清零,做好计时准备,起停开关的用法和机械开关相同,即按一下,启动计时器开始计时,再按一下计时器停止。2.2 系统设计方案根据系统设计要求,系统的组成框图如图1所示: 数字秒表分频电路去抖电路计时点路显示电路 图1 数字秒表系统组成框图由上图可知:此系统主要由分频电路,去抖电路,计时电路,显示电路四部分组成。3 数字秒表单元模块设计3.1 分频电路在整个系统中需要2个不同的频率,实验室提供的频率不满足要求,所以要进行分频,以得到所需频率。在该模块中分频电路的输入为20MHZ的脉冲,输出为q1=1KHZ,q2=200HZ。该模

7、块电路图如图2所示:图2 分频电路图3.2 去抖电路在数字电路设计中经常采用机械开关作为控制开关,但是机械开关有其固有的确定,如容易引入抖动干扰。为了消除抖动干扰,需要使用防抖电路。在这里的去抖电路是由3个D触发器构成。该模块的电路图如图3所示:图3 去抖电路去抖电路的仿真图如图4所示: 图4 去抖电路的仿真图3.3 计时电路计时电路执行计时功能,计时的方法是对标准时钟脉冲计数。由于计时范围是0秒到59分59.99秒,所以计数器可以由四个十进制计数器和两个六进制计数器构成,其中毫秒位,十毫秒位,秒位和分位采用十进制计数器,十秒位和十分位采用六进制计数器。该部分电路由三个计数器构成,毫秒计数器,

8、秒计数器及分计数器。毫秒计数器电路图如图5所示:图5 毫秒计数器电路图毫秒计数器的仿真图如图6,图7,图8所示:图6 使能一直有效时计数器仿真图图7 使能有效,清零无效时计数器仿真图图8 清零无效时计数器仿真图秒计数器电路图如图9所示:图9 秒计数器电路图 分计数器电路图如图10所示:图10 分计数器电路图由于秒计数器和分计数器的仿真和毫秒计数器类似,所以其结果同上。3.4 显示电路计时显示电路的作用是将计时值在LED七段数码管上显示出来。计时电路产生的计时值经过BCD七段译码后,驱动LED数码管。计时显示电路的实现方案采用扫描显示,每次只驱动一位数码管,各位数据轮流驱动对应的数码管进行显示。

9、由于实验箱上已经由数码管管和译码电路,所以该模块的电路图如图11所示:图11 显示电路电路图4 硬件电路的调试写好程序后在试验箱上利用Quartus软件进行调试,调试步骤如下:1. 创建工程准备工作(1) 新建一个文件夹(2) 输入源程序(3) 文件存盘2. 创建工程3. 编译前设置(1) 选择FPGA芯片(2) 选择配置器件的工作方式(3) 选择配置器件和编程方式(4) 选择目标器件闲置引脚状态4. 全程编译5. 引脚锁定及下载(1) 选择AssignmentsAssignments Editor选择pin(2) 双击Location栏的new,在出现的菜单中选择端口信号名的器件引脚号(3)

10、 存储这些引脚锁定的信息,然后再编译6. 编程下载(1) 打开编辑窗和配置文件(2) 设置编程器(3) 选择编程器(4) 硬件测试5 整体电路图系统的整体电路图如图12所示:图12 系统的整体电路图6 心得体会对于这次课程设计,由于以前做实验的时候已经接触过类似的题目,所以做起来不是很困难,但是还是有一些小问题存在,最后通过查阅相关书籍才解决。在设计过程中,首先要明确实验目的,弄清实验思路,把实验原理详细的表达出来,然后通过查阅资料选取其中的几种设计方案,再根据实验要求和实验的实际可操作性定下最终的设计方案。在设计过程中通过自主独立的发现问题,设计实验,操作,调查,搜集与处理信息等而获得知识,

11、技能的发展。特别是培养了探索精神和创新能力的发展的学习方式和学习过程。这次课程设计的整个过程让我收益良多。在实验过程中学会了对自己的实验进展,实验方法做自我监控,自我反馈和自我调节,在实验的最后学会了对自己的实验结果进行自我检查,自我总结,自我评价和自我补救。对于在课程设计过程中碰到的一些问题,在自己一个人无法独立解决的时候可以通过查阅相关资料或请同学帮忙,在此过程中也培养了团队合作精神。虽然设计过程不是一帆风顺,遇到了很多问题,但整个过程让我学到了很多平时没学到的知识。通过这次设计更进一步的 提高了我的思维能力,动手能力,增强了对电子专业学习的兴趣。希望以此为起点,在以后的学习中能更积极的动

12、脑动手,提高自己的综合能力,为以后的发展打下坚实的基础。参考文献1潘松,黄继业.EDA技术与VHDL.北京:清华大学出版社,20072聂春燕.EDA技术实验与课程设计.北京:清华大学出版社,20063张亦华,延明.数字电路EDA入门.北京:北京邮电大学,20054黄仁欣.EDA技术实用教程.北京:清华大学出版社,20065林明权.VHDL数字控制系统设计范例.北京:电子工业出版社,2003附录数字秒表电路的VHDL源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_lo

13、gic_arith.all;entity miaobiao isport (clk_top:in std_logic; sel1_top,sel2_top:in std_logic; s_out:out std_logic_vector(2 downto 0); y_out:out std_logic_vector(6 downto 0); dp_out:out std_logic);end entity;architecture behave of miaobiao iscomponent fenpin port(clk1: in std_logic; q1,q2,q3: out std_l

14、ogic);end component;component jishu1 port(clk:in std_logic; rst:in std_logic; en:in std_logic; co:out std_logic; x,y:buffer std_logic_vector(3 downto 0);end component;component jishu2 port(clk:in std_logic; rst:in std_logic; en:in std_logic; co:out std_logic; x,y:buffer std_logic_vector(3 downto 0);

15、end component;component jishu3 port(clk:in std_logic; rst:in std_logic; en:in std_logic; x,y:buffer std_logic_vector(3 downto 0);end component;component xuanzeport(a,b,c,d,e,f:in std_logic_vector(3 downto 0); s:out std_logic_vector(2 downto 0); y:out std_logic_vector(6 downto 0); dp:out std_logic; c

16、p:in std_logic);end component; component qudou1port(clk,d1:in std_logic; q1:out std_logic);end component;component qudou2port(clk,d1:in std_logic; q1:out std_logic);end component;signal c1,c2,c3,c4,c5: std_logic;signal m1,m4:std_logic;signal m2,m3,m5,m6,m7,m8: std_logic_vector( 3 downto 0);beginu1:f

17、enpin port map(clk_top,c1,c5,c2);u2:qudou1 port map (c2,sel1_top,c3);u3:qudou2 port map (c2,sel2_top,c4);u4:jishu1 port map(c1,c3,c4,m1,m2,m3);u5:jishu2 port map(m1,c3,c4,m4,m5,m6);u6:jishu3 port map(m4,c3,c4,m7,m8);u7:xuanze port map(m2,m3,m5,m6,m7,m8,s_out,y_out,dp_out,c5);end behave; library ieee

18、;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenpin is generic (datawidth: integer:=17); port(clk1: in std_logic; q1,q2,q3: out std_logic);end fenpin;architecture behave of fenpin issignal count1: std_logic_vector(datawidth-1 downto 0);signal count2: std_logic_vector(datawidth

19、-1 downto 0);signal count3: std_logic_vector(datawidth-1 downto 0);beginp1:processbegin wait until clk1event and clk1=1; if( count1=200000)then count10); else count1=count1+1; if count1100000 then q1=0; else q1=1; end if; end if;end process p1;p2:processbegin wait until clk1event and clk1=1; if( cou

20、nt2=20000)then count20); else count2=count2+1; if count210000 then q2=0; else q2=1; end if; end if;end process p2;p3:processbegin wait until clk1event and clk1=1; if( count3=100000)then count30); else count3=count3+1; if count350000 then q3=0; else q3=1; end if; end if;end process p3;end behave;libr

21、ary ieee;use ieee.std_logic_1164.all;entity qudou1 isport(clk,d1:in std_logic; q1:out std_logic);end entity;architecture behave of qudou1 issignal a,b,c:std_logic;beginprocess(clk,a,b,c)beginif clkevent and clk=1 then a=d1;b=a;c=b; q1=a or b or c; end if;end process;end behave;library ieee;use ieee.

22、std_logic_1164.all;entity qudou2 isport(clk,d1:in std_logic; q1:out std_logic);end entity;architecture behave of qudou2 issignal a,b,c:std_logic;beginprocess(clk,a,b,c)beginif clkevent and clk=1 then a=d1;b=a;c=b; q1=a or b or c; end if;end process;end behave;library ieee;use ieee.std_logic_1164.all

23、;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity jishu1 is port(clk:in std_logic; rst:in std_logic; en:in std_logic; co:out std_logic; x,y:buffer std_logic_vector(3 downto 0);end entity;architecture a of jishu1 issignal qn,qo: std_logic_vector(3 downto 0);signal ce: std_logic;beg

24、inprocess(clk,rst,en,qo,qn)begin if rst=1 then qn=0000; elsif (clkevent and clk=1 and en=1) then if(qn=1001) then qn=0000; ce=1; else qn=qn+1;ce=0; end if; end if;x=qn;end process;process(ce,rst,en,qo)beginif rst=1 then qo=0000;elsif (ceevent and ce=1 and en=1) then if(qo=1001)then qo=0000 ;co=1; el

25、se qo=qo+1; co=0;end if;end if;y=qo;end process;end a;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity jishu2 is port(clk:in std_logic; rst:in std_logic; en:in std_logic; co:out std_logic; x,y:buffer std_logic_vector(3 downto 0);end entity;

26、architecture a of jishu2 issignal qn,qo: std_logic_vector(3 downto 0);signal ce: std_logic;beginprocess(clk,rst,en,qo,qn)begin if rst=1 then qn=0000; elsif (clkevent and clk=1 and en=1) then if(qn=1001) then qn=0000; ce=1; else qn=qn+1;ce=0; end if;end if;x=qn;end process;process(ce,rst,en,qo)begini

27、f rst=1 then qo=0000; elsif (ceevent and ce=1 and en=1) then if(qo=0101)then qo=0000 ;co=1; else qo=qo+1; co=0;end if;end if;y=qo;end process;end a;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity jishu3 is port(clk:in std_logic; rst:in std

28、_logic; en:in std_logic; x,y:buffer std_logic_vector(3 downto 0);end entity;architecture a of jishu3 issignal qn,qo: std_logic_vector(3 downto 0);signal ce: std_logic;beginprocess(clk,rst,en,qo,qn)beginif rst=1 then qn=0000; elsif (clkevent and clk=1 and en=1) then if(qn=1001) then qn=0000; ce=1; el

29、se qn=qn+1;ce=0; end if; end if;x=qn;end process;process(ce,rst,en,qo)beginif rst=1 then qo=0000; elsif (ceevent and ce=1 and en=1) then if(qo=0101)then qo=0000 ; else qo=qo+1;end if;end if;y z =a;dp z =b;dp z =c;dp z =d;dp z =e;dp z =f;dpnull;end case;end if;s y y y y y y y y y y y y y y y y y =1000000;end case;end process;end behave

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号