EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

quieries related to math handling in micro controllers

Started by yasha February 29, 2008
hello folks..
I'm doing a project related to 8051 micro controller, it is required to
handle floating point numbers to a great precision. 
is there any way with which this can be done easily with 8051 or is there
any mathematical controller that can do a better job?
please let me know..

regards,
yasha...


On Feb 29, 7:28=A0am, "yasha" <yasha...@gmail.com> wrote:

> I'm doing a project related to 8051 micro controller, it is required to > handle floating point numbers to a great precision. > is there any way with which this can be done easily with 8051 or is there
Floating-point numbers of any precision are just bits. An algorithm to manipulate them can be implemented on any architecture. However if your application requires lots of floating-point, given no further information, 8051 would seem to be an appallingly bad choice.
yasha wrote:
> hello folks.. > I'm doing a project related to 8051 micro controller, it is required to > handle floating point numbers to a great precision. > is there any way with which this can be done easily with 8051 or is there > any mathematical controller that can do a better job? > please let me know.. >
An 8051 is about the most inefficient processor you could think of for doing floating point. But if you are happy with extremely slow performance, then it will do the job - after all, pocket calculators have been made with 4-bit microcontrollers. If you are happy with speeds measured in flops, your 8051 will be fine. If you want speeds in kiloflops, get a proper microcontroller. If you want speeds in megaflops, get a processor with hardware floating point support.

larwe wrote:

> On Feb 29, 7:28 am, "yasha" <yasha...@gmail.com> wrote: > > > I'm doing a project related to 8051 micro controller, it is required to > > handle floating point numbers to a great precision. > > is there any way with which this can be done easily with 8051 or is there > > Floating-point numbers of any precision are just bits. An algorithm to > manipulate them can be implemented on any architecture. However if > your application requires lots of floating-point, given no further > information, 8051 would seem to be an appallingly bad choice.
Precision or dynamic range. Floating point numbers will give dynamic range but the same number of bits in a fixed point number will give more precision. Regards, -- Walter Banks Byte Craft Limited Tel. (519) 888-6911 http://www.bytecraft.com walter@bytecraft.com
On Feb 29, 7:28=A0am, "yasha" <yasha...@gmail.com> wrote:
> hello folks.. > I'm doing a project related to 8051 micro controller, it is required to > handle floating point numbers to a great precision. > is there any way with which this can be done easily with 8051 or is there > any mathematical controller that can do a better job? > please let me know.. > > regards, > yasha...
Some questions: - Why the 8051? How easy would it be for you to choose another device? - What is the quantitative meaning of "great precision"? - How many floating point operations do you need to perform each second? And how much other stuff does your micro need to do at the same time?

yasha wrote:

> hello folks.. > I'm doing a project related to 8051 micro controller, it is required to > handle floating point numbers to a great precision.
If the standard 4-byte float is sufficient for the "great precision", then you can use the floating point library which is supplied with just about any C compiler for x51.
> is there any way with which this can be done easily with 8051 or is there > any mathematical controller that can do a better job?
If you have several kilobytes of ROM space and you don't mind few hundred CPU cycles per one floating point operation, the x51 would do. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Fri, 29 Feb 2008 06:28:20 -0600, "yasha" <yasha.gs@gmail.com>
wrote:

>hello folks.. >I'm doing a project related to 8051 micro controller, it is required to >handle floating point numbers to a great precision. >is there any way with which this can be done easily with 8051 or is there >any mathematical controller that can do a better job? >please let me know.. > >regards, >yasha...
Any reasonable micro can do it to whatever precision you like (limited only by available RAM to store the numbers). Some of the operations are going to scale in required time by the number of bits squared, so if you need 64 or 128 bit mantissas you're going to wait a bit for the results, but it can be made to work. Best regards, Spehro Pefhany -- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
yasha wrote:
> hello folks.. > I'm doing a project related to 8051 micro controller, it is required to > handle floating point numbers to a great precision. > is there any way with which this can be done easily with 8051 or is there > any mathematical controller that can do a better job? > please let me know.. > > regards, > yasha... > >
There are many 8051 derivatives. Many different speed of execution. Do you already have your hardware ?? This site gives a few timings of their floating point operations. http://www.smxrtos.com/ussw/gofast/gofast_8051.htm Using their chart, any speed up by using a faster 8051 processor can be calculated. Have you spec'd out how fast you need float operations ? You did do a design spec, didn't you ?? donald
yasha wrote:
> hello folks.. > I'm doing a project related to 8051 micro controller, it is required to > handle floating point numbers to a great precision. > is there any way with which this can be done easily with 8051 or is there > any mathematical controller that can do a better job? > please let me know.. > > regards, > yasha... > >
http://www.google.com/search?q=8051+floating+point+speed Has lots of link about floating point speed.
On Fri, 29 Feb 2008 06:28:20 -0600, yasha wrote:

> hello folks.. > I'm doing a project related to 8051 micro controller, it is required to > handle floating point numbers to a great precision. is there any way > with which this can be done easily with 8051 or is there any > mathematical controller that can do a better job? please let me know.. > > regards, > yasha...
Some rehashing here: What is "great precision"? Your "great precision" may be my "lousy precision", or visa-versa. If you need 32-bit floating point, then just about any C toolchain will give it to you. If you need 64-bit floating point, then you should be able to get that, too (but I'd check to see if 'double' is supported -- it should be, but it may have been left by the wayside). If you need more precision than 64 bits you'll probably have to find a numerical library that'll work, or write your own -- although you may luck out and find a toolchain that supports a 128-bit "long double". What are your speed requirements? As mentioned, an 8051 is a slow old thing, even when it's being clocked fast. The more precision you implement, the slower it'll go. It's not clear what you mean by "mathematical processor". If you're looking for a coprocessor to use with your 8051, I don't think anyone makes those any more -- there are too many good processors, and it's too easy to whip one up on an FPGA if you just _have_ to have a coprocessor. If you're looking for a processor that's faster at math than an 8051, then look at just about anything that's not an 8051. -- Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

The 2024 Embedded Online Conference