# Forum: FPGA, VHDL & Verilog Logarithm Calculator

 Author: John Hardy (Company: Student) (bibliomaniaster) Posted on: 2010-10-17 13:50

Rate this post
 0 ▲ useful ▼ not useful
do anyone know how to implement
Logarithm calculator (input up to a 32-bit number and get its base 2,
base 10 and base 'e' logs)

 Author: zipp (Guest) Posted on: 2010-10-17 18:50

Rate this post
 0 ▲ useful ▼ not useful
http://www.ibrtses.com/embedded/logarithms.html

 Author: John Hardy (Company: Student) (bibliomaniaster) Posted on: 2010-10-17 20:45

Rate this post
 0 ▲ useful ▼ not useful
Thanks for the information.

But, how can I implement this in Verilog ?

 Author: zipp (Guest) Posted on: 2010-10-17 23:55

Rate this post
 0 ▲ useful ▼ not useful
The first part is aligning the number such that the leading bit is one.
This done by a multiple shift. The second is basically a table. Or a
table with interpolations.

 Author: Hallbergmoser (Guest) Posted on: 2010-10-18 13:52

Rate this post
 0 ▲ useful ▼ not useful
For small bit sizes, you can implement totally it with a table.

 Author: John Hardy (Company: Student) (bibliomaniaster) Posted on: 2010-10-25 22:22

Rate this post
 0 ▲ useful ▼ not useful
Will you please send me, the coding of this program ....

 Author: Marco (Guest) Posted on: 2010-10-26 00:04

Rate this post
 0 ▲ useful ▼ not useful
I can provide you with a code and a license to use it in professional
applications. The code is scalable to 64 Bit wide input vectors and
works for base "e". In conjunction with a pre calculated value of
1/ln(2) or 1/ln(10) you can directly multiply it with the result and
obtain all bases you want to have.

I would charge you with €199,- + VAT, payment by bank wire transfer.

Please drop me a note.

 Author: Paolo (Guest) Posted on: 2010-10-26 15:47

Rate this post
 0 ▲ useful ▼ not useful
I am interested in this core. Can you sent a kind of demo in shape of a
ngc for xilinx for instance?

• $formula (LaTeX syntax)$