Log implementation in vhdl

P

praveen.rajaretnam

Hi all, how can we implement logarithm of a number in VHDL.
any tips ??? thanx
 
J

Jonathan Bromley

Hi all, how can we implement logarithm of a number in VHDL.
any tips ??? thanx

A normaliser counts leading zeros and extracts the mantissa,
so giving the logarithm to within 6dB. Typically you can
then do table lookup on the top few bits of the normalised
result, to get some more accuracy.

Obviously, it depends on the precision you need.

Standard methods such as Taylor series and CORDIC may also
be useful if you want really high precision. Once again,
it's MUCH easier if you normalise the number first, so that
you only need to find the log of a number in the range
0.5 to 1.0
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:[email protected]
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
P

praveen.rajaretnam

Thanks.

Jonathan said:
A normaliser counts leading zeros and extracts the mantissa,
so giving the logarithm to within 6dB. Typically you can
then do table lookup on the top few bits of the normalised
result, to get some more accuracy.

Obviously, it depends on the precision you need.

Standard methods such as Taylor series and CORDIC may also
be useful if you want really high precision. Once again,
it's MUCH easier if you normalise the number first, so that
you only need to find the log of a number in the range
0.5 to 1.0
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:[email protected]
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
M

Mirko Liss

(e-mail address removed):
Hi all, how can we implement logarithm of a number in VHDL.
any tips ??? thanx

Use the shift-and-add Algorithm or maybe the variant used in
D E Knuth volume 1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top