




已阅读5页,还剩8页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
电子设计自动化EDA 课程设计报告书学号: 08057102 班级: 自动化081 姓名: 陈婷 指导教师: 刘伟 目 录一、设计思想2二、设计步骤3三、调试过程8四、结果分析10五、心得体会11六、参考文献11一、设计思想(一)、设计要求1、具有以24小时制时、分、秒记时、显示功能。2、具有整点报时功能,整点报时的同时LED花样显示。3、具有消零,调节小时,分钟功能。4、设计精度要求为1s。(二)、系统功能描述1.、系统输入:调时、调分,清零信号,分别用按键开关SETHOUR、SETMIN、RESET控制;计数时钟信号CLK采用2HZ时钟源,扫描时钟信号CLKDSP采用32HZ时钟源或更高;2、系统输出:8位八段共阴极数码管显示输出;LED花样显示输出;3、系统功能详细描述: 计时:正常工作状态下,每日按24小时计时制,蜂鸣器无声,逢整点报时。 显示:要求采用扫描显示方式驱动8位8段数码管显示。 整点报时:蜂鸣器在“51”、“53”、“55”、“57”、“59”秒发音,结束时为整点; 校时:在计时状态下,按下按键SETMIN设定分钟,按下按键SETHOUR设定小时。(三)设计思路1、分别写出六进制、十进制、二十四进制、清零、设置时分、LED译码部分,在主体部分用元件例化语句计时,清零设置时分、LED译码,再加上扫描模块2、将六进制、十进制、二十四进制、清零、设置时分、LED译码、扫描模块分模块写在一个主中(四)系统电路结构框图二、设计步骤(一)各种进制的计时及时钟控制模块程序1、6进制library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter6 isport( clk,reset,set: in std_logic; ain:in std_logic_vector(3 downto 0); aout: out std_logic_vector(3 downto 0); co: out std_logic);end counter6;architecture art2 of counter6 is signal count:std_logic_vector(3 downto 0);beginprocess(clk) begin if (clkevent and clk=1)then if(reset=0)then count=0000; elsif(set=1)then count=ain; elsif (count=0101)then count=0000; co=1; else count=count+1;co=0; end if; end if;end process;aout=count;end art2;2、10进制library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter10 isport(clk,reset,set: in std_logic;ain:std_logic_vector(3 downto 0);aout:out std_logic_vector(3 downto 0);co:out std_logic);end counter10;architecture art1 of counter10 issignal count:std_logic_vector(3 downto 0);beginprocess(clk)beginif(clkevent and clk=1) then if(reset=0)then count=0000; elsif(set=1)then count=ain; elsif(count=1001) then count=0000; co=1; else count=count+1;co=0;end if;end if;end process;aout=count;end art1;3、24进制ibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter24 isport( clk,reset,set: in std_logic; ainh:in std_logic_vector(3 downto 0); ainl:in std_logic_vector(3 downto 0); aout: out std_logic_vector(7 downto 0);end counter24;architecture art3 of counter24 is signal count:std_logic_vector(7 downto 0);beginprocess(clk) begin if(clkevent and clk=1) then if(reset=0)then count=00000000; elsif(set=1)then count(7 downto 4)=ainh;count(3 downto 0)=ainl; elsif(count(7 downto 4)0011 ) then if(count(7 downto 4)=0010 and count(3 downto 0)=0011) then count=00000000; elsif(count(3 downto 0)=1001) then count(3 downto 0)=0000; count(7 downto 4)=count(7 downto 4)+1; else count(3 downto 0)=count(3 downto 0)+1; end if; end if; end if;-end if;end process;aout=count;end art3;(二)系统整体程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity clock isport(clk,b1,clks: in std_logic;reset: in std_logic;setmin,sethour: in std_logic;minutell,minutehh,hourll,hourhh,b2:in std_logic_vector(3 downto 0);secondl,secondh:out std_logic_vector(3 downto 0);-second0,second2:out std_logic_vector(6 downto 0);minutel,minuteh:out std_logic_vector(3 downto 0);-minute0,minute2:out std_logic_vector(6 downto 0);hourl,hourh:out std_logic_vector(3 downto 0);-hour0,hour2,dout:out std_logic_vector(6 downto 0);dout:out std_logic_vector(6 downto 0); s:out std_logic_vector(2 downto 0);singing,light: out std_logic);end clock;architecture art of clock is component counter10 is port(clk,reset,set: in std_logic; ain:in std_logic_vector(3 downto 0); aout:out std_logic_vector(3 downto 0); co:out std_logic); end component; component counter6 is port(clk,reset,set: in std_logic; ain:in std_logic_vector(3 downto 0); aout:out std_logic_vector(3 downto 0); co:out std_logic); end component; component counter24 is port(clk,reset,set: in std_logic; ainh,ainl:std_logic_vector(3 downto 0); aout:out std_logic_vector(7 downto 0); end component; component led7 is port(ain: in std_logic_vector(3 downto 0); aout:out std_logic_vector(6 downto 0); end component; signal cs0,cs1,cm0,cm1:std_logic; signal s0,s1,m0,m1,h0,h1,cout:std_logic_vector(3 downto 0); signal h:std_logic_vector(7 downto 0); signal count:std_logic_vector(2 downto 0); begin h0=h(3 downto 0);h1clk,reset=reset,set=b1,ain=b2,aout=s0,co=cs0); u2:counter6 port map(clk=cs0,reset=reset,set=b1,ain=b2,aout=s1,co=cs1); u3:counter10 port map(clk=cs1,reset=reset,set=setmin,ain=minutell,aout=m0,co=cm0); u4:counter6 port map(clk=cm0,reset=reset,set=setmin,ain=minutehh,aout=m1,co=cm1); u5:counter24 port map(clk=cm1,reset=reset,set=sethour,ainl=hourll,ainh=hourhh,aout=h); u6:led7 port map(ain=cout,aout=dout); secondl=s0;secondh=s1;minutel=m0;minuteh=m1;hourl=h0;hourh=h1; process(m1,m0,s1,s0) begin if(m1=0101 and m0=1001 and s1=0101 and s0=1001) then singing=1;light=1; else singing=0;light=0; end if; end process; process(clks) begin if(clksevent and clks=1) then if (count=101) then count=000; else count=count+1; end if; s cout cout cout=m0;s cout cout cout coutsecondl,aout=second0);u7:led7 port map(ain=secondh,aout=second1);u8:led7 port map(ain=minutel,aout=minute0);u9:led7 port map(ain=minuteh,aout=minute1);u10:led7 port map(ain=hourl,aout=hour0);u11:led7 port map(ain=hourh,aout=hour1);问题分析:元件例化是并行语句,按此段代码LDE并行显示,每一个数码管都需要八个端口,这样就需要八排插口,而试验箱只有一排端口。解决办法:采用扫描显示方式,修改程序为: u6:led7 port map(ain=cout,aout=dout);问题2:u1:counter10 port map(clk=clk,reset=reset, aout=s0,co=cs0);问题分析:此元件例化中有set,ain两个端口没有用到解决办法:设置两个输入端口使set和ain为无效信号,设置b1,b2,使set=b1,ain=b2,b1,b2类型必须分别与set和ain相同,在连线时可用拨码开关将b1,b2置成相应状态。问题3:对变量的多重赋值解决办法:设置中间信号问题4:元件例化模块采用名称映射时两个变量的类型不相同解决办法:名称映射的两变量类型应相同四、结果分析1、10进制计数器分析:当reset=0时,aout=0000; 当set=1时,aout=ain(0011); 当reset=1且set=0时,开始计数从“0000”到“1001”,当aout=“1001”时aout被置零,且进位Co=1,计数器开始重新计数;2、6进制计数器分析:当reset=0时,aout=0000; 当set=1时,aout=ain(0101); 当reset=1且set=0时,开始计数从“0000”到“0101”,当aout=“0101”时aout被置零,并开始重新计数;3、24进制计数器分析:当reset=0时,aout=0000; 当set=1时,aout=ain(0101); 当reset=1且set=0时,开始计数从“0000”到“0101”,当aout=“0101”时aout被置零,并开始重新计数;五、心得体
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 肾内科护理查房
- 2025年事业单位工勤技能-湖南-湖南工程测量工四级(中级工)历年参考题库典型考点含答案解析
- 2025年事业单位工勤技能-湖南-湖南垃圾清扫与处理工三级(高级工)历年参考题库含答案解析
- 2025年事业单位工勤技能-湖南-湖南不动产测绘员五级(初级工)历年参考题库典型考点含答案解析
- 2025年事业单位工勤技能-湖北-湖北计算机信息处理员三级高级历年参考题库典型考点含答案解析
- 2025年事业单位工勤技能-湖北-湖北环境监测工三级(高级工)历年参考题库含答案解析
- 2025年事业单位工勤技能-湖北-湖北水利机械运行维护工一级(高级技师)历年参考题库含答案解析
- 2025-2030中国纳米碳酸钙产业竞争风险分析与投资可行性研究报告
- 2025年历史文化街区保护与城市风貌提升研究报告
- 2025年事业单位工勤技能-湖北-湖北下水道养护工二级(技师)历年参考题库含答案解析
- 酒店楼层分租协议书
- 血液肿瘤科知识培训课件
- 网络安全产品代理销售合同
- 《2025年CSCO HR阳性晚期乳腺癌治疗指南》解读
- 广播工程系统施工方案
- 新能源汽车概论 课件 5.1新能源汽车高压安全与防护
- 浙江省温州市鹿城区2025年小升初总复习数学测试卷含解析
- 带状疱疹护理查房
- 2025福建德化闽投抽水蓄能有限公司招聘15人笔试参考题库附带答案详解
- VR体验馆商业计划书
- 房地产销售经理转正述职报告
评论
0/150
提交评论