How can I use Keil to compute exponential function? is use #include <stdlib.h>? thank you sir.
http://www.keil.com/support/man/docs/c51/c51_exp.htm http://www.keil.com/demo/limits.asp You could also try a lookup table. Remember: the 8051 is a simple 8-bit microcontroller - it is not generally well suited to maths-intensive applications.
thank you for your helping very much. I feel so good for every your answer.This help me understand about KEIL better than two days ago. And this time, I have some question to ask go again. :D . Can Keil compute Imaginary part?. this program I show you about my idea to compute Img. #include <math.h> ... i = sqrt(-1); Is it correct program?. Thank alot for your answer. pattaraporn;
"This help me understand about KEIL better than two days ago." Surely, in two days you could have managed to find the section in the Manual that describes the standard library functions? Anyhow, This has nothing to do with Keil specifically. This is basic 'C' textbook stuff. Ask yourself: does the 'C' programming language, or the standard 'C' library make any mention of complex numbers? Again, the 8051 is a simple 8-bit microcontroller - it is not generally well suited to maths-intensive applications. In fact, if you want direct language support for complex numbers, you'd be better off with FORTRAN. NO, I don't think there's a FORTRAN implentation for the 8051...!
In basic, I must include complex.h to compute complex number but I cant't #include <complex.h> on Keil Does keil has complex.h library?. yes, it does -->> Why my program error No,it doesn't -->> How can I compute complex number with KEIL?. I need to use Keil to compute complex number because it can implement on 8051. It's some part of my senior project. sincerely yours pattaraporn
The complete Keil library is described in the C51 Manual. Here it is: http://www.keil.com/support/man/docs/c51/c51_library.htm
I can't found library about complex number. Can you more advise me?.
I'm not found library for complex number. can you more advise me?
You're a Senior student - you should know by now how to use the research facilities available to you! * Have you checked your college library? * What does Google say?
8051 is not intended for complex calculations. Thinking to do complex calc on 8051 is almost futile. - Neo
I wouldn't go as far as to say, "futile".
Quite likely, you'll have to put together your own structures and functions to deal with complex numbers. Most applications for '51 MCUs don't involve heavy maths stuff because the processor neither has the RAM, ROM or CPU power to handle general purpose complex number libraries and the like efficiently. You will have to determine _what exactly_ you need to do that involves complex numbers, and then implement it. Alternatively, considering if and how to avoid the use of complex numbers could also be an option.
I wouldn't go as far as to say, "futile". Agreed, it can be done. To test the result, start the calculation when you leave work and hope the result has been calculated when you arrive in the morning :) Erik
thank you for your suggestion very much, I need to calc complex number on 8051 because of I have to calc FFT. Also,I will try to produce my own function to calc complex no. thank you very much. I will ask you when I can solve this proble. (^_^) pattaraporn
I need to calc complex number on 8051 because of I have to calc FFT. Actually, you don't. Using the exponential notation in frequency analysis is merely a convenient way to pack a sine and a cosine function into a single expression. The only complex operations necessary are addition/subtraction and multiplication, which are trivial to implement. If you're using anything like calls to exponential or trigonometric library functions (instead of just using a lookup table), you're essentially doing the exact opposite of a Fast Fourier Transform, because the resulting code will run very slowly.
http://en.wikipedia.org/wiki/Cooley-Tukey_FFT_algorithm http://www.fftw.org/