cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
621 Views
Registered: ‎03-20-2018

Floating Point Division by 2

Hello,

 

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,

Rashmi

 

0 Kudos
2 Replies
Highlighted
Scholar
Scholar
614 Views
Registered: ‎04-26-2015

Re: Floating Point Division by 2

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.

Highlighted
Observer
Observer
557 Views
Registered: ‎03-20-2018

Re: Floating Point Division by 2

That is probably what happened! Thanks for the help!

0 Kudos