blob: d1e6303e6afe4e74fb46d8ad7c1d44e5c0a21c28 (
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
25
26
27
28
29
30
|
library ieee;
use ieee.std_logic_1164.all,
ieee.numeric_std.all;
entity ent is
port (
clk : in std_logic;
i : in std_logic_vector(7 downto 0);
amount : in integer range 0 to 7;
const_half : out signed(7 downto 0);
async_ror : out std_logic_vector(7 downto 0);
clocked_left : out unsigned(7 downto 0)
);
end;
architecture a of ent is
constant ONE : unsigned(3 downto 0) := x"4" srl 2;
begin
const_half <= signed(i) sra to_integer(ONE);
async_ror <= i ror amount;
process(clk)
begin
if rising_edge(clk) then
clocked_left <= unsigned(i) sll amount;
end if;
end process;
end;
|