OpenCores
URL https://opencores.org/ocsvn/mipsr2000/mipsr2000/trunk

Subversion Repositories mipsr2000

[/] [mipsr2000/] [trunk/] [Ext_sz.vhd] - Blame information for rev 64

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 64 jimi39
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    20:00:20 06/19/2012 
6
-- Design Name: 
7
-- Module Name:    Ext_sz - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
 
23
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--use IEEE.NUMERIC_STD.ALL;
26
 
27
-- Uncomment the following library declaration if instantiating
28
-- any Xilinx primitives in this code.
29
--library UNISIM;
30
--use UNISIM.VComponents.all;
31
 
32
entity Ext_sz is
33
port (
34
      clk : in  STD_LOGIC;
35
           rst : in  STD_LOGIC;
36
      immed_addr : in std_logic_vector(15 downto 0);
37
                Ext_sz_c   : in std_logic;
38
      Ext_sz     : out std_logic_vector(31 downto 0)
39
 
40
 
41
);
42
end Ext_sz;
43
 
44
architecture Behavioral of Ext_sz is
45
shared variable Ext_internal : std_logic_vector(31 downto 0);
46
 
47
begin
48
       process(Ext_sz_c,immed_addr)
49
                 variable sign_c : std_logic_vector(15 downto 0) := "0000000000000000";
50
        variable sign_exit : std_logic_vector(31 downto 0) := "00000000000000000000000000000000";
51
                 begin
52
                       case Ext_sz_c is
53
             when '0' =>
54
                     sign_c(0 downto 0) := immed_addr(15 downto 15);
55
                                                        for I in 1 to 15 loop
56
                                                        sign_c(I) := sign_c(0);
57
                                                        end loop;
58
                                                        sign_exit(31 downto 16) := sign_c(15 downto 0);
59
                     sign_exit(15 downto 0) := immed_addr(15 downto 0);
60
                                 when '1' =>
61
                                         sign_exit(31 downto 16) := "0000000000000000";
62
                                                        sign_exit(15 downto 0) := immed_addr(15 downto 0);
63
 
64
             when others => sign_exit := (others =>'0');
65
             end case;
66
 
67
                       Ext_internal := sign_exit;
68
                 end process;
69
 
70
                 process(clk,rst)
71
                 begin
72
                       if rst = '0' then
73
                                           Ext_sz  <= (others => '0');
74
                                 elsif (RISING_EDGE(Clk))then
75
                                         Ext_sz <= Ext_internal;
76
             end if;
77
                 end process;
78
 
79
 
80
end Behavioral;
81
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.