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/] [DualPathFPAdder/] [FarPath.v] - Diff between revs 9 and 10

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 9 Rev 10
Line 23... Line 23...
                                                        parameter size_exponent                         = 8,
                                                        parameter size_exponent                         = 8,
                                                        parameter pipeline                                      = 0,
                                                        parameter pipeline                                      = 0,
                                                        parameter pipeline_pos                          = 0,     // 8 bits
                                                        parameter pipeline_pos                          = 0,     // 8 bits
                                                        parameter size_counter                          = 5,    //log2(size_in_mantissa) + 1 = 5)
                                                        parameter size_counter                          = 5,    //log2(size_in_mantissa) + 1 = 5)
                                                        parameter double_size_in_mantissa   = size_in_mantissa + size_in_mantissa)
                                                        parameter double_size_in_mantissa   = size_in_mantissa + size_in_mantissa)
                                                (       input [size_in_mantissa         : 0] unnormalized_mantissa,
                                                (       input [size_in_mantissa - 1     : 0] m_a_number,
                                                        input [size_in_mantissa - 1 : 0] inter_rounding_bits,
                                                        input [size_in_mantissa - 1 : 0] m_b_number,
 
                                                        input eff_op,
                                                        input [size_exponent            : 0] exp_inter,
                                                        input [size_exponent            : 0] exp_inter,
 
                                                        input [size_exponent - 1 : 0] exp_difference,
                                                        output[size_out_mantissa- 1 : 0] resulted_m_o,
                                                        output[size_out_mantissa- 1 : 0] resulted_m_o,
                                                        output[size_exponent - 1        : 0] resulted_e_o);
                                                        output[size_exponent - 1        : 0] resulted_e_o);
 
 
        wire [size_exponent- 1 : 0] adjust_mantissa;
        wire [size_exponent- 1 : 0] adjust_mantissa;
        wire [size_exponent- 1 : 0] unadjusted_exponent;
        wire [size_exponent- 1 : 0] unadjusted_exponent;
        wire [double_size_in_mantissa:0] normalized_mantissa;
        wire [double_size_in_mantissa:0] normalized_mantissa;
 
 
 
        wire [size_in_mantissa-1: 0] shifted_m_b;
 
        wire [size_in_mantissa+1: 0] adder_mantissa;
 
        wire [size_in_mantissa  : 0] unnormalized_mantissa;
 
 
 
        wire [size_in_mantissa - 1 : 0] initial_rounding_bits, inter_rounding_bits;
 
 
        wire dummy_bit;
        wire dummy_bit;
 
 
 
        //shift m_b_number                              
 
        shifter #(      .INPUT_SIZE(size_in_mantissa),
 
                                .SHIFT_SIZE(size_exponent),
 
                                .OUTPUT_SIZE(double_size_in_mantissa),
 
                                .DIRECTION(1'b0), //0=right, 1=left
 
                                .PIPELINE(pipeline),
 
                                .POSITION(pipeline_pos))
 
                m_b_shifter_instance(   .a(m_b_number),//mantissa
 
                                                                .arith(1'b0),//logical shift
 
                                                                .shft(exp_difference),
 
                                                                .shifted_a({shifted_m_b, initial_rounding_bits}));
 
 
 
        //compute unnormalized_mantissa
 
        assign adder_mantissa = (eff_op)? ({1'b0, m_a_number} - {1'b0, shifted_m_b}) : ({1'b0, m_a_number} + {1'b0, shifted_m_b});
 
 
 
        assign {unnormalized_mantissa, inter_rounding_bits} =
 
                                                                (adder_mantissa[size_in_mantissa + 1])? ({~adder_mantissa[size_in_mantissa : 0], ~initial_rounding_bits}) :
 
                                                                                                                                                ({adder_mantissa[size_in_mantissa       : 0], initial_rounding_bits});
 
 
        assign adjust_mantissa = unnormalized_mantissa[size_in_mantissa]? 2'd0 :
        assign adjust_mantissa = unnormalized_mantissa[size_in_mantissa]? 2'd0 :
                                                                                unnormalized_mantissa[size_in_mantissa-1]? 2'd1 : 2'd2;
                                                                                unnormalized_mantissa[size_in_mantissa-1]? 2'd1 : 2'd2;
 
 
 
 
        //compute shifting over unnormalized_mantissa
        //compute shifting over unnormalized_mantissa

powered by: WebSVN 2.1.0

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