-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignExtenders.vhdl
36 lines (32 loc) · 1.05 KB
/
SignExtenders.vhdl
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
-----------------------------------------------------------------------------------------
-----------------------------------SIGN EXTENDER 6 BIT-----------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity SignExt6 is
port (
inp : in std_logic_vector (5 downto 0);
outp : out std_logic_vector (15 downto 0)
);
end entity SignExt6;
architecture Struc of SignExt6 is
begin
outp(5 downto 0) <= inp;
outp(15 downto 6) <= (others =>inp(5));
end architecture;
-----------------------------------------------------------------------------------------
-----------------------------------SIGN EXTENDER 9 BIT-----------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity SignExt9 is
port (
inp : in std_logic_vector (8 downto 0);
outp : out std_logic_vector (15 downto 0)
);
end entity SignExt9;
architecture Struc of SignExt9 is
begin
outp(8 downto 0) <= inp;
outp(15 downto 9) <= (others =>inp(8));
end architecture;