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/] [exp_add_norm.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:14:54 02/07/2013 
6
-- Design Name: 
7
-- Module Name:    exp_add_norm - 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
use IEEE.std_logic_unsigned.all;
23
use IEEE.std_logic_arith.all;
24
 
25
-- Uncomment the following library declaration if using
26
-- arithmetic functions with Signed or Unsigned values
27
--use IEEE.NUMERIC_STD.ALL;
28
 
29
-- Uncomment the following library declaration if instantiating
30
-- any Xilinx primitives in this code.
31
--library UNISIM;
32
--use UNISIM.VComponents.all;
33
 
34
entity exp_add_norm is
35
        generic (SIZE_EXP : natural := 5;
36
                                PIPELINE : natural := 0);
37
        port (clk, rst : in std_logic;
38
                        exp_in : in std_logic_vector(SIZE_EXP - 1 downto 0);
39
                        ovf_norm : in std_logic_vector (1 downto 0);
40
                        ovf_rnd : in std_logic;
41
                        exp_out : out std_logic_vector(SIZE_EXP - 1 downto 0));
42
end exp_add_norm;
43
 
44
architecture Behavioral of exp_add_norm is
45
 
46
        component d_ff
47
                generic (N: natural := 8);
48
                port (clk, rst : in std_logic;
49
                                d : in std_logic_vector (N-1 downto 0);
50
                                q : out std_logic_vector (N-1 downto 0));
51
        end component;
52
 
53
        signal exp_add_d, exp_add_q : std_logic_vector(SIZE_EXP - 1  downto 0);
54
 
55
begin
56
 
57
        exp_add_d <= exp_in + ovf_norm;
58
 
59
        exp_out <= exp_add_q + ovf_rnd;
60
 
61
        NO_LATCH:
62
                if PIPELINE = 0 generate
63
                        no_ins : exp_add_q <= exp_add_d;
64
                end generate;
65
 
66
        LATCH :
67
                if PIPELINE = 1 generate
68
                        ins : d_ff generic map (SIZE_EXP)
69
                                                port map (clk, rst, exp_add_d, exp_add_q);
70
                end generate;
71
 
72
end Behavioral;
73
 

powered by: WebSVN 2.1.0

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