PoC.arith.shifter_barrel

This Barrel-Shifter supports:

  • shifting and rotating
  • right and left operations
  • arithmetic and logic mode (only valid for shift operations)

This is equivalent to the CPU instructions: SLL, SLA, SRL, SRA, RL, RR

Entity Declaration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
entity arith_shifter_barrel is
  generic (
    BITS        : positive    := 32
  );
  port (
    Input           : in  std_logic_vector(BITS - 1 downto 0);
    ShiftAmount     : in  std_logic_vector(log2ceilnz(BITS) - 1 downto 0);
    ShiftRotate     : in  std_logic;
    LeftRight       : in  std_logic;
    ArithmeticLogic : in  std_logic;
    Output          : out std_logic_vector(BITS - 1 downto 0)
  );
end entity;