实验二 模可变计数器设计.pdfVIP

  • 0
  • 0
  • 约4.31千字
  • 约 6页
  • 2026-02-27 发布于河南
  • 举报

实验报告

学生姓名:学号:专业班级:通信081

实验类型:□验证□综合□设计□创新实验日期:2010.10.22实验成绩:

实验二模可变计数器设计

一、实验目的

(1)学习多层次设计方法;

(2)熟悉模可变计数器设计。

二、实验内容与要求

(1)当m=0时,实现模为23计数;当m=1时,实现模为109计数;

(2)计数结果用静态数码管显示,一个四位二进制表示0~9中的一个数;

(3)进行波形仿真,并分析仿真波形图。

三、实验仪器

PC机,QuartusII软件,EDA试验箱各一台套。

四、设计思路/原理图

开始

rst=1?cqi=0

en=1?cqi=cqi

cqinumber?cqi=0

并列

m=0ifcqi=9?m=1ifcqi=153?

cqi=cqi+7cqi=cqi+1cqi=cqi+103cqi=cqi

结束

五、实验程序(程序来源:_________________________)

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entitymod23_109is

port(clk,rst,en,m:instd_logic;

q1:outstd_logic_vector(3downto0);

q2:outstd_logic_vector(3downto0);

q3:outstd_logic_vector(3downto0));

endmod23_109;

architecturebehavofmod23_109is

begin

process(rst,clk,m)

variablenumber:std_logic_vector(11downto0);

variablecqi:std_logic_vector(11downto0);

begin

q3=cqi(11downto8);

q2=cqi(7downto4);

q1=cqi(3downto0);

casemis

when0=number:=000000100010;

when1=number:=000100001000;

whenothers=null;

endcase;

ifrst=1thencqi:=(others=0);

elsifclkeventandclk=1then

ifen=1then

ifcqinumberthen

ifcqi(7downto0)thencqi:=cqi+103;

elsecqi:=cqi;

endif;

ifcqi(3downto0)=1001thencqi:=cqi+7;

elsecqi:=cqi+1;

endif;

elsecqi:=(others=0);

endif;

endif;

en

文档评论(0)

1亿VIP精品文档

相关文档