forked from semicolonmissin/iitbcpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSign_ext.vhd
More file actions
61 lines (48 loc) · 1.11 KB
/
Sign_ext.vhd
File metadata and controls
61 lines (48 loc) · 1.11 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
library ieee;
use ieee.std_logic_1164.all;
use IEEE.NUMERIC_STD.ALL;
entity SE_6to16 is
port (
A: in std_logic_vector(5 downto 0);
C: out std_logic_vector(15 downto 0)
);
end entity;
architecture struct of SE_6to16 is
begin
process(A)
begin
C <= std_logic_vector(to_signed(to_integer(signed(A)),16));
end process;
end struct;
library ieee;
use ieee.std_logic_1164.all;
use IEEE.NUMERIC_STD.ALL;
entity SE_9to16 is
port (
A: in std_logic_vector(8 downto 0);
C: out std_logic_vector(15 downto 0)
);
end entity;
architecture struct of SE_9to16 is
begin
process(A)
begin
C <= std_logic_vector(to_signed(to_integer(signed(A)),16));
end process;
end struct;
library ieee;
use ieee.std_logic_1164.all;
use IEEE.NUMERIC_STD.ALL;
entity SE_12to16 is
port (
A: in std_logic_vector(11 downto 0);
C: out std_logic_vector(15 downto 0)
);
end entity;
architecture struct of SE_12to16 is
begin
process(A)
begin
C <= std_logic_vector(to_signed(to_integer(signed(A)),16));
end process;
end struct;