




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、VHDL语言设计数字时钟实验性质:综合性实验级别:开课单位:信息与通信工程学院通信工程系学时:4学时一、实验目的:1学习用VHDL语言实现比较大型的电路的方法。2、继续巩固cpld技术层次化设计方法。二、实验器材:计算机、Quartus II 软件或 xilinx ISE三、实验内容:设计一数字时钟,要求具有时、分、秒、计数显示功能,以24小时循环计时;具有清零,调节小时,分钟功能;具有整点报时功能。四、实验步骤:1根据电路特点,用层次设计的概念,将此任务分成若干模块,规定每一模块的功能和各模块之间的接口。让几个学生分作和调试其中之一,然后再将各模块合起来联试。以培养学生之间的合作精神,同时加
2、深层次化设计概念。2、了解软件的元件管理深层含义,以及模块元件之间的连接概念,对于不同目录下的同一 设计,如何融合。3、模块说明:各种进制的计数及时钟控制模块(10进制、6进制、24进制)扫描分时显示,译码模块各模块都用VHDL语言编写实现电子钟原理图日“”: ZZIM_眠minuteazhuanhuanEdeled1=huanghuan?defed1= /!: 詬:|=iil D 勺!,sscDndk*41Zlwigtiu 附deled各模块程序 秒模块:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL
3、;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following library declaration if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VCompo nen ts.all;en tity sec ond isPort ( clk : in STD_LOGIC;reset : in STD_LOGIC;semi n : in STD_LOGIC;enmin : out STD_LOGIC;daout : outST
4、D_LOGIC_VECTOR (6 dow nto 0);end sec ond;architecture Behavioral of sec ond issig nal coun t:std_logic_vector(6 dow nto 0); sig nal enmin _1,e nmin _2:std_logic; begindaout=co unt;enmin _2=(sem in and clk); enmin=(e nmin_1 or en min_2); process(clk,reset,sem in)begin if(reset=0)the n cou nt=0000000;
5、 enmin _1=0;elsif(clkevent and clk=1)then if(cou nt(3 dow nto 0)=1001thenif(cou nt16#60#)the nif(cou nt=1O11OO1)the nen min_1=1;cou nt=OOOOOOO; elsecoun t=co un t+7;end if;elsecou nt=OOOOOOO;end if;elsif(co un t16#60#)the ncoun t=co un t+1;enmin _1=0;elsecou nt=OOOOOOO;e nmin_1=0:end if;end if;end p
6、rocess;end Behavioral;分模块:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Un comme nt the followi ng library declarati on if in sta ntiati ng- any Xili nx primitives in this code.-library UNISIM;-use UNISIM.VCompo nen ts.all;en tity minu te3 is
7、Port ( clk : in STD_LOGIC;clks : in STD_LOGIC;reset : in STD_LOGIC; sethour : in STD_LOGIC; en hour : out STD_LOGIC; daout : out STD_LOGIC_VECTOR (6 dow nto 0); end minu te3;architecture Behavioral of minu te3 issig nal coun t:std_logic_vector(6 dow nto 0);sig nal en hour_1,e nhour_2:std_logic;begin
8、daout=co unt;en hour_2=(sethour and clks);en hour=(e nhour_1 or en hour_2);process(clk,reset,sethour)beginif(reset=0)the ncou nt=OOOOOOO;en hour_1=0:elsif(clkeve nt and clk=1)the nif(cou nt(3 dow nto 0)=1001thenif(cou nt16#60#)the nif(cou nt=1O11OO1)the nen hour_1=1;cou nt=OOOOOOO; elsecoun t=co un
9、t+7;en hour_1=0;end if;elsecou nt=OOOOOOO;end if;elsif(co un t16#60#)the ncoun t=co un t+1;en hour_1=0 after 100 ns;elsecou nt=OOOOOOO;e nhour_1=0:end if;end if;end process;end Behavioral;时模块:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Un c
10、omme nt the followi ng library declarati on if in sta ntiati ng- any Xili nx primitives in this code.-library UNISIM;-use UNISIM.VCompo nen ts.all;en tity hour isPort ( clk : in STD_LOGIC;reset : in STD_LOGIC; daut : out STD_LOGIC_VECTOR (5 dow nto 0); end hour;architecture Behavioral of hour issig
11、nal coun t:std_logic_vector(5 dow nto 0);begindaut=co unt;process(clk,reset)beginif(reset=O)the ncou nt=OOOOOO;elsif(clkeve nt and clk=1)the nif(cou nt(3 dow nto 0)=1001)the nif(cou nt16#23#)the ncoun t=co un t+7;elsecou nt=OOOOOO;end if;elsif(co un t16#23#)the ncoun t=co un t+1;elsecou nt=OOOOOO;en
12、d if;end if;end process;end Behavioral;转换器7library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Un comme nt the followi ng library declarati on if in sta ntiati ng - any Xili nx primitives in this code.-library UNISIM;-use UNISIM.VCompo nen ts.all;e
13、n tity s isPort ( a : in STD_LOGIC_VECTOR (6 dow nto 0);low : out STD_LOGIC_VECTOR (3 dow nto 0); high : out STD_LOGIC_VECTOR (3 dow nto 0); end s;architecture Behavioral of s isbegin low=a(3 dow nto 0);high (3) =0;high(2 dow nto 0)=a(6 dow nto 4); end Behavioral;转换器6library IEEE;use IEEE.STD_LOGIC_
14、1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Un comme nt the followi ng library declarati on if in sta ntiati ng - any Xili nx primitives in this code.-library UNISIM;-use UNISIM.VCompo nen ts.all;en tity aaa isPort ( a : in STD_LOGIC_VECTOR (5 dow nto 0);high : out STD_LO
15、GIC_VECTOR (3 dow nto 0); low : out STD_LOGIC_VECTOR (3 dow nto 0); end aaa;architecture Behavioral of aaa isbeginlow=a(3 dow nto 0);high(3 dow nto 2)=00;high(1 downto 0)=a(5 downto 4);end Behavioral;显示模块:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGN
16、ED.ALL;- Un comme nt the followi ng library declarati on if in sta ntiati ng - any Xili nx primitives in this code.-library UNISIM;-use UNISIM.VCompo nen ts.all;en tity xia nshi isPort ( num : in STD_LOGIC_VECTOR (3 dow nto 0);led : out STD_LOGIC_VECTOR (6 dow nto 0); end xia nshi;architecture Behav
17、ioral of xia nshi isbeginled=1111110whe n num=0000else0110000when num=0001else1101101whe n num=0010else1111001whe n num=0011else0110011when num=0100else1011011whe n num=0101else1011111whe n num=0110else1110000when num=0111else1111111whe n num=1000else1110011when num=1001else1110111when num=1010else0
18、011111when num=1011else1001110when num=1100else0111101when num=1101else1001111when num=1110elseOOOOOOOwhen num=1111;end Behavioral;报时模块:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;- Uncomment the following library declaration if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VCompo nen ts.all;en tity baoshi isPort ( en hour : in STD_LOGIC;di n,daut : inSTD_LOGIC_VECTOR (6 dow nto 0);y : out STD_LOGIC);en
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025咖啡店员工聘用合同
- 2025专利许可合同协议书
- 2025合同管理与法务实操
- 2025装饰公司家居销售合同
- 2025税务合同法订立中的涉税处理训练
- 2025企业与个人借款合同模板
- 2025年儿科临床诊断与治疗模拟考试卷答案及解析
- 2025年内分泌科激素治疗方案选择模拟考试答案及解析
- 北京市顺义区2024-2025学年七年级下学期期中考试英语题目及答案
- 2025年急诊医学危重病人救治实战演练模拟考试卷答案及解析
- 大学生创业基础2000116-知到答案、智慧树答案
- (正式版)YBT 6328-2024 冶金工业建构筑物安全运维技术规范
- (正式版)HGT 6270-2024 防雾涂料
- 2024年的老龄化社会与养老产业
- 钣金生产工艺
- 公共关系管理培训课件
- 护理信息学课件
- JGJT220-2010 抹灰砂浆技术规程
- 纸箱采购投标方案(技术方案)
- 【小班幼儿挑食行为研究及改善策略9600字(论文)】
- 箱变基础修复施工方案
评论
0/150
提交评论