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

Subversion Repositories xilinx_virtex_fp_library

[/] [xilinx_virtex_fp_library/] [trunk/] [SinglePrecision/] [sign_comp.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 bigsascha3
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    09:28:06 02/07/2013 
6
-- Design Name: 
7
-- Module Name:    sign_comp - 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 sign_comp is
33
        port (sign_a, sign_b : in std_logic;
34
                        sign_c : in std_logic;
35
                        comp_exp : in std_logic;
36
                        eff_sub : in std_logic;
37
                        sign_add : in std_logic;
38
                        sign_res : out std_logic);
39
end sign_comp;
40
 
41
architecture Behavioral of sign_comp is
42
 
43
        signal sign_int : std_logic;
44
 
45
begin
46
 
47
        process (sign_a, sign_b, sign_c, comp_exp,
48
                eff_sub, sign_add)
49
        begin
50
                sign_int <= sign_c;
51
 
52
                --if(eff_sub = '1') then
53
                --      if(comp_exp = '1') then 
54
                --              sign_int <= sign_a xor sign_b;
55
                --      elsif (comp_exp = '0' and sign_add = '0') then
56
                --              sign_int <= sign_c;
57
                --      else
58
                --              sign_int <= sign_a xor sign_b;
59
                --      end if;
60
                --end if;
61
 
62
                if (eff_sub = '1') then
63
                        if (comp_exp = '1') then
64
                                sign_int <= not(sign_a xor sign_b);
65
                        elsif(comp_exp = '0' and sign_add = '0') then
66
                                sign_int <= sign_c;
67
                        else
68
                                sign_int <= sign_a xor sign_b;
69
                        end if;
70
                end if;
71
 
72
        end process;
73
 
74
        sign_res <= sign_int;
75
 
76
end Behavioral;
77
 

powered by: WebSVN 2.1.0

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