|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Fast and Slow Operations
I have been looking around at stuff for some time, and I have found many people saying different things about the Pic Microcontroller. Some people have said that division is slow w/o hardware support, some have said that floating point operations were ridiculously painful, etc.
I am looking a for a vaguely comprehensive guide as to what mathematical operations are slow and what operations are fast. Over here, we have found an excellent approximation for cosine, which uses only square roots, multiplication, and division. If anyone has any related info, could you please post? Thank you. |
|
#2
|
|||||
|
|||||
|
Re: Fast and Slow Operations
Looking at the data sheet for the PIC18FXX20, Multiply, Add, and Subtract (8 bit integer) should be really fast. 16 bit integer versions will be not as fast, but should still be fairly fast. And it goes downhill from there. (Because all operations other than 8 bit integer Add, Subtract, and Multiply have to be implemented in software.)
Last edited by Greg Ross : 14-01-2004 at 18:47. |
|
#3
|
||||
|
||||
|
Re: Fast and Slow Operations
also, most square root algorithms tend to be fairly slow. one thing you could try is having the robot generate a lookup table (basically an array) of the sines/cosines/tangents for each angle 0-180, and then accessing that when you need it - that way you can run the slow calculations once at startup, and use direct memory-access to get the values at runtime.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Slow News Week | Lloyd Burns | Dean Kamen's Inventions | 0 | 19-05-2003 19:59 |
| Bridge Question for those who have played | archiver | 2001 | 11 | 24-06-2002 01:44 |
| Speed is definately going to be a factor.... | archiver | 2001 | 14 | 24-06-2002 00:24 |
| How fast? | archiver | 2001 | 4 | 23-06-2002 23:59 |
| Speed? | WernerNYK | Technical Discussion | 13 | 10-02-2002 23:54 |