URL
https://opencores.org/ocsvn/xilinx_virtex_fp_library/xilinx_virtex_fp_library/trunk
Show entire file |
Details |
Blame |
View Log
Rev 3 |
Rev 9 |
Line 16... |
Line 16... |
// Revision:
|
// Revision:
|
// Revision 0.01 - File Created
|
// Revision 0.01 - File Created
|
// Additional Comments:
|
// Additional Comments:
|
//
|
//
|
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
module accumulate #( parameter size_mantissa = 24, //mantissa bits
|
module accumulate #( parameter size_mul_mantissa = 48) //mantissa bits)
|
parameter size_counter = 5, //log2(size_quotient) + 1 = 5
|
( input [size_mul_mantissa - 1:0] m_a,
|
parameter size_mul_mantissa = size_mantissa + size_mantissa)
|
input [size_mul_mantissa - 1:0] m_b,
|
( input [size_mul_mantissa-1:0] ab_number_i,
|
input eff_op,
|
input [size_mul_mantissa-1:0] c_number_i,
|
output[size_mul_mantissa + 1 : 0] adder_mantissa);
|
input sub,
|
|
output ovf,
|
|
output[size_mul_mantissa :0] acc_resulting_number_o);
|
|
|
|
assign {ovf, acc_resulting_number_o} = sub? ((ab_number_i >=c_number_i)? (ab_number_i - c_number_i) : (c_number_i - ab_number_i)) : c_number_i + ab_number_i;
|
assign adder_mantissa = (eff_op)? ({1'b0, m_a} - {1'b0, m_b}) : ({1'b0, m_a} + {1'b0, m_b});
|
|
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.