Start to adapt so we can change the representation
[ipdf/vfpu.git] / src / pre_norm_sqrt.vhd
index 364260b..1c8b725 100644 (file)
@@ -1,46 +1,6 @@
 -------------------------------------------------------------------------------
---
--- Project:    <Floating Point Unit Core>
---     
 -- Description: pre-normalization entity for the square-root unit
--------------------------------------------------------------------------------
---
---                             100101011010011100100
---                             110000111011100100000
---                             100000111011000101101
---                             100010111100101111001
---                             110000111011101101001
---                             010000001011101001010
---                             110100111001001100001
---                             110111010000001100111
---                             110110111110001011101
---                             101110110010111101000
---                             100000010111000000000
---
---     Author:          Jidan Al-eryani 
---     E-mail:          [email protected]
---
---  Copyright (C) 2006
---
---     This source file may be used and distributed without        
---     restriction provided that this copyright statement is not   
---     removed from the file and that any derivative work contains 
---     the original copyright notice and the associated disclaimer.
---                                                           
---             THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     
---     EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   
---     TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   
---     FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      
---     OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         
---     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    
---     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   
---     GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        
---     BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  
---     LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  
---     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  
---     OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         
---     POSSIBILITY OF SUCH DAMAGE. 
---
+-- See COPYRIGHT.jop
 
 library ieee ;
 use ieee.std_logic_1164.all;
@@ -73,11 +33,11 @@ signal s_opa_dn : std_logic;
 
 begin
 
-       s_expa <= opa_i(30 downto 23);
-       s_fracta <= opa_i(22 downto 0);
+       s_expa <= opa_i(FP_WIDTH-2 downto FRAC_WIDTH);
+       s_fracta <= opa_i(FRAC_WIDTH-1 downto 0);
 
 
-       exp_o <= s_exp_o(7 downto 0);
+       exp_o <= s_exp_o(EXP_WIDTH-1 downto 0);
        fracta_52_o <= s_fracta_52_o;   
 
        -- opa or opb is denormalized
@@ -95,7 +55,7 @@ begin
        begin
                if rising_edge(clk_i) then
                        if or_reduce(opa_i(30 downto 0))='1' then
-                               s_exp_o <= ("0"&s_exp_tem(8 downto 1)); 
+                               s_exp_o <= ("0"&s_exp_tem(EXP_WIDTH downto 1)); 
                        else 
                                s_exp_o <= "000000000";
                        end if;

UCC git Repository :: git.ucc.asn.au