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

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [common/] [unpackfp_unpackfp.vhd] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gmarcus
--
2
-- VHDL Architecture HAVOC.UnpackFP.UnpackFP
3
--
4
-- Created:
5
--          by - Guillermo
6
--          at - ITESM, 09:06:00 07/16/03
7
--
8
-- Generated by Mentor Graphics' HDL Designer(TM) 2002.1b (Build 7)
9
--
10
-- hds interface_start
11
LIBRARY ieee;
12
USE ieee.std_logic_1164.all;
13
USE ieee.std_logic_arith.all;
14
 
15
ENTITY UnpackFP IS
16
   PORT(
17
      FP    : IN     std_logic_vector (31 DOWNTO 0);
18
      SIG   : OUT    std_logic_vector (31 DOWNTO 0);
19
      EXP   : OUT    std_logic_vector (7 DOWNTO 0);
20
      SIGN  : OUT    std_logic;
21
      isNaN : OUT    std_logic;
22
      isINF : OUT    std_logic;
23
      isZ   : OUT    std_logic;
24
      isDN  : OUT    std_logic
25
   );
26
 
27
-- Declarations
28
 
29
END UnpackFP ;
30
 
31
 
32
-- hds interface_end
33
ARCHITECTURE UnpackFP OF UnpackFP IS
34
        SIGNAL exp_int : std_logic_vector(7 DOWNTO 0);
35
        SIGNAL sig_int : std_logic_vector(22 DOWNTO 0);
36
        SIGNAL expZ, expFF, sigZ : std_logic;
37
BEGIN
38
        exp_int <= FP(30 DOWNTO 23);
39
        sig_int <= FP(22 DOWNTO 0);
40
 
41
        SIGN <= FP(31);
42
        EXP <= exp_int;
43
        SIG(22 DOWNTO 0) <= sig_int;
44
 
45
        expZ <= '1' WHEN (exp_int=X"00") ELSE '0';
46
        expFF <= '1' WHEN (exp_int=X"FF") ELSE '0';
47
 
48
        sigZ <= '1' WHEN (sig_int="00000000000000000000000") ELSE '0';
49
 
50
        isNaN <= expFF AND (NOT sigZ);
51
        isINF <= expFF AND sigZ;
52
        isZ <= expZ AND sigZ;
53
        isDN <= expZ AND (NOT sigZ);
54
 
55
        -- Restore hidden 1.ffff when not zero or denormal
56
        SIG(23) <= NOT expZ;
57
 
58
        SIG(31 DOWNTO 24) <= (OTHERS => '0');
59
END UnpackFP;
60
 

powered by: WebSVN 2.1.0

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