Hi.
Is there an efficient way to calculate ceil log2 operation (extraction of the exponent out of the floating point number) using FPU math on C28 Delfino MCU?
Thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi.
Is there an efficient way to calculate ceil log2 operation (extraction of the exponent out of the floating point number) using FPU math on C28 Delfino MCU?
Thanks
Alexey Tsirlin said:Is there an efficient way to calculate ceil log2 operation (extraction of the exponent out of the floating point number) using FPU math on C28 Delfino MCU?
Yaminov Kamil said:I see only one way - create your own look-up table in memory, and then approximate log2 function by using Taylor series.
There is a fast atan2 function in the C28x FPU Fast RTS Library - it uses a lookup table method. All source code is included so you could modify it to suit your needs.
http://focus.ti.com/docs/toolsw/folders/print/sprc664.html
Cheers
Lori
Yaminov Kamil said:Heh. Extremely fast way - is to use only lookup table. But it costs memory.
True :)
One clarification - the lookup table used by the fastRTS library algorithum is in the ROM of the device so it won't use up extra RAM memory.
Cheers
Lori
Alexey,
I know it's an old post, but how did you resolve this issue? I have the same requirement. I need a ceil(log2()) function.
John
John,
I didn't find good way to calculate log2 function.... I just had to update my algorithms so I won't need it....
Alexey.
PS. Let me know if you will find suitable solution.
Try to look into CORDIC alghorytm. http://3month-of-life.blogspot.com/2011/02/cordic.html