EDA期末实验报告_第1页
EDA期末实验报告_第2页
EDA期末实验报告_第3页
EDA期末实验报告_第4页
EDA期末实验报告_第5页
已阅读5页,还剩12页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、-天目学院EDA大作业设计报数字钟的设计与制作年:06/07学年学期:第二学期业:电子信息工程级:天目电子信息工程 041t=r. 号 :200405052118 姓 名:毛陈华指导教师及职称:曾松伟 讲师学科: EDA技术实用教程时 间:2007年5月28日一2007年6月12日1.设计思路1.1 总体结构2.方案论证与选择2.1.数字钟方案论证与选择3.单元模块设计部分3.1.CN6 模块的设计3.2.SEL61 模块的设计3.3.DISP 模块的设计3.4.K4 模块的设计3.4.1.CNT10 模块的设计3.4.2.CNT6 模块的设计3.4.3.CNT101 模块的设计3.4.4.C

2、NT61 模块的设计3.4.5 CNT23 模块的设计4.系统仿真4.1.数字钟仿真图4.2.数字钟编译报告4.3.数字钟原理图目录1011111212掌握多个数码管显VHDL语言的设计思想以及 24小时为计数循环;能EDA数字钟设计中文摘要:数字钟学习的目的是掌握各类计数器及它们相连的设计方法; 示的原理与方法;掌握 FPGA技术的层次化设计方法;掌握用 整个数字系统的设计。此数字钟具有时,分,秒计数显示功能,以 实现清零,调节小时,分钟以及整点报时的功能。关键词:数字钟,计数器,数码管,FP GA,VHDL1. 设计思路基于VHDL语言,用Top_Down的思想进行设计。1.1确定总体结构

3、,如图 1-1所示。2. 方案论证与选择2.1数字钟方案论证与选择:方案一是用CN6无进位六进制计数器选择数码管的亮灭以及对应的数,循环扫描显示,用SEL61六选一选择器选择给定的信号输出对应的数送到七段小时计数 功能实现方面都码译码器。K4模块进行复位,设置小时和分,输出整点报时信号和时,分,秒信号。作品 中选方案二。方案二也采用自顶向下的设计方法,它由秒计数模块,分计数模块,模块,报警模块,秒分时设置模块和译码模块六部分组成。两者设计方式, 差不多,作品中选择的是方案一。CN6,信号选择3. 单元模块设计部分 单元模块设计部分分四个部分,介绍数字钟选择显示数码管和对应的数模块 模块SEL6

4、1,七段码译码器模块 DISP和复位,秒,分,时显示,设置模块。3.1 CN6模块的设计即无进位的六进制计数器,由此提供选择信号, 可提供选择信号,选择显示的数码管及对应的数,循环扫描显示。如图1-2lie图1-2library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all; en tity cn6 isp ort(res,clk : in std_logic;cout : out std_logic_vector(2 dow nto 0); end cn6;architecture rtl of cn6

5、 issig nal q : std_logic_vector(2 dow nto 0);beginpro cess(res,clk)beginif res='0' the nq<="000"elsif(clk'eve nt and clk='1') the nif(q=5) the nq<="000"elseq<=q+1;end if;end if;end p rocess;cout<=q;end rtl;3.2 SEL61模块的设计即六选一选择器,如图1-3所示,对于给定的信号,输出对应

6、的数,送到七段码译码器。=<'W 2. :|'|L昭鳴 皿j;1S;图1-3library ieee;use ieee.std_logic_1164.all;en tity sel61 isp ort(sel : in std_logic_vector(2 dow nto 0);a,b,c,d,e,f : in std_logic_vector(3 dow nto 0);q : out std_logic_vector(3 dow nto 0);end;architecture rtl of sel61 is beginpro cess(a,b,c,d,e,f,sel)v

7、ariable cout : std_logic_vector(3 dow nto 0); begincase sei iswhe n "000"=>cout:=a;whe n "001"=>cout:=b;whe n "010"=>cout:=c;whe n "011"=>cout:=d;whe n "100"=>cout:=e;whe n others=>cout:=f;end case;q <=cout;end pro cess;end rtl;3

8、.3 DISP模块的设计即七段译码器,如图1-4所示,对于输入的 4位BCD码进行译码,输出 7位,Q0Q6分别外接数码管ag段显示。!:"3, 了-ft:E- - 图1-4library ieee;use ieee.std_logic_1164.all;en tity dis p isp ort(d : in std_logic_vector(3 dow nto 0); q : out std_logic_vector(6 dow nto 0); en d;architecture one of dis p isbeginpro cess(d)begincase d iswhe n

9、 "0000"=>q<="0111111"whe n "0001"=>q<="0000110" when "0010"=>q<="1011011"when "0011"=>q<="1001111"whe n "0100"=>q<="1100110"whe n "0101"=>q<="1101101

10、"whe n" 0110"=>q<="1111101" when "0111"=>q<="0100111"whe rri000"=>q<="1111111"whe rri001"=>q<="1101111"when others=>q<="0000000" end case;end pro cess;end one;3.4 K4模块的设计遊iEr-fr'-zi

11、厂严Crirt*Ci厂 11'半.二FT :; 广平':;图1-5如图1-5, RES是整个系统的复位键,低电平有效,复位时,各个输出都为零,时间显示 时0分0秒;clk是输入时钟,提供秒信号,上升沿触发,每出发一次,时间增加一秒;HRTMP,MIN10TMP,MINTMPKEYI可以分别设置小时位,10分位,分位,起到调时的作用,高电平有效,有效时,每来一个CLK时钟(1s),所对应的位都将以各自的计数循环;RING是整点报时;SEC,SEC10,MIN,MIN10,HR,HR10 都输出四位 BCD码,用于计数。3.4.1 CNT10模块设计10进制计数器。CLK为秒信号;

12、RES是复位信号,与CLK同步;EN为选通信号;COUT3.0 输出秒个位;CA是进位信号。如图1-6所示。:1.Hr黑I1d"-|图1-6library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;en tity cnt10 isp ort(e n, res,clk: in std_logic;ca : out std_logic;cout : out std_logic_vector(3 dow nto 0);en d;architecture rtl of cn t10 issig na

13、l q : std_logic_vector(3 dow nto 0); beginp1 : p rocess(e n, clk,res)beginif(clk'eve nt and clk-1') the n if(res='0') the n q<="0000"elsif(e n-1') the n if(q=9) then q<="0000"elseq<=q+1;end if;end if;end if;end p rocess p1;p2 : p rocess(q)beginif(q=9)

14、 thenca<=e n;elseca<='0'end if;end pro cess p2;cout<=q;end rtl;3.4.2 CNT6模块设计即进制计数器,CLK为秒信号;RES为复位信号,与CLK同步;EN为选通信号;COUT3.0 输出秒的十位;CA是进位信号。如图1-7所示。 祺j=-=t图1-7library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;en tity cnt6 isp ort(e n, res,clk: in std_logic;c

15、a : out std_logic;cout : out std_logic_vector(3 dow nto 0);en d;architecture rtl of cnt6 issig nal q : std_logic_vector(3 dow nto 0); beginp1 : p rocess(e n, clk,res)beginif(clk'eve nt and clk-1') the n if(res='0') the n q<="0000"elsif(e n-1') the n if(q=5) the n q&l

16、t;="0000"q<=q+1;end if;end if;end if;end p rocess p1;p2 : p rocess(q)beginif(q=5) the nca<=e n;elseca<='0'end if;end pro cess p2;cout<=q;end rtl;3.4.3 CNT101模块设计EN2由外部1-8所示。即十进制计数器,输出分的个位。EN接CNT6的进位CA,产生正常的时钟;断口控制,可用来调节时间,高电平有效,输出将以秒的速度递增循环。如图ILIS3二 lV J3 图1-8library ie

17、ee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;en tity cn t101 is-out put min itute's geweip ort(e n2,e n, res,clk : in std_logic;ca : out std_logic;-jin gweicout : out std_logic_vector(3 dow nto 0);en d;architecture rtl of cn t101 issig nal q : std_logic_vector(3 dow nto 0);

18、beginp1 : p rocess(e n,en 2,clk,res)beginif(clk'eve nt and clk-1') the n if(res='0') the n q<="0000"elsif(e n='1'or e n2='1') the nif(q=9) then q<="0000"elseq<=q+1; end if;end if;end if;end p rocess p1; p2 : p rocess(q) beginif(q=9) then c

19、a<=e n;elseca<='0'end if;end pro cess p2;cout<=q;end rtl;3.4.4 CNT61模块的设计六进制计数器,输出分的各位。 EN接CNT101的进位CA,产生正常的时钟;EN2由外部端 口控制,可用来调节时间,高电平有效,输出分的十位将以秒的速度递增循环。如图1-9所示。Lp ! T=;叫-=t图1-9library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;en tity cn t61 is-out put min

20、 itute's shiweip ort(e n2,e n, res,clk : in std_logic;ca : out std_logic;-jin gweicout : out std_logic_vector(3 dow nto 0);end;architecture rtl of cn t61 issig nal q : std_logic_vector(3 dow nto 0); beginp1 : p rocess(e n,en 2,clk,res)beginif(clk'eve nt and clk='1') the nif(res='

21、0') the n q<="0000"elsif(e n='1'or e n2='1') then if(q=5) the n q<="0000"elseq<=q+1; end if;end if;end if;end p rocess p1; p2 : p rocess(q) beginif(q=5) the n ca<=e n;elseca<='0'end if;end pro cess p2;cout<=q;end rtl;345 CNT23模块设计EN和E

22、N2控制,EN2用来调时。24进制计数器,输出时个位和时十位,由两个选通信号 如图1-10所示。L3r=,zcTn图 1-10library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;en tity cnt23 isp ort(e n2,e n, res,clk : in std_logic;a,b : out std_logic_vector(3 dow nto 0); end;architecture rtl of cn t23 issig nal aout,bout : std_logic_vector(3 dow nto 0); beginp1 : p rocess(e n,en 2,clk,res)beginif(res='0') the n aout<="0000" bo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论