nicklas_a74
Member level 1
Hi
I want to have generic input values e.g. a and b what are used to initialize a
constant by e.g. constant c:= a/b; However due to the division the
correct answer could be 4.6 but it’s rounded down to closest integer 4 as default.
How to being able to initialize the c and have a rounding to closest integer 5?
The code should be synthesizable and use the standard libraries. Is there a
way to do this without fixedpoint or special math library?
I want to have generic input values e.g. a and b what are used to initialize a
constant by e.g. constant c:= a/b; However due to the division the
correct answer could be 4.6 but it’s rounded down to closest integer 4 as default.
How to being able to initialize the c and have a rounding to closest integer 5?
The code should be synthesizable and use the standard libraries. Is there a
way to do this without fixedpoint or special math library?