Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

implementing LOG10 in verilog, please help

Status
Not open for further replies.

ramlogo

Newbie level 3
Joined
Jan 10, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,311
Hi,

I am trying to work out a LOG10 module in verilog by the tutorial
https://www.mikrocontroller.net/attachment/31117/cordic1.pdf

so far so good, i got this module working and pipelined, and the error is <0.002.

BUT, there is a restriction by this algorithm, that is:

according to the algorithm, the range of input(mW) is restricted to
1/prod(1+2.^(-x)) to 1/prod(1-2.^(-x)), where

0.41942884 < input(mW) < 3.46269378

Now I want to extend the range of input, ideally from 0.0001 to 10000. I tried to pre-scale the the input by the identity: log(a*b)=log(a)+log(b), it works, but at the same time, the error is rising to 0.1(or worse), which is not acceptable.

anyway, here can anyone give me some idea on extending the input range but without any accuency decrease

any advice will be appreciate.

Thank in advance

Regards,

Jerome G. J.
 

Hi,

I would prescale with log(x) = log(x' * 2^n)
with n selected in a way that x' is always in the range of 1..2
(in hardware finding n means finding the position of the msb)

this results in log(x) = log(x') + n*log(2)
log(2) can come from a table and you can hold it as percise as you want.
So the final result should always have the similar accuracy

I tried to implement this, but at the moment I have problems with the base algorithm from your paper.
I implemented it, but for numbers around 1.1 I already have a huge error
(similar for numbers around 2.02)


regards
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top