《EDA移位寄存器.ppt》由会员分享,可在线阅读,更多相关《EDA移位寄存器.ppt(11页珍藏版)》请在三一办公上搜索。
1、移位寄存器,-实验评述,一、简单移位寄存器,二、带左右移位的移位寄存器,P186,library ieee;use ieee.std_logic_1164.all;entity shifter isport(din:in bit_vector(3 downto 0);clk,load,left_right:in std_logic;dout:inout bit_vector(3 downto 0);end shifter;architecture synth of shifter is-signal shift_val:bit_vector(3 downto 0);begin,nxt:proc
2、ess(load,left_right,din,dout)beginif(load=1)then shift_val=din;elsif(left_right=0)then shift_val(2 downto 0)=dout(3 downto 1);shift_val(3)=0;else shift_val(3 downto 1)=dout(2 downto 0);shift_val(0)=0;end if;end process;current:process begin wait until clkevent and clk=1;dout=shift_val;end process;end synth;,三、带并行控制的移位寄存器,四、桶形移位,