Floating Point Powers and Logs?

Does anyone have any suggestions on how to do Logs and Powers? Part of the design I'm working on has "log(1 + B^d)", and we're pretty much stuck there. So far, the ideas being kicked around are to either use the Taylor series (I'm not the biggest fan of this), or to try to use CORDIC. I haven't found any free/open IP that looked like it would work, the closest being a couple of (fixed-point) CORDIC cores from Open Cores. Accuracy and speed are the two main concerns, but memory is tight, so I don't know if a lookup table is doable. Are there any other approximations that might work, and might be easier to implement using floating point? And how do the hardware implementations in some FPU's work?

Thanks, Mike

Reply to
Mike Delaney
Loading thread data ...

If this is the only log and power you need to do and if either "B" or "d" is a constant, I'd be suggest trying to do the whole function in one go. I'd be very tempted to come up with a function that is sort of close and then use a Taylor series to fix it.

If "d" is the only variable, breaking it into 2 ranges, one for each sign of "d" would be a natural thing to do.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

I've already implemented these for the VHDL-200x.

formatting link
Take a look at "fphdl_base_alg_pkg.vhd", in floating point.

You will also find synthesizable fixed and floating point packages here. Please give them a try, we need more people pounding on this code.

These series are debugged and working, but not optimized, which is why they are not being made part of the standard.

Reply to
David Bishop

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.