Forum: FPGA, VHDL & Verilog 10 Base Logarithm

von Kostak (Guest)

Rate this post
0 useful
not useful
I try to calculate 10 base logarithm of numbers which is between 0 and 
1023. I want to show 5 digits fractional. Normally Verilog "log10(x)" 
syntax only show the integer version of the result. I multiply by 100000 
to show the fractional parts but it did not work. How can I fix it?

assign y = 'd100000 * $log10(x);

von Lothar M. (lkmiller) (Moderator)

Rate this post
0 useful
not useful
Kostak wrote:
> but it did not work.
What did not work? What did you expect, and what happened instead?


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.