📄 shift3.vhd
字号:
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity shift_3 isport(clk,resetn,d_in:in std_logic; shift_en:in std_logic; shift_out0:out std_logic; shift_out1:out std_logic; shift_out2:out std_logic);end shift_3;architecture shift_3 of shift_3 is signal shift_reg:std_logic_vector(2 downto 0); signal shift_enm:std_logic;begin process(clk,resetn) begin if resetn='0'then shift_reg<=(others=>'0'); shift_enm<='0';elsif clk'event and clk='1' then shift_enm<=shift_en; if shift_enm='1' thenshift_reg<=std_logic_vector(shl(unsigned(shift_reg),"1"));end if;shift_reg(0)<=d_in; end if;end process;shift_out0<=shift_reg(0);shift_out1<=shift_reg(1);shift_out2<=shift_reg(2);end shift_3;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -