网站大量收购独家精品文档,联系QQ:2885784924

EDA技术 项目8 移位寄存器.ppt

  1. 1、本文档共15页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
EDA技术 项目8 移位寄存器

项目8 移位寄存器 一.任务1:单向移位寄存器 1.任务分析 在数字电路中,用来存放二进制数据或代码的电路称为寄存器。 寄存器是由具有存储功能的触发器组合起来构成的。一个触发器可以存储1位二进制代码,存放n位二进制代码的寄存器,需用n个触发器来构成。 按照功能的不同,可将寄存器分为基本寄存器和移位寄存器两大类。基本寄存器只能并行送入数据,需要时也只能并行输出。移位寄存器中的数据可以在移位脉冲作用下依次逐位右移或左移,数据既可以并行输入、并行输出,也可以串行输入、串行输出,还可以并行输入、串行输出,串行输入、并行输出,十分灵活,用途也很广。 单向移位寄存器具有以下主要特点: (1)单向移位寄存器中的数码,在CP脉冲操作下,可以依次右移或左移。 (2)n位单向移位寄存器可以寄存n位二进制代码。n个CP脉冲即可完成串行输入工作,此后可从Q0~Qn-1端获得并行的n位二进制数码,再用n个CP脉冲又可实现串行输出操作。 (3)若串行输入端状态为0,则n个CP脉冲后,寄存器便被清零。 完成右移移位寄存器的文本编辑 library ieee; use ieee.std_logic_1164.all; entity yiwei_r is port(ld:in std_logic; cp:in std_logic; d:in std_logic_vector(3 downto 0); q:buffer std_logic_vector(3 downto 0)); end yiwei_r; architecture one of yiwei_r is begin process(ld,cp,d) variable aa:std_logic_vector(3 downto 0); begin if ld =1 then q=d; elsif cpevent and cp=1then aa(2 downto 0):=q(3 downto 1); aa(3):=q(0); q=aa; end if; end process; end one; 仿真测试 在开发系统上进行硬件测试。 1.任务分析 双向移位寄存器特性表 2.任务实施 完成双向移位寄存器的文本编辑 : (1)定义为信号 library ieee; use ieee.std_logic_1164.all; entity shuangxiang is port(load:in std_logic; clk:in std_logic; left_right:in std_logic; d:in std_logic_vector(2 downto 0); q:buffer std_logic_vector(2 downto 0)); end shuangxiang; architecture one of shuangxiang is signal aa:std_logic_vector(2 downto 0); begin process(clk,load,left_right,d) begin if load =1 then aa=d; q=d; elsif clkevent and clk=1then if left_right=0 then aa(1 downto 0)=q(2 downto 1); aa(2)=0; else aa(2 downto 1)=q(1 downto 0); aa(0)=0; end if; q=aa; end if; end process; end one; (2)定义为变量 library ieee; use ieee.std_logic_1164.all; entity yiwei is port(load:in std_logic; clk:in std_logic; left_right:in std_logic; d:in std_logic_vector(2 downto 0); q:buffer std_logic_vector(2 downto 0)); end yiwei; architecture one of yiwei is begin process(clk,load,left_right,d) variable aa:std_logic_vector(2 downto 0); Begi

文档评论(0)

jiupshaieuk12 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:6212135231000003

1亿VIP精品文档

相关文档