Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Log implementation in vhdl

 
Thread Tools Search this Thread
Old 06-24-2005, 03:36 PM   #1
Default Log implementation in vhdl


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



praveen.rajaretnam@gmail.com
  Reply With Quote
Old 06-24-2005, 04:16 PM   #2
TigerJade
 
Posts: n/a
Default Re: Log implementation in vhdl
LUT?



TigerJade
  Reply With Quote
Old 06-24-2005, 05:20 PM   #3
Jonathan Bromley
 
Posts: n/a
Default Re: Log implementation in vhdl
On 24 Jun 2005 07:36:14 -0700, wrote:

>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:
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.


Jonathan Bromley
  Reply With Quote
Old 06-25-2005, 03:57 AM   #4
David Bishop
 
Posts: n/a
Default Re: Log implementation in vhdl
wrote:

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


You'll find one is the floating point algorithms:

http://www.eda.org/vhdl-200x/vhdl-20...ges/files.html
The file is:
http://www.eda.org/vhdl-200x/vhdl-20...se_alg_pkg.vhd


David Bishop
  Reply With Quote
Old 06-25-2005, 03:31 PM   #5
praveen.rajaretnam@gmail.com
 
Posts: n/a
Default Re: Log implementation in vhdl
Thanks.

Jonathan Bromley wrote:
> On 24 Jun 2005 07:36:14 -0700, wrote:
>
> >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:
> 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.




praveen.rajaretnam@gmail.com
  Reply With Quote
Old 06-27-2005, 07:36 AM   #6
Mirko Liss
 
Posts: n/a
Default Re: Log implementation in vhdl
:
> 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.


Mirko Liss
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute an external software from VHDL? And how to interface VHDL with JAVA? becool_nikks Software 0 03-06-2009 07:08 PM
reading mp3 file in binary format in vhdl latheesh General Help Related Topics 0 02-05-2008 05:40 AM
Help on auto conversion from Matlab to vhdl on filter design hardheart Hardware 0 12-07-2007 09:19 AM
ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL freitass Hardware 0 11-01-2007 03:44 PM
vhdl code amirster Hardware 0 05-10-2007 07:28 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46