aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/sns01/shrs.vhdl
blob: 9a8cc6e14168c93681ae0b6c4f90846151c8d9d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
library ieee;
use ieee.std_logic_1164.all;

entity shrs is
  port (
    l3 : std_logic_vector (2 downto 0);
    r4 : std_logic_vector (3 downto 0);

    shl_u3u4u : out std_logic_vector (2 downto 0);
    shl_s3u4s : out std_logic_vector (2 downto 0);
    shr_u3u4u : out std_logic_vector (2 downto 0);
    shr_s3u4s : out std_logic_vector (2 downto 0));
end shrs;

library ieee;
use ieee.std_logic_arith.all;

architecture behav of shrs is
begin
  shl_u3u4u <= std_logic_vector (shl(unsigned(l3), unsigned(r4)));
  shl_s3u4s <= std_logic_vector (shl(signed(l3), unsigned(r4)));
  shr_u3u4u <= std_logic_vector (shr(unsigned(l3), unsigned(r4)));
  shr_s3u4s <= std_logic_vector (shr(signed(l3), unsigned(r4)));
end behav;