ImageVerifierCode 换一换
格式:DOCX , 页数:10 ,大小:78.97KB ,
资源ID:6060724      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6060724.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(北邮数字逻辑课程设计实验报告可编辑.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

北邮数字逻辑课程设计实验报告可编辑.docx

1、北邮数字逻辑课程设计实验报告可编辑北邮数字逻辑课程设计实验报告(可编辑)(文档可以直接使用,也可根据实际需要修改使用,可编辑推荐下载)实验四:电子钟显示一、实验目的(1)掌握较复杂的逻辑设计和调试。(2)学习用原理图+VHDL语言设计逻辑电路。(3)学习数字电路模块层次设计。(4)掌握ispLEVER 软件的使用方法。(5)掌握ISP 器件的使用。二、实验所用器件和设备在系统可编程逻辑器件ISP1032 一片示波器 一台万用表或逻辑笔 一只TEC-5实验系统,或TDS-2B 数字电路实验系统 一台三、实验内容数字显示电子钟1、任务要求(1)、时钟的“时”要求用两位显示;上、下午用发光管作为标志

2、;(2)、时钟的“分”、“秒”要求各用两位显示;(3)、整个系统要有校时部分(可以手动,也可以自动),校时时不能产生进位;(4)*、系统要有闹钟部分,声音要响5秒(可以是一声一声的响,也可以连续响)。VHDL源代码:LIBRARY ieee; -主体部分-ENTITY clock is port(clk,clr,put,clk1 : in std_logic; - clr 为清零信号,put 为置数脉冲,clk1 为响铃控制时钟choice : in std_logic; -用来选择时钟状态的脉冲信号lighthour : out std_logic_vector(10 downto 0);

3、lightmin : out std_logic_vector(7 downto 0); lightsec : out std_logic_vector(7 downto 0); -输出显示ring : out std_logic); -响铃信号end clock; -60进制计数器模块ARCHITECTURE func of clock is component counter_60 port(clock : in std_logic; clk_1s : in std_logic; putust : in std_logic; clr : in std_logic; load : in st

4、d_logic; s1 : out std_logic_vector(3 downto 0); s10 : out std_logic_vector(3 downto 0);co : out std_logic); end component; -24进制计数器模块component counter_24 port(clock : in std_logic; clk_1s : in std_logic; putust : in std_logic; clr : in std_logic; load : in std_logic; s1 : out std_logic_vector(3 down

5、to 0); s10 : out std_logic_vector(6 downto 0); end component; signal sec,a:std_logic; - 2 分频产生1s信号signal l1,l2,l3:std_logic; -判定对时间三部分修改signal c1,c2:std_logic; -进位信号signal load:std_logic_vector(1 downto 0); signal temp:integer range 0 to 2499; signal temp1:integer range 0 to 95; -计数信号signal sec_temp

6、:std_logic_vector(7 downto 0); -总进程begin u1 : counter_60 port map (sec,sec,put,clr,l1,sec_temp(3 downto 0),sec_temp(7 downto 4),c1); u2 : counter_60 port map (c1,sec,put,clr,l2,lightmin(3 downto 0),lightmin(7 downto 4),c2); u3 : counter_24 port map (c2,sec,put,clr,l3,lighthour(3 downto 0),lighthour(

7、10 downto 4); lightsec(7 downto 0) l1=0; -非修改状态l2=0; l3=0; load l1=0; -此状态下对小时进行修改l2=0; l3=1; load l1=0; -此状态下对分钟进行修改 l2=1; l3=0; load l1=1; -此状态下对秒进行修改 l2=0; l3=0; load=00; end case; end if; end process; -计数进程process(clk) beginif (clkevent and clk=1) then -分频if (temp=2499) thentemp = 0; sec=not sec

8、; else temp = temp+1; end if; end if; end process; -响铃进程process(clk1) begin if(clk1event and clk1=1) thenif (temp1=95) thentemp1=0; a=not a; else temp1=temp1+1; end if; end if; end process; ring=a when (c2=1 and sec_temp5 and sec=1) else -5s整点响铃0; end func; library IEEE; entity counter_60 is port (c

9、lock : in std_logic; -计数信号,即低位的进位信号或时钟脉冲信号clk_1s : in std_logic; -周期1s 的时钟信号putust : in std_logic; -调表置数信号clr : in std_logic; -清零load : in std_logic; -判定信号s1 : out std_logic_vector(3 downto 0); -计数器的个位s10 : out std_logic_vector(3 downto 0); -计数器的十位co : out std_logic ); end counter_60; if(load=1 ) -防

10、止脉冲产生进位 co_ temp=0;architecture func of counter_60 is signal s1_temp: std_logic_vector(3 downto 0); signal s10_temp : std_logic_vector(3 downto 0); signal clk,co_temp : std_logic; begin clk=clock when load=0 else putust; process (clk,clr) begin if (clr=1) thens1_temp = 0000; s10_temp = 0000; elsif (

11、clkevent and clk=1)then -进位判断if (s1_temp=9) thens1_temp = 0000;if (s10_temp=5) thens10_temp = 0000; co_temp=1; else co_temp=0;s10_temp = s10_temp+1;end if; elseco_temp=0; s1_temp = s1_temp+1; end if; end if; end process; s1 = s1_temp when (clk_1s=1or load=0) else1111; s10 = s10_temp when (clk_1s=1 o

12、r load=0) else1111; co = co_temp when (load=0) else0; end func; library IEEE; -24进制计数器entity counter_24 is port(clock : in std_logic; -计数信号clk_1s : in std_logic; -周期1s 的时钟信号putust : in std_logic; clr : in std_logic; -清零信号load : in std_logic; -判定信号s1 : out std_logic_vector(3 downto 0); -计数器的个位s10 : o

13、ut std_logic_vector(6 downto 0); -计数器的十位end counter_24; architecture func of counter_24 is signal s1_temp : std_logic_vector(3 downto 0); signal s10_temp : std_logic_vector(1 downto 0); signal clk : std_logic; begin clk=clock when load=0 else putust; process (clk,clr) begin if (clr=1) thens1_temp =

14、0000; s10_temp = 00; elsif (clkevent and clk=1) then if (s1_temp=3 and s10_temp=2) thens1_temp = 0000;s10_temp = 00; elsif (s1_temp=9) thens1_temp=0000; s10_temp=s10_temp+1;else s1_temp s10 s10 s10 null; end case; else s10=0000000; end if; end process; s1 = s1_temp when (clk_1s=1 or load=0) else 1111; end func;四、实验小结:注意当时钟处于被修改状态时,即对时、分、秒的值进行修改时,不应产生进位,产生很多莫名其妙的错误,如修改后有进位(分钟为00)时,或者自行到整点响铃后,再次给脉冲会进位的情况。最终修改了很多语句,实际就是在修改给脉冲时强制使进位信号为0.注意计数器60,,2进制的实现,加入响铃后需要把进位信号放到计数过程中才能使响铃正常。调整非秒针时,秒针依旧走动,通过1s计数器实现闪烁,符合实际情况。此次试验模块多且杂,需要更加细化的了解程序实质,也对代码的执行方式和顺序有了更加深刻的认识

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1