数字秒表课程设计1.doc

上传人:F****n 文档编号:101522783 上传时间:2019-09-28 格式:DOC 页数:14 大小:85KB
返回 下载 相关 举报
数字秒表课程设计1.doc_第1页
第1页 / 共14页
数字秒表课程设计1.doc_第2页
第2页 / 共14页
数字秒表课程设计1.doc_第3页
第3页 / 共14页
数字秒表课程设计1.doc_第4页
第4页 / 共14页
数字秒表课程设计1.doc_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《数字秒表课程设计1.doc》由会员分享,可在线阅读,更多相关《数字秒表课程设计1.doc(14页珍藏版)》请在金锄头文库上搜索。

1、北华航天工业学院电子工程系 EDA综合课程设计 数字秒表设计姓 名:_ _班 级:_ _指导老师:_ _ 摘 要 EDA技术作为电子工程领域的一门新技术,极大的提高了电子系统设计的效率和可靠性。本次课程设计就是利用VHDL语言结合硬件电路来实现数字秒表的功能,数字秒表有4个模块构成,分别为分频电路模块,去抖电路模块,时间计数电路模块,显示模块。用VHDL语言编程来实现各个模块的功能,再用原件例化的方法实现各模块之间的连接,从而实现整个数字秒表电路的功能。1、 设计要求秒表的逻辑结构主要由显示译码器、分频器、十进制计数器、六进制计数器和报警器组成。在整个秒表中最关键的是如何获得一个精确的100H

2、Z计时脉冲,除此之外,整个秒表还需要有一个启动信号和归零信号,以便秒表能随意停止及启动。秒表共有6个输出显示,分别为百分之一秒、十分之一秒、秒、十秒、分、十分,所以共有6个计数器与之对应,6个计数器的输出全部都为BCD码输出,这样便于和显示译码器的连接。当计时达60分钟后,蜂鸣器报警。2、 模块结构1. 四个10进制计数器:用来分别对百分之一、十分之一秒、秒和分进行计数;2. 两个6进制计数器:用来分别对10秒和10分进行计数:3. 分频率器:用来产生100Hz计时脉冲:4. 显示译码器:完成对显示的控制。3、 硬件要求1.主芯片EPF10K10LC84-42.6位八段扫描共阴极数码显示管3.

3、 二个按键开关(归零、启动)4、 实验内容及步骤1.根据电路特点,用层次设计概念将此设计任务分成若干模块,规定每一模块的功能和各模块之间的接口。分别让学生分作和调试其中之一,然后再将各模块结合起来联试。以培养学生之间的合作精神,同时加深层次化设计概念。2.了解软件的元件管理深层含义,以及模块元件之间的连接该概念,对于不同目录下的同一设计,如何熔合。3.适配划分前后的仿真内容有何不同概念,仿真信号对象有何不同,让学生有更深一步了解。熟悉CPLD设计的调试过程中手段的多样化。4.按适配划分后的管脚定位,同相关功能块硬件电路接口连线。5.所有模块全用VHDL语言描述。五、设 计 原 理 与 技 术

4、方 法: 包括:电路工作原理分析与原理图、元器件选择与参数计算、电路调试方法与结果说明; 软件设计说明书与流程图、软件源程序代码、软件调试方法与运行结果说明。 (一)设计流程 1、设计实验目的:在MAX+plusII软件平台上,熟练运用VHDL语言,完成数字时钟设计的软件编程、编译、综合、仿真,使用EDA实验箱,实现数字秒表的硬件功能。 2、设计原理总体框图:本系统设计采用自顶向下的设计方案,系统的整体组装设计原理框图如图(1)所示,它主要由控制模块、时基分频模块,计时模块和显示模块四部分组成。各模块分别完成计时过程的控制功能、计时功能与显示功能。数字秒表设计原理图六、数字秒表各个模块的VHD

5、L语言设计1、时基分频模块将实验箱提供的2.5MHz的时钟脉冲分频后变成100Hz的脉冲,该模块的VHDL设计代码如下:library ieee; use ieee.std_logic_1164.all; entity cb10 is port(clk: in std_logic; co:out std_logic); end cb10; architecture art of cb10 is signal counter:integer range 0 to 24999; begin process(clk) begin if (clk=1 and clkevent) then if cou

6、nter=12499 then counter=0; else counter=counter+1; end if; end if; end process; process(counter) begin if counter=24999 then co=1; else co=0; end if; end process; end art;2、 十进制计数器模块 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity TEN is port(clk,clr,en:in std_logi

7、c; Y:out std_logic_vector(3 downto 0); co:out std_logic); end entity TEN; architecture art of TEN is signal count10:std_logic_vector(3 downto 0); begin Y=count10; process(clk,clr,en) begin if clr=1 then count10=0000; elsif (clkevent and clk=1)then if (en=1)then if count10=1001then count10=0000;co=1;

8、 else count10=count10+1; co=0; end if; end if; end if; end process; end art;3、六进制计数器模块 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity count6 is Port ( clr,start,clk:in std_logic; cout:out std_logic; daout:buffer std_logic_vector(3 dow

9、nto 0); end count6; architecture behave of count6 is begin process(clr,start,clk) begin if clr=1 then daout=0000; elsif ( clkevent and clk=1) then if start=1 then if daout=0101 then daout=0000;cout=1; else daout=daout+1;cout=0; end if; end if; end if; end process; end behave;4.报警器代码:当记时到一小时时,报警器报警,并

10、响十声。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity alarm1 isport(clk, I:in std_logic; q:out std_logic);end alarm1;ARCHITECTURE a OF alarm1 IS signal n:integer range 0 TO 20; signal q0 :std_logic;beginprocess(clk) begin if(clk=1and clkevent) then if i=0 then q0=0; n=0

11、; elsif (n=19 and i=1) then q0=not q0; n=n+1; else q0=0; end if; end if;end process;q=q0;END a;5.数据选择和数码管选择模块代码:其功能是选择个计数端口来的数据,当相应的数据到来时数据选择器选择器数据后输出给数码管,并由数码管显示。library ieee;use ieee.std_logic_1164.all;USE ieee.std_logic_UNSIGNED.all;entity seltime is port(clr,clk: in bit; dain0,dain1,dain2,dain3,

12、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; 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;

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

当前位置:首页 > 办公文档 > 教学/培训

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号