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

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [adder/] [fpadd_stage4_struct.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 gmarcus
-- VHDL Entity work.FPadd_stage4.interface
2 3 gmarcus
--
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 FPadd_stage4 IS
17
   PORT(
18
      A_SIGN_stage3    : IN     std_logic;
19
      B_XSIGN_stage3   : IN     std_logic;
20
      EXP_base         : IN     std_logic_vector (7 DOWNTO 0);
21
      add_out          : IN     std_logic_vector (28 DOWNTO 0);
22
      clk              : IN     std_logic;
23
      isINF_tab_stage3 : IN     std_logic;
24
      isNaN_stage3     : IN     std_logic;
25
      isZ_tab_stage3   : IN     std_logic;
26
      EXP_norm         : OUT    std_logic_vector (7 DOWNTO 0);
27
      OV_stage4        : OUT    std_logic;
28
      SIG_norm         : OUT    std_logic_vector (27 DOWNTO 0);
29
      Z_SIGN_stage4    : OUT    std_logic;
30
      isINF_tab_stage4 : OUT    std_logic;
31
      isNaN_stage4     : OUT    std_logic;
32
      isZ_tab_stage4   : OUT    std_logic;
33
      zero_stage4      : OUT    std_logic
34
   );
35
 
36
-- Declarations
37
 
38
END FPadd_stage4 ;
39
 
40
--
41 4 gmarcus
-- VHDL Architecture work.FPadd_stage4.struct
42 3 gmarcus
--
43
-- Created by
44
-- Guillermo Marcus, gmarcus@ieee.org
45
-- using Mentor Graphics FPGA Advantage tools.
46
--
47
-- Visit "http://fpga.mty.itesm.mx" for more info.
48
--
49
-- Copyright 2003-2004. V1.0
50
--
51
 
52
 
53
LIBRARY ieee;
54
USE ieee.std_logic_1164.all;
55
USE ieee.std_logic_arith.all;
56
 
57
ARCHITECTURE struct OF FPadd_stage4 IS
58
 
59
   -- Architecture declarations
60
      -- Non hierarchical truthtable declarations
61
 
62
 
63
 
64
   -- Internal signal declarations
65
   SIGNAL EXP_norm_int : std_logic_vector(7 DOWNTO 0);
66
   SIGNAL EXP_selC     : std_logic_vector(7 DOWNTO 0);
67
   SIGNAL OV           : std_logic;
68
   SIGNAL SIG_norm_int : std_logic_vector(27 DOWNTO 0);
69
   SIGNAL SIG_selC     : std_logic_vector(27 DOWNTO 0);
70
   SIGNAL Z_SIGN       : std_logic;
71
   SIGNAL add_out_sign : std_logic;
72
   SIGNAL zero         : std_logic;
73
 
74
 
75
   -- Component Declarations
76
   COMPONENT FPadd_normalize
77
   PORT (
78
      EXP_in  : IN     std_logic_vector (7 DOWNTO 0);
79
      SIG_in  : IN     std_logic_vector (27 DOWNTO 0);
80
      EXP_out : OUT    std_logic_vector (7 DOWNTO 0);
81
      SIG_out : OUT    std_logic_vector (27 DOWNTO 0);
82
      zero    : OUT    std_logic
83
   );
84
   END COMPONENT;
85
   COMPONENT FPselComplement
86
   GENERIC (
87
      SIG_width : integer := 28
88
   );
89
   PORT (
90
      SIG_in  : IN     std_logic_vector (SIG_width DOWNTO 0);
91
      EXP_in  : IN     std_logic_vector (7 DOWNTO 0);
92
      SIG_out : OUT    std_logic_vector (SIG_width-1 DOWNTO 0);
93
      EXP_out : OUT    std_logic_vector (7 DOWNTO 0)
94
   );
95
   END COMPONENT;
96
 
97
   -- Optional embedded configurations
98
   -- pragma synthesis_off
99 4 gmarcus
   FOR ALL : FPadd_normalize USE ENTITY work.FPadd_normalize;
100
   FOR ALL : FPselComplement USE ENTITY work.FPselComplement;
101 3 gmarcus
   -- pragma synthesis_on
102
 
103
 
104
BEGIN
105
   -- Architecture concurrent statements
106
   -- HDL Embedded Text Block 2 eb2
107
   -- reg1 1
108
   PROCESS(clk)
109
   BEGIN
110
      IF RISING_EDGE(clk) THEN
111
         Z_SIGN_stage4 <= Z_SIGN;
112
         OV_stage4 <= OV;
113
         EXP_norm <= EXP_norm_int;
114
         SIG_norm <= SIG_norm_int;
115
         zero_stage4 <= zero;
116
         isINF_tab_stage4 <= isINF_tab_stage3;
117
         isNaN_stage4 <= isNaN_stage3;
118
         isZ_tab_stage4 <= isZ_tab_stage3;
119
      END IF;
120
   END PROCESS;
121
 
122
   -- HDL Embedded Text Block 4 eb4
123
   -- eb4 4 
124
   add_out_sign <= add_out(28);
125
 
126
   -- HDL Embedded Block 6 SignLogic
127
   -- Non hierarchical truthtable
128
   ---------------------------------------------------------------------------
129
   SignLogic_truth_process: PROCESS(A_SIGN_stage3, B_XSIGN_stage3, add_out_sign)
130
   ---------------------------------------------------------------------------
131
      VARIABLE b1_A_SIGN_stage3B_XSIGN_stage3add_out_sign : std_logic_vector(2 DOWNTO 0);
132
   BEGIN
133
      -- Block 1
134
      b1_A_SIGN_stage3B_XSIGN_stage3add_out_sign := A_SIGN_stage3 & B_XSIGN_stage3 & add_out_sign;
135
 
136
      CASE b1_A_SIGN_stage3B_XSIGN_stage3add_out_sign IS
137
      WHEN "000" =>
138
         OV <= '0';
139
         Z_SIGN <= '0';
140
      WHEN "001" =>
141
         OV <= '1';
142
         Z_SIGN <= '0';
143
      WHEN "010" =>
144
         OV <= '0';
145
         Z_SIGN <= '0';
146
      WHEN "011" =>
147
         OV <= '0';
148
         Z_SIGN <= '1';
149
      WHEN "100" =>
150
         OV <= '0';
151
         Z_SIGN <= '0';
152
      WHEN "101" =>
153
         OV <= '0';
154
         Z_SIGN <= '1';
155
      WHEN "110" =>
156
         OV <= '0';
157
         Z_SIGN <= '1';
158
      WHEN "111" =>
159
         OV <= '1';
160
         Z_SIGN <= '1';
161
      WHEN OTHERS =>
162
         OV <= '0';
163
         Z_SIGN <= '0';
164
      END CASE;
165
 
166
   END PROCESS SignLogic_truth_process;
167
 
168
   -- Architecture concurrent statements
169
 
170
 
171
 
172
 
173
   -- Instance port mappings.
174
   I8 : FPadd_normalize
175
      PORT MAP (
176
         EXP_in  => EXP_selC,
177
         SIG_in  => SIG_selC,
178
         EXP_out => EXP_norm_int,
179
         SIG_out => SIG_norm_int,
180
         zero    => zero
181
      );
182
   I12 : FPselComplement
183
      GENERIC MAP (
184
         SIG_width => 28
185
      )
186
      PORT MAP (
187
         SIG_in  => add_out,
188
         EXP_in  => EXP_base,
189
         SIG_out => SIG_selC,
190
         EXP_out => EXP_selC
191
      );
192
 
193
END struct;

powered by: WebSVN 2.1.0

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