cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
8,606 Views
Registered: ‎08-06-2009

Implementation logarithm with CORDIC IP core?

Hello,

I need to implement the natural logarithm function and I'm trying to find out if I can use any IP core before implementing it myself. From what I've understood by reading here and there on the web, it could be possible to compute a logarithm by using the Cordic algorithm... However, mathematically, the logarithm depends on the inverse sinh function, which is not implemented by Cordic 4.0. I probably might calculate somehow, but I would need to instantiate too many cores.

Am I making any mistakes or not noticing something or is it actually impossible to computer a logarithm with the Cordic core?

Thank you!

0 Kudos
5 Replies
Highlighted
Xilinx Employee
Xilinx Employee
8,594 Views
Registered: ‎11-28-2007

If you use System Generator, you can use the CORDIC LOG reference block in Xilinx Reference Blockset.

Cheers,
Jim
0 Kudos
Highlighted
Visitor
Visitor
8,363 Views
Registered: ‎10-29-2010

Hello.

 

I am having the same problem but I cannot use system generator since I don't have MATLAB.

 

Are there any other ways?

 

Thank you.

0 Kudos
Highlighted
Teacher
Teacher
8,307 Views
Registered: ‎09-09-2010

You could do log2 by a look-up-table, implemented in a psuedo-ROM (by which I mean a BlockRAM initialised to the required value, then never written to).

A bit fiddly, but I have created Pseudo-ROMs for sine and cosine to avoid latency due to CORDIC implementations.

------------------------------------------
"If it don't work in simulation, it won't work on the board."
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
8,291 Views
Registered: ‎05-23-2008

Hi Could you could write the log2 function as HDL function and then use that to create your array?

 

regards

Mike

0 Kudos
Highlighted
Adventurer
Adventurer
7,516 Views
Registered: ‎02-09-2012

the logarithm depends on the inverse sinh function

 

You can use the atanh instead by expecting ln (x) = atanh((x-1) / (x+1))

 

 

 

0 Kudos