EDA技术(机械)实验报告--序列计数器.docx
实验报告(计算机类)学生姓名学号成绩学生所在学院年级/专业/班课程名称EDA技术(机械)课程代码实验项目名称序列计数器项目代码指导教师项目学分开课学院及实验室:实验时间:年月曰一、实验目的1 .了解VHDL语言编程方法,学会熟练运用quartus软件2 .了解如何使用VHDL设计序列计数器二、内容与设计思想1 .序列计数器是经常出现在通信协议编码器电路中的器件,其基本功能是对一个8bit宽的二进制中出现的连续为O的个数进行统计2 .在单个时钟脉冲时间内,完成对一个8bit宽的二进制中出现的连续为O的个数进行统计,且要求只能有一串连O出现,即8bit中O是相邻的。此时认为输出有效,并且输出连O的个数;否则认为无效,并且连O计数器清零,同时输出错误指示信号。这里规定全1的序列为有效序列,其连O个数为O个。三、使用环境WinXP或Win7QUartUSii编程环境四、核心代码及调试过程序列计数器ZerOl模块Iibraryieee;useieee.std_Iogic_1164.aII;useieee.std_Iogic_unsigned.all;entityzero1isport(d:instd_Iogic_vector(7downto0);cIk,cIr:instd_logic;ge:outstd_Iogic_vector(3downtoO);aIm:outstd_logic);endzero1;architectureze_arcofzero1isbeginprocess(cIk,cIr)variabIes:std_Iogic_vector(6downtoO);variabIesd,ss:std_Iogic_vector(3downtoO);beginifcIr='O'thenalm<=,O'eIsifcIk,eventandcIk='1"thens(O):=d(O)xord(1);ifs(O)=,1,thenss:=ss+1;endif;s(1):=d(1)xord(2);ifs(1)='1,thenss:=ss+1;endif;s(2):=d(2)xord(3);ifs(2)=,1,thenss:=ss+1;endif;s:=d(3)xord(4);ifs(3)=,thenss:-ss+1;endif;s(4):=d(4)xord(5);ifs(4)=,1,thenss:=ss+1;endif;s:=d(5)xord(6);ifs(5)=,1,thenss:=ss+1;endif;s(6):-d(6)xord;ifs(6)=,thenss:-ss+1;endif;ifd(O)=,thensd:=sd+1;endif;ifd(1)=,thensd:=sd+1;endif;ifd(2)=,1,thensd:=sd+1;endif;ifd(3)=,1,thensd:=sd+1;endif;ifd(4)=,1'thensdr=sd+1;endif;ifd(5)=,1,thensd:=sd+1;endif;1 fd(6)=,1,thensd:=sd+1;endif;ifd(7)=,thensd:=sd+1;endif;ifd(0)=,0'thenifss>1thenaIm<='11;ge<="0000"eIsege<-8-sd;endif;endif;endif;sd:="0000"ss:="0000"endprocess;endze_arc;disp模块Iibraryieee;useieee.std_Iogic_1164.aII;entitydispisport(d:instd_Iogic_vector(3downto0);q:outstd_Iogic_vector(6downtoO);enddisp;architecturedisp_arcofdispisbeginprocess(d)begincasediswhen,0000"=>q<=,<011111,when,000,=>q<=,0000110"when"0010"=>q<="1011011"when,001,=>q<=,100111,when,0100"=>q<=,1100110"when,010,=>q<=,110110,when,0110,=>q<=,111110,when-011,=>q<=,010011,when,1000"=>q<=,110111,whenothers=>q<="1101111"endcase;endprocess;enddisp_arc;isp1d3.O)q(6.0T_11st序列计数器总体框图;五、总结六、附录(仿真结果);K,0电©a?”矽。匕¾XuieMoqiWSimImUmi!Uor1吕&UclWMi«吕口FlwSwary逊国FlwSettingse_iSiiral<t«rIgGxnp却igReportFgSunmarySigIHig«o4«PgcCiMtl台厢Sultry6其9Snul>onSinulion备SBOTU”W)nss<csI运JwF>Vlns»|Pointer2.0nsInietvdtISbSmaakMTod*15OraSM:I您SimulationRepo<t