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

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [multiplier/] [fpmul_stage2_struct.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gmarcus
-- VHDL Entity HAVOC.FPmul_stage2.interface
2
--
3
-- Created by
4
-- Guillermo Marcus, gmarcus@ieee.org
5
-- using Mentor Graphics FPGA Advantage tools.
6
--
7
-- Visit "http://fpga.mty.itesm.mx" for more info.
8
--
9
-- 2003-2004. V1.0
10
--
11
 
12
LIBRARY ieee;
13
USE ieee.std_logic_1164.all;
14
USE ieee.std_logic_arith.all;
15
 
16
ENTITY FPmul_stage2 IS
17
   PORT(
18
      A_EXP           : IN     std_logic_vector (7 DOWNTO 0);
19
      A_SIG           : IN     std_logic_vector (31 DOWNTO 0);
20
      B_EXP           : IN     std_logic_vector (7 DOWNTO 0);
21
      B_SIG           : IN     std_logic_vector (31 DOWNTO 0);
22
      SIGN_out_stage1 : IN     std_logic;
23
      clk             : IN     std_logic;
24
      isINF_stage1    : IN     std_logic;
25
      isNaN_stage1    : IN     std_logic;
26
      isZ_tab_stage1  : IN     std_logic;
27
      EXP_in          : OUT    std_logic_vector (7 DOWNTO 0);
28
      EXP_neg_stage2  : OUT    std_logic;
29
      EXP_pos_stage2  : OUT    std_logic;
30
      SIGN_out_stage2 : OUT    std_logic;
31
      SIG_in          : OUT    std_logic_vector (27 DOWNTO 0);
32
      isINF_stage2    : OUT    std_logic;
33
      isNaN_stage2    : OUT    std_logic;
34
      isZ_tab_stage2  : OUT    std_logic
35
   );
36
 
37
-- Declarations
38
 
39
END FPmul_stage2 ;
40
 
41
--
42
-- VHDL Architecture HAVOC.FPmul_stage2.struct
43
--
44
-- Created by
45
-- Guillermo Marcus, gmarcus@ieee.org
46
-- using Mentor Graphics FPGA Advantage tools.
47
--
48
-- Visit "http://fpga.mty.itesm.mx" for more info.
49
--
50
-- Copyright 2003-2004. V1.0
51
--
52
 
53
 
54
LIBRARY ieee;
55
USE ieee.std_logic_1164.all;
56
USE ieee.std_logic_arith.all;
57
 
58
 
59
ARCHITECTURE struct OF FPmul_stage2 IS
60
 
61
   -- Architecture declarations
62
 
63
   -- Internal signal declarations
64
   SIGNAL EXP_in_int  : std_logic_vector(7 DOWNTO 0);
65
   SIGNAL EXP_neg_int : std_logic;
66
   SIGNAL EXP_pos_int : std_logic;
67
   SIGNAL SIG_in_int  : std_logic_vector(27 DOWNTO 0);
68
   SIGNAL dout        : std_logic;
69
   SIGNAL dout1       : std_logic_vector(7 DOWNTO 0);
70
   SIGNAL prod        : std_logic_vector(63 DOWNTO 0);
71
 
72
 
73
 
74
BEGIN
75
   -- Architecture concurrent statements
76
   -- HDL Embedded Text Block 1 sig
77
   -- eb1 1
78
   SIG_in_int <= prod(47 DOWNTO 20);
79
 
80
   -- HDL Embedded Text Block 2 inv
81
   -- eb5 5
82
   EXP_in_int <= (NOT dout1(7)) & dout1(6 DOWNTO 0);
83
 
84
   -- HDL Embedded Text Block 3 latch
85
   -- eb2 2
86
 
87
   PROCESS(clk)
88
   BEGIN
89
      IF RISING_EDGE(clk) THEN
90
         EXP_in <= EXP_in_int;
91
         SIG_in <= SIG_in_int;
92
         EXP_pos_stage2 <= EXP_pos_int;
93
         EXP_neg_stage2 <= EXP_neg_int;
94
      END IF;
95
   END PROCESS;
96
 
97
   -- HDL Embedded Text Block 4 latch2
98
   -- latch2 4
99
   PROCESS(clk)
100
   BEGIN
101
      IF RISING_EDGE(clk) THEN
102
         isINF_stage2 <= isINF_stage1;
103
         isNaN_stage2 <= isNaN_stage1;
104
         isZ_tab_stage2 <= isZ_tab_stage1;
105
         SIGN_out_stage2 <= SIGN_out_stage1;
106
      END IF;
107
   END PROCESS;
108
 
109
   -- HDL Embedded Text Block 5 eb1
110
   -- exp_pos 5
111
   EXP_pos_int <= A_EXP(7) AND B_EXP(7);
112 4 gmarcus
--   EXP_neg_int <= NOT(A_EXP(7) OR B_EXP(7));
113
   EXP_neg_int <= '1' WHEN ( (A_EXP(7)='0' AND NOT (A_EXP=X"7F")) AND (B_EXP(7)='0' AND NOT (B_EXP=X"7F")) ) ELSE '0';
114 3 gmarcus
 
115
 
116
   -- ModuleWare code(v1.1) for instance 'I4' of 'add'
117
   I4combo: PROCESS (A_EXP, B_EXP, dout)
118
   VARIABLE mw_I4t0 : std_logic_vector(8 DOWNTO 0);
119
   VARIABLE mw_I4t1 : std_logic_vector(8 DOWNTO 0);
120
   VARIABLE mw_I4sum : unsigned(8 DOWNTO 0);
121
   VARIABLE mw_I4carry : std_logic;
122
   BEGIN
123
      mw_I4t0 := '0' & A_EXP;
124
      mw_I4t1 := '0' & B_EXP;
125
      mw_I4carry := dout;
126
      mw_I4sum := unsigned(mw_I4t0) + unsigned(mw_I4t1) + mw_I4carry;
127
      dout1 <= conv_std_logic_vector(mw_I4sum(7 DOWNTO 0),8);
128
   END PROCESS I4combo;
129
 
130
   -- ModuleWare code(v1.1) for instance 'I2' of 'mult'
131
   I2combo : PROCESS (A_SIG, B_SIG)
132
   VARIABLE dtemp : unsigned(63 DOWNTO 0);
133
   BEGIN
134
      dtemp := (unsigned(A_SIG) * unsigned(B_SIG));
135
      prod <= std_logic_vector(dtemp);
136
   END PROCESS I2combo;
137
 
138
   -- ModuleWare code(v1.1) for instance 'I6' of 'vdd'
139
   dout <= '1';
140
 
141
   -- Instance port mappings.
142
 
143
END struct;

powered by: WebSVN 2.1.0

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