05-04-2018 02:38 AM
We have a single precision floating point value (32 bits) and we want to perform a divide by 2 operation on it.
We are using a Floating Point Multiplier IP to multiply by 0.5 instead of using a Divider IP(8 clock cycle delay instead of 28 and also better resource utilization)
Alternately, we tried subtracting only the exponent part of the value by 1. This can be achieved in 1 clock cycle.This works fine in simulation. On the hardware, it works fine most of the time but occasionally results in a +Inf.
Could you please help me understand what the problem is in subtracting the exponent by -1 ?
Thanks and Regards,
05-04-2018 03:15 AM
I would imagine that it occurs when the exponent is zero, and subtracting 1 wraps it around to 0xFF. This is the IEEE 754 code for infinity.