📄 shift.vhd
字号:
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use work.cpu_lib.all;
entity shift is
port ( a : in bit16;
sel : in t_shift ;
y : out bit16);
end shift;
architecture rtl of shift is
begin
shftproc: process(a, sel)
begin
case sel is
when shftpass =>y <= a after 1 ns;
when sftl =>y <= a(14 downto 0) & '0' after 1 ns;
when sftr =>y <= '0' & a(15 downto 1) after 1 ns;
when rotl =>y <= a(14 downto 0) & a(15) after 1 ns;
when rotr =>y <= a(0) & a(15 downto 1) after 1 ns;
when others =>y <= "0000000000000000" after 1 ns;
end case;
end process;
end rtl;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -