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.

Is it possible to do log of numbers in 8-bit mcu (Assembly)?

Status
Not open for further replies.

comp_freak

Member level 1
Joined
Jan 19, 2006
Messages
40
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,687
8-bit PIC and Log

is it possible to do log of numbers in 8-bit mcu using assembly? FOr example if i have to find log 28? or anynumber.... or does anyone knw any library available from microchip????????:?:
 

VVV

Advanced Member level 5
Joined
Nov 26, 2004
Messages
1,582
Helped
384
Reputation
768
Reaction score
87
Trophy points
1,328
Activity points
19,971
Re: 8-bit PIC and Log

I am not aware of such a library, but of course you can do that in assembly.
Probably the easiest way would be to do a lookup table (or more), seeing that log of any number below 10 is less than one and for the tens you just add 1, for hundreds 2, and so on.

Take your example:
log 28= log (10*2.8)=log (10)+log (2.8)=1+log(2.8)=1.447
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top