how to find natural logarithm of a number in assembly lang

Status
Not open for further replies.

keila

Newbie level 6
Joined
Feb 4, 2006
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
INDIA
Activity points
1,363
logarithm assembly

Hi,
Im working on a project where i need a thermistor to sense the temperature. Im working in assembly. The controller I'm using is 8051. As the thermistor characteristics are exponential i need to find the (ln) value of my ADC count. So my problem is how to find the logarithm of a number in assembly language?
could anyone here can help me in this regard?
 

how to find the natural log of a number

Maybe you should consider a look-up table ..
It wastes a lot of memory space but it is the simplest method of converting numbers to numbers ..

Regards,
IanP
 

    keila

    Points: 2
    Helpful Answer Positive Rating
assembly logarithm

luk up table ! upto what length ?
How could "pade approximation" help in this?
 

natural logarithm assembler

IanP is correct, a lookup table would be the easiest since most likely you are only concerned about finding the natural log over a fixed interval of inputs.

An alternative is to calculate some number of terms of the Taylor series for ln(x).

The Pade approximation is simply another series which can be generated to approximate ln(x). The idea is similar to the Taylor series. I searched google and found this link **broken link removed**

-jonathan
 

    keila

    Points: 2
    Helpful Answer Positive Rating
find natural log

Thks jonathan! I had seen that link already and im writing code for my A/D converter, basing on PADE approximation. One thing I want to ask again is when measuring temperature over a full range from 0 degrees centigrade to 100 degrees centigrade, should i maintain 100 values in luk up table?
 

how to find the log of a number

You could, or you could store fewer values and use interpolation between stored values (interpolation costs time and code). It depends on how much error you can tolerate, etc. 100 values is not too big of a table if you've got some program memory to spare and it's easiest as IanP stated earlier.

-jonathan
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…