版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、电气与信息工程学院实践基地 实践报告黑龙江科技学院综合性、设计性实践报告实践项目名称时钟系统设计及仿真所属课程名称ASIC实 践 日 期2011.9.13-2011.9.16班 级学 号姓 名成 绩电气与信息工程学院实践基地实践概述:【实践目的及要求】实践目的:1、学习软件Max+plus的使用方法;2、掌握使用Max+plus进行编译和仿真的方法与技巧;3、掌握基本的VHDL语言并编写程序4、了解实践箱的各部分基本构造并使用它完成程序下载。实验要求:1、应用VHDL语言设计一个具有时、分、秒功能的计时系统。2、应用Max+plus开发进行编译,仿真,装配,并下载到实践箱。3、计时系统可采用模
2、块设计,并连接成顶层原理图。4可自行扩展功能。【实践环境】(使用的软件)Max+plus【实验原理】 实践内容:【实践方案设计】秒60模块程序如下:Library ieee;USE ieee.std_logic_1164.ALL;USE ieee.std_logic_arith.ALL;USE ieee.std_logic_unsigned.ALL;entity xsecond1 is port( clk:in std_logic; clkset:in std_logic; setmin:in std_logic; reset:in std_logic; secout:out STD_LOGI
3、C_vector(6 downto 0); enmin:out std_logic);end xsecond1;architecture xsecond_arch of xsecond1 is signal sec:STD_LOGIC_vector(6 downto 0);signal sec1:STD_LOGIC;signal emin:STD_LOGIC;beginprocess(reset,sec,emin,setmin,clkset)begin if reset =0 then enmin=0;secout=0000000;sec1=0;else sec1=1;secout=sec;i
4、f clkset=1and clksetevent then if setmin=0 then enmin=1;else enmin=emin;end if;end if;end if; end process;process(clk,sec1)alias lcount:std_logic_vector(3 downto 0)is sec(3 downto 0);alias hcount:std_logic_vector(2 downto 0)is sec(6 downto 4);begin if sec1=0 thensec=0000000;else if (clk=1and clkeven
5、t)thenif lcount=9 then lcount=0000;if hcount/=5 then hcount=hcount+1;emin=0;else hcount=000;emin=1;end if;else lcount=lcount+1;emin=0;end if;end if;end if;end process;end xsecond_arch;分60程序如下:Library ieee;USE ieee.std_logic_1164.ALL;USE ieee.std_logic_arith.ALL;USE ieee.std_logic_unsigned.ALL;entity
6、 xminute is port( clk:in std_logic; clkmin:in std_logic; sethour:in std_logic; reset:in std_logic; minout:out STD_LOGIC_vector(6 downto 0); enhour:out std_logic);end xminute;architecture xminute_arch of xminute is signal min:STD_LOGIC_vector(6 downto 0);signal ehour:STD_LOGIC;signal min1:STD_LOGIC;b
7、eginprocess(reset,clk,sethour,min,ehour)begin if reset =0 then enhour=0;minout=0000000;min1=0;else min1=1;minout=min;if clk=1and clkevent then if sethour=0 then enhour=1;else enhour=ehour;end if;end if;end if; end process;process(clkmin,min1)alias lcountm:std_logic_vector(3 downto 0)is min(3 downto
8、0);alias hcountm:std_logic_vector(2 downto 0)is min(6 downto 4);begin if min1=0 thenmin=0000000;else if (clkmin=1and clkminevent)thenif lcountm=9 then lcountm=0000;if hcountm/=5 then hcountm=hcountm+1;ehour=0;else hcountm=000;ehour=1;end if;else lcountm=lcountm+1;ehour=0;end if;end if;end if;end pro
9、cess;end xminute_arch;时程序如下:Library ieee;USE ieee.std_logic_1164.ALL;USE ieee.std_logic_arith.ALL;USE ieee.std_logic_unsigned.ALL;entity xhour is port( clkhour:in std_logic; reset:in std_logic; hourout:out STD_LOGIC_vector(5 downto 0); end xhour;architecture xhour_arch of xhour is signal hour:STD_LO
10、GIC_vector(5 downto 0);beginprocess(reset,clkhour,hour)alias lcount:std_logic_vector(3 downto 0)is hour(3 downto 0);alias hcount:std_logic_vector(1 downto 0)is hour(5 downto 4);begin if reset=0 then hourout=000000;hour=000000;else if (clkhour=1and clkhourevent)thenif lcount=9 then lcount=0000; hcoun
11、t=hcount+1;else if hour=100011thenhour=000000;else lcount=lcount+1;end if;end if;end if;hourout=hour;end if;end process;end xhour_arch;分时设定程序:Library ieee;USE ieee.std_logic_1164.ALL;USE ieee.std_logic_arith.ALL;USE ieee.std_logic_unsigned.ALL;entity xsettime is port( reset:in std_logic; hour:in STD
12、_LOGIC_vector(5 downto 0); min:in STD_LOGIC_vector(6 downto 0); sec:in STD_LOGIC_vector(6 downto 0); clk:in std_logic; sel:out STD_LOGIC_vector(2 downto 0); d_out:out STD_LOGIC_vector(3 downto 0); end xsettime;architecture xsettime_arch of xsettime is signal sel1: STD_LOGIC_vector(2 downto 0);beginp
13、rocess(clk,reset,sel1,hour,min,sec)begin if reset=0 then sel=000;d_out=0000;sel1=000;else if (clk=1and clkevent)then if sel15 thensel1=sel1+1;elsesel1=000;end if;end if;seld_out(3)=0;d_out(2)=0;d_out(1)=hour(5);d_out(0)d_outd_out(3)=0;d_out(2)=min(6);d_out(1)=min(5);d_out(0)d_outd_out(3)=0;d_out(2)=
14、sec(6);d_out(1)=sec(5);d_out(0)d_outnull;end case;end if;end process;end xsettime_arch;显示模块程序:Library ieee;USE ieee.std_logic_1164.ALL;entity xdeled is port( d_in:in STD_LOGIC_vector(3 downto 0); a:out std_logic; b:out std_logic; c:out std_logic; d:out std_logic; e:out std_logic; f:out std_logic; g:
15、out std_logic); end xdeled;architecture xdeled_arch of xdeled isbeginprocess(d_in)type data_out is array(0 to 6)of std_logic;variable outp:data_out; begincase d_in iswhen 0000=outp:=1111110;when 0001=outp:=0110000;when 0010=outp:=1101101;when 0011=outp:=1111001;when 0100=outp:=0110011;when 0101=outp
16、:=1011011;when 0110=outp:=1011111;when 0111=outp:=1110000;when 1000=outp:=1111111;when 1001=outp:=1111011;when 1010=outp:=1110111;when 1011=outp:=0011111;when 1100=outp:=1001110;when 1101=outp:=0111101;when 1110=outp:=1001111;when 1111=outp:=1000111;when others=null;end case;a=outp(0);b=outp(1);c=ou
17、tp(2);d=outp(3);e=outp(4);f=outp(5);g=outp(6);end process;end xdeled_arch;指示灯与报警模块程序:Library ieee;USE ieee.std_logic_1164.ALL;USE ieee.std_logic_arith.ALL;USE ieee.std_logic_unsigned.ALL;entity xalert is port( clk:in std_logic; d_in:in STD_LOGIC_vector(6 downto 0); speak:out std_logic; d_out:out STD
18、_LOGIC_vector(2 downto 0); end xalert;architecture xalert_arch of xalert is type state is(s1,s2,s3,s4); signal next_state,current_state:state;beginprocess(clk,current_state,d_in)begin if d_in/=0000000 then speak=0;next_state=s1;current_state=s1;d_out=000;else if (clk=1and clkevent)then speak=1;curre
19、nt_stated_out=000;next_stated_out=001;next_stated_out=010;next_stated_out=100;next_stated_out=000;null;end case;end if;end process;end xalert_arch;分频模块程序:library ieee;use ieee.std_logic_1164.all;entity d_time isport(clk:in std_logic; qlk:out std_logic);end d_time;architecture d_time of d_time issign
20、al x:std_logic;begin process(clk) variable cnt:integer range 0 to 77; begin if clkevent and clk=1then if cnt77 then cnt :=cnt+1;elsecnt:=0;x=not x;end if;end if;qlk=x;end process;end d_time;【实践过程】(实践步骤、记录、数据、分析)1、完成各个模块程序的调试编译利用所得的图完成系统的设计结果如原理图所示,该系统的输入信号为时钟信号、被测频率输入信号、数码管7个段位数码管段位译码输出信号。2、时序仿真分析对设
21、计的系统进行时序仿真分析,波形仿真结果如下图所示波形。图中的S2.0三个数码管位控译码输入信号即6个输入状态。通过ASIC芯片重新编码后送到6个数码管上。该设计完全满足设计要求。3、硬件测试完成时序仿真分析后将涉及的系统通过下载线编程下栽到试验系统上进一步验证设计的正确性,从而完成系统的硬件测试。将设计下载到EDA实践装置本节以MAX7000S系列的EPM7128SLC84-15芯片为例介绍硬件测试相关问题。4、实践说明与电路连线sel0: 为扩展下载板上CPLD器件的第80脚sel1: 为扩展下载板上CPLD器件的第79脚sel2: 为扩展下载板上CPLD器件的第78脚clk1: 为扩展下载
22、板上CPLD器件的第77脚clk2: 为扩展下载板上CPLD器件的第1脚a : 为扩展下载板上CPLD器件的第53脚b : 为扩展下载板上CPLD器件的第54脚c : 为扩展下载板上CPLD器件的第55脚d : 为扩展下载板上CPLD器件的第56脚e : 为扩展下载板上CPLD器件的第57脚f : 为扩展下载板上CPLD器件的第59脚g : 为扩展下载板上CPLD器件的第60脚以上LED段码输出端A、B、C、D、E、F、G应接数码管段位引线接线组KPL_AH,从左到右依次对应A、B、C、D、E、F、G。Sel0、Sel1、Sel2:为扩展下载上CPLD器件的第80、79、78脚,为数码管的位选信号,分别接信号接线组DS1A-8A的SS0、SS1、 SS2引线插孔(即在电源引线插孔组GND孔处)。Clk1、Clk2:为扩展下载板上CPLD器件的82、1脚,应接时钟信号接线组CLOCK(T)上的引线插孔。实践步骤:1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 跨境医疗服务执业许可制度
- 中职护理学药学药物案例分析
- 建筑工程施工现场食堂管理制度
- 聊城历史高一试题及答案
- 维纶热处理操作工安全生产基础知识能力考核试卷含答案
- 人教版(2024)物理 八年级下册 第十二章 简单机械 12.3 机械效率 专项练习 (含答案)
- 职业培训师安全文明水平考核试卷含答案
- 链条装配工标准化模拟考核试卷含答案
- 制胚剖片工岗前绩效目标考核试卷含答案
- 三烷氧基硅烷生产工班组协作竞赛考核试卷含答案
- 2026甘肃中考地理考前一周加分卷含答案
- 仓库现场、目视管理培训资料-课件
- GJB190A-2024《特性分类》标准深度解读
- 2026年贵州铜仁市初二学业水平地生会考真题试卷+解析及答案
- 2022版中国儿童幽门螺杆菌感染诊治专家共识课件
- 景区民警警务室工作制度
- QC/T 947-2025汽车自动防眩目视镜
- 20S515 钢筋混凝土及砖砌排水检查井
- 2026届苏锡常镇高三语文一模作文评分细则及标杆文:卓越源于有目的、有反馈的重复
- AI赋能绩效管理:从工具应用到效能提升全景方案
- 房产公司卖房合同范本
评论
0/150
提交评论