EDA技术(机械)实验报告-序列计数器_第1页
EDA技术(机械)实验报告-序列计数器_第2页
EDA技术(机械)实验报告-序列计数器_第3页
EDA技术(机械)实验报告-序列计数器_第4页
EDA技术(机械)实验报告-序列计数器_第5页
全文预览已结束

下载本文档

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

文档简介

PAGEPAGE1 西华大学实验报告第组.第组实验报告(计算机类)开课学院及实验室:实验时间:年月日学生姓名学号成绩学生所在学院年级/专业/班课程名称EDA技术(机械)课程代码实验项目名称序列计数器项目代码指导教师项目学分一、实验目的1.了解VHDL语言编程方法,学会熟练运用quartus软件2.了解如何使用VHDL设计序列计数器二、内容与设计思想1.序列计数器是经常出现在通信协议编码器电路中的器件,其基本功能是对一个8bit宽的二进制中出现的连续为0的个数进行统计2.在单个时钟脉冲时间内,完成对一个8bit宽的二进制中出现的连续为0的个数进行统计,且要求只能有一串连0出现,即8bit中0是相邻的。此时认为输出有效,并且输出连0的个数;否则认为无效,并且连0计数器清零,同时输出错误指示信号。这里规定全1的序列为有效序列,其连0个数为0个。三、使用环境winXP或win7Quartusii编程环境核心代码及调试过程序列计数器zero1模块libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityzero1is port(d:instd_logic_vector(7downto0); clk,clr:instd_logic; ge:outstd_logic_vector(3downto0); alm:outstd_logic );endzero1;architectureze_arcofzero1isbegin process(clk,clr) variables:std_logic_vector(6downto0); variablesd,ss:std_logic_vector(3downto0);begin ifclr='0'then alm<='0'; elsifclk'eventandclk='1'then s(0):=d(0)xord(1); ifs(0)='1'then ss:=ss+1; endif; s(1):=d(1)xord(2); ifs(1)='1'then ss:=ss+1; endif; s(2):=d(2)xord(3); ifs(2)='1'then ss:=ss+1; endif; s(3):=d(3)xord(4); ifs(3)='1'then ss:=ss+1; endif; s(4):=d(4)xord(5); ifs(4)='1'then ss:=ss+1; endif; s(5):=d(5)xord(6); ifs(5)='1'then ss:=ss+1; endif; s(6):=d(6)xord(7); ifs(6)='1'then ss:=ss+1; endif; ifd(0)='1'then sd:=sd+1; endif; ifd(1)='1'then sd:=sd+1; endif; ifd(2)='1'then sd:=sd+1; endif; ifd(3)='1'then sd:=sd+1; endif; ifd(4)='1'then sd:=sd+1; endif; ifd(5)='1'then sd:=sd+1; endif; ifd(6)='1'then sd:=sd+1; endif; ifd(7)='1'then sd:=sd+1; endif; ifd(0)='0'then ifss>1then alm<='1'; ge<="0000"; else ge<=8-sd; endif; endif; endif; sd:="0000"; ss:="0000"; endprocess; endze_arc;disp模块libraryieee;useieee.std_logic_1164.all;entitydispis port(d:instd_logic_vector(3downto0); q:outstd_logic_vector(6downto0) );enddisp;architecturedisp_arcofdispisbegin process(d) begin casedis when"0000"=>q<="0111111"; when"0001"=>q<="0000110"; when"0010"=>q<="1011011"; when"0011"=>q<="1001111"; when"0100"=>q<="1100110"; when"0101"=>q<="1101101"; when"0110"=>q<="1111101"; when"0111

温馨提示

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

评论

0/150

提交评论