同步输入移位寄存器

相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

VHDL实验报告:

姓名:学号:班级:

实验地点:实验时间:

一、实验目的:

二、试验相关知识点:

三、实验设备与软件环境:

四、实验步骤及程序:

library ieee;

use ieee.std_logic_1164.all;

entity shift8 is

port

(

clk,dir,we,oe,si : in std_logic;

d : inout std_logic_vector(7 downto 0);

so : out std_logic

);

end entity;

architecture rtl of shift8 is

signal temp:std_logic_vector(7 downto 0);

begin

process (clk,we)

begin

if(we='1')then

temp<=d;

elsif(clk'event and clk='1')then

if(dir='0')then

temp(7)<=temp(6);

temp(6)<=temp(5);

temp(5)<=temp(4);

temp(4)<=temp(3);

temp(3)<=temp(2);

temp(2)<=temp(1);

temp(1)<=temp(0);

temp(0)<=si;

else

temp(0)<=temp(1);

temp(1)<=temp(2);

temp(2)<=temp(3);

temp(3)<=temp(4);

temp(4)<=temp(5);

temp(5)<=temp(6);

temp(6)<=temp(7);

temp(7)<=si;

end if;

end if;

end process;

process(dir,temp,oe)is

begin

if dir='0'then

so<=temp(7);

else

so<=temp(0);

end if;

end process;

process(temp,we,oe)

begin

if(we='0')and (oe='0')then

d<="ZZZZZZZZ";

elsif(we='0')and(oe='1')then

d<=temp;

end if;

end process;

end rtl;

10001000写入、上升沿左移情况

10001000写入、上升沿右移情况以及置高阻情况

五、实验结果分析:

相关文档
最新文档