EDA技术与实践综合设计报告.doc_第1页
EDA技术与实践综合设计报告.doc_第2页
EDA技术与实践综合设计报告.doc_第3页
EDA技术与实践综合设计报告.doc_第4页
EDA技术与实践综合设计报告.doc_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

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

文档简介

北 华 航 天 工 业 学 院综合实践总结报告 综合实践名称: eda技术与实践 年历日历设计 综合实践地点、时间 教十eda实验室 2014-2015-2学期第1317周 专业班级: 13251 姓 名: 李露 陈泽东 李泽宙 学号: 201310194 201310167 201310193 指导教师姓名: 薛 瑞 完 成 时 间: 2015 年 6 月 20 日一、综合实践目的1.通过编写vhdl程序,结合硬件电路设计,实现年月日的计时 功能。同时将计时结果通过8个七段数码管显示,并可通过两个按键,对计数时钟的有关参数进行调整。2.学会使用quartus软件下载调试程序,用调试程序将学习板调试成功。锻炼学生的动手能力以及提高学生的综合专业素质。 二、综合实践理论基础和核心内容根据系统的设计要求,计时电路可分为计日电路,计月电路,计年电路等三个子模块,这三个子模块必须都具有预置,计数和进位功能,设计思想如下:(1) 计日电路:将计时电路产生的进位脉冲信号作为计日电路的计数时钟信号,通过系统辨认,确定本月总天数x(包括28,29,30,31四种情况),待计数至x+1瞬间,进位,计月电路加1,而计日电路返回1重新开始计数。(2) 计月电路:将计日电路产生的进位脉冲信号作为计月电路的计时时钟信号,待计时至12瞬间,进位,计年电路加1,而计月电路返回1重新开始计数。(3) 计年电路:将计月电路产生的进位脉冲信号作为时钟计年电路的计数时钟信号,待计数至100瞬间,计年电路返回0重新开始计数。(4) 对于系统中的时间调整电路,拟通过模式和调整两个外部按件完成。模式键负责切换正常时间计数模式和时间调整模式,调整键负责在时间调整模式之下,对当前模式的计数结果进行调整。三、综合实践具体内容和记录(图、表或程序等)1tian程序(李露)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity tian isport(clk,a,b:in std_logic; t1:out std_logic_vector(3 downto 0); t2:out std_logic_vector(7 downto 4); cout:out std_logic); end tian;architecture one of tian issignal q1:std_logic_vector(3 downto 0);signal q2:std_logic_vector(7 downto 4);signal ab :std_logic_vector(1 downto 0);beginprocess(clk,a,b)beginif clkevent and clk=1 thenq1 = q1+1;if q1 =9 then q1 =0000;q2 = q2+1;end if;ab -当ab=00时,yue输出31天if q2=3 and q1=1 then q2=0000;q1=0001;cout=1;else cout -当ab=01时,yue输出30天if q2=3 and q1=0 then q2=0000;q1=0001;cout=1;else cout -当ab=10时,yue输出28天if q2=2 and q1=8 then q2=0000;q1=0001;cout=1;else cout -当ab=11时,yue输出29天if q2=2 and q1=9 then q2=0000;q1=0001;cout=1;else cout null;end case;end if;end process;t1=q1;t2=q2;end one;仿真 31天 30天28天29天2yue程序(陈泽东)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yue isport(clk,run:in std_logic;y1:out std_logic_vector(3 downto 0);y2:out std_logic_vector(7 downto 4);a,b,cout:out std_logic);end yue;architecture one of yue issignal q1,q2:std_logic_vector(3 downto 0);signal q2q1:std_logic_vector(7 downto 0);beginprocess(clk,run)beginif clkevent and clk=1 then q1=q1+1;if q1=9 then q10);q2=q2+1;end if;if q2=1 and q1=2 thenq2=0000;q1=0001;cout=1;else cout=0;end if;end if;q2q1a=0;b if run=1 then a=1;b=1;else a=1;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;ba=0;bnull;end case;y1=q1;y2=q2;end process;end one;仿真3nian程序(李泽宙)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity nian isport (clk:in std_logic; n1,n2:out std_logic_vector(3 downto 0); run,cout:out std_logic); end nian;architecture one of nian issignal q1,q2,q3:std_logic_vector(3 downto 0);beginprocess(clk)beginif clkevent and clk=1then -如果clk=1时,q1加1q1=q1+1;if q1=9 then q10); -如果q1=9,q1清零,q2加1q2=q2+1;end if;if q2=9 and q1=9 then q1=0000; -如果q1=9,q2=9,q1、q2清零,进位。否则不进位q2=0000;cout=1;else cout=0;end if;end if;end process;process(clk)beginif clkevent and clk=1then -如果clk=1,q3加1q3=q3+1;if q3=3 then q30); -如果q3=3则q3清零 run=1否则run=0run=1;else run=0;end if;end if;n1 = q1;n2 = q2;end process;end one;仿真4nian2程序(李泽宙)library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity nian2 is port(clk:in std_logic; n3,n4:out std_logic_vector(3 downto 0); end entity nian2; architecture one of nian2 is signal q1:std_logic_vector(3 downto 0):=0000; signal q2:std_logic_vector(3 downto 0):=0010; signal q3:std_logic_vector(3 downto 0); begin process(clk) begin if clkevent and clk=1 then -如果clk=1时,q1加1 q1=q1+1; if q1=9 then -如果q1=9,q1q2加1 q1=0000; q2=q2+1; end if; if q2=9 and q1=9 then -如果q1=9,q2=9,q1、q2清零 q2=0000; q1=0000; end if; end if; n3=q1;n4=q2; end process; end one;仿真5seltime程序扫描(李露)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity seltime isport(clk1:in std_logic;t1,t2,y1,y2,n1,n2,n3,n4:in std_logic_vector(3 downto 0);daout :out std_logic_vector(3 downto 0);dp: out std_logic;s:out std_logic_vector(3 downto 0);sel :out std_logic_vector(3 downto 0);end seltime;architecture fun of seltime issignal count :std_logic_vector(3 downto 0);begins=1011;sel=0111)thencount=0000;elsecount daout =t1; dp daout = t2;dp daout = y1;dp daout =y2;dp daout = n1;dp daout = n2;dp daout = n3;dp daout =n4;dp=0;-sel为“0111”时,扫描年千位,dp点不亮end case;end process;end fun;仿真6tiao程序校对(陈泽东)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity tiao isport( k1,k2 :in std_logic; clk,ti,yi,ni:in std_logic; tl,yo,no,no1 :out std_logic; l1,l2,l3,l4:out std_logic);end tiao;architecture behav of tiao issignal a: std_logic_vector (3 downto 0);beginprocess(k1,k2)beginif k1event and k1=1 thena=a+1;if a=4 thenatl=clk;yo=ti;no=yi;no1=ni; - 模式0正常计时 l1=0;l2=0;l3=0;l4tl=k2;yo=0;no=0;no1=0; -选通日模块,调日;第1个灯亮 l1=1;l2=0;l3=0;l4tl=0;yo=k2;no=0;no1=0; -选通月模块,调月;第2个灯亮 l1=0;l2=1;l3=0;l4tl=0;yo=0;no=k2;no1=0; -选通年低位模块,调年低位;第3个灯亮 l1=0;l2=0;l3=1;l4tl=0;yo=0;no=0;no1=k2; -选通年高位模块,调年高位;第4个灯亮 l1=0;l2=0;l3=0;l4null;end case;end process;end;仿真7d7程序七段数码管(陈泽东)library ieee;use ieee.std_logic_1164.all;entity d7 isport(d0:in std_logic_vector(3 downto 0);c:out std_logic_vector(6 downto 0);end;architecture arc_d7 of d7 issignal din:std_logic_vector(3 downto 0);signal dout:std_logic_vector(6 downto 0);begindindoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdout=1000111; -47h(显示f)end case;end process;c=dout;end arc_d7;仿真8de减震程序(李露)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity de isport(clk,key:in std_logic; dly_out:out std_logic);end de;architecture a of de issignal count:std_logic_vector(4 downto 0):=00000; -设置一个信号count的初始值为“00000”beginprocess(clk,key)begin if clkevent and clk=1 thenif key=1thenif count=10 then count=count; -来一个上升沿,且按键“key”按下,信号count为10时,输出信号,否则信号加1else count=count+1;end if;if count=9 then dly_out=1; -来一个上升沿,且按键“key”按下,信号count为9时,输出有效,否则输出无效else dly_out=0;end if;else count=00000;end if;end if;end process;end a;仿真9fenpin程序分频(李泽宙)ibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenpin isport(clk:in std_logic; clk_out1:out std_logic; clk_out2:out std_logic; clk_out3:out std_logic);end;architecture one of fenpin issignal count1:integer range 0 to 35999999; -改x值signal clk_data1:std_logic;signal clk_data2:std_logic;signal count2:integer range 0 to 49999;signal clk_data3:std_logic;signal count3:integer range 0 to 994; -改x值beginprocess(clk,count1)begin if clkevent and clk=1 then if count1=35999999 then -x值决定分频倍数n,若要求160分频 count1=0; clk_data1=not clk_data1;-则x=n/2-1,这里x取9 else count1=count1+1; end if;end if;clk_out1=clk_data1;end process;process(clk,count2)begin if clkevent and clk=1 then if count2=49999 then -x值决定分频倍数n,若要求20分频 count2=0; clk_data2=not clk_data2;-则x=n/2-1,这里x取14else count2=count2+1; end if;end if;clk_out2=clk_data2;end process;process(clk,count3)begin if clkevent and clk=1 then if count3=994 then -x值决定分频倍数n,若要求20分频 count3=0; clk_data3=not clk_data3;-则x=n/2-1,这里x取14 else count3=count3+1;end if;end if;clk_out3a,b=b, -u1:日计数器元件例化clk=clk_cd,t1=day1,t2=day2,cout=cout_td);u2:yue port map( clk=clk_cm, -u2:月计数器元件例化 run=temp, cout=cout_tm, a=a, b=b, y1=mon1, y2=mon2);u3:nian port map( clk=clk_cy1, -u3:年低位计数器元件例化 n1=year1, n2=year2, run=temp, cout=cout_ty);u4:nian2 port map( clk=clk_cy2, -u4:年高位计数器元件例化 n3=year3, n4=year4);u5:tiao port map(k1=k1_out, -u5:校对模块元件例化k2=k2_out,clk=clk_1,ti=cout_td,yi=cout_tm,ni=cout_ty,tl=clk_cd,yo=clk_cm,no=clk_cy1,no1=clk_cy2,l1=l1,l2=l2,l3=l3,l4=l4);u6:fenpin port map( clk=clk, -u6:分频模块元件例化 clk_out1=clk_1, clk_out2=clk_2, clk_out3=clk_3);u7:d7 port map( d0=d0_daout, -u7:译码器模块元件例化 c=c_out);u8:seltime port map(clk1=clk_2, -u8: 扫描模块元件例化t1=day1,t2=day2,y1=mon1,y2=mon2,n1=year1,n2=year2,n3=year3,n4=year4,daout=d0_daout,dp=dp,sel=sel,s=s);u9:de port map(clk=clk_3, -u9:减震模块元件例化 key=k1, dly_out=k1_out);u10:de port map(clk=clk_3, -u10:减震模块元件例化 key=k2, dly_out=k2_out); end one;11原理图仿真12引脚锁定13各引脚名称对应关系表port a信号fpga 管脚对应引脚clkv10clkpin_5d0(a)pin_e2c6pin_6d

温馨提示

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

评论

0/150

提交评论