📄 ex_4_2_barrel.vhd
字号:
library IEEE;use IEEE.std_logic_1164.all;use IEEE.std_logic_unsigned.all;entity barrel_shifter is port(A:in std_logic_vector(7 downto 0);--Input B:out std_logic_vector(7 downto 0);--Output C:in std_logic_vector(3 downto 0));--Shift count C(3) = Direction end barrel_shifter;architecture DF2 of barrel_shifter is signal s:integer;begin s <= conv_integer(C(2 downto 0)); B<= To_stdlogicvector(To_bitvector(A) sll s) when C(3) = '0' else To_stdlogicvector(To_bitvector(A) srl s);end DF2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -