文档详情

实验4:环形移位寄存器课件.ppt

发布:2016-12-17约1.35千字共8页下载文档
文本预览下载声明
GEXIN EDAPRO/240H 超级万能实验仪 实验四: 环形移位寄存器 一、实验前准备 本实验例子使用独立扩展下载板EP1K10_30_50_100QC208(芯片为EP1K100QC208)。EDAPRO/240H实验仪主板的VCCINT跳线器右跳设定为3.3V; EDAPRO/240H实验仪主板的VCCIO跳线器组中“VCCIO3.3V”应短接,其余VCCIO均断开;独立扩展下载板“EP1K10_30_50_100QC208”的VCCINT跳线器组设定为2.5V;独立扩展下载板“EP1K10_30_50_100QC208”的VCCIO跳线器组设定为3.3V。 二、实验目的 一、实验目的 熟悉使用VHDL语言设计时序逻辑电路; 体会元件例化语句在层次化设计中的应用。 二、设计任务及要求 设计一个8位环形右移移位寄存器; 要求数据输入端为DIN,移位时钟为CLK,复位信号为RST,寄存器输出为Q0~Q7,Q7兼作移位输出端。。 * library ieee; use ieee.std_logic_1164.all; entity shift_circuit is port(din:in std_logic_vector( 7 downto 0); clk:in std_logic; reset:in std_logic; load:in std_logic; q:out std_logic_vector(7 downto 0) ); end entity shift_circuit; architecture behave of shift_circuit is --signal m :std_logic_vector(7 downto 0); --signal m_bit: std_logic; begin process(clk,reset) ---带复位及置数启动能力的环形移位寄存器 variable m :std_logic_vector(7 downto 0); variable m_bit: std_logic; begin if reset=1 then m: else if(clkevent and clk=1) then if load=1 then m:=din; else m_bit:=m(7); m(7 downto 1):=m(6 downto 0 ); m(0):=m_bit; end if; end if; end if; q=m; end process; end architecture behave; *
显示全部
相似文档