Has anyone any idea where I can get a double precision maths library which will work with the Keil C51 compiler.
"Can you still buy those 8087 maths co-processors...?" How about these: http://www.dcd.pl/acore.php?idcore=13 http://www.dcd.pl/acore.php?idcore=14 http://www.dcd.pl/acore.php?idcore=28 http://www.dcd.pl/adatash.php
To change tracks now would costs fortune (re-designing & tooling a large multi-layer PCB). well a "fortune" IS a relative term, but changhing a processor would cost one hour for my layout person and ~$500 for 2 new prototype boards from the contract manufacturer. How must does it cost for you trying to find a way around the problem using the board you have? Erik
"The processor (Cypress CY7C68013) was chosen becaus it has a built in USB2.0 engine." Presumably, that means that it'll be connected to a PC? Could you no send the "raw" data to the PC, have the PC do the number crunching, and perhaps send the results back? Or is it not always connected to a PC?
Hello Jon Thanks for the explanation - that makes perfect sense. Coding now complete... into testing. best regards - Paul
We have considered using interpolation and thats the way we are now doing it. We have succeeded in using 64bit integer maths with that so there is no need to go to f.p.
The problem here is not just C.
The float implementation of C51 uses registers for float operations. It can do this because there are eight 1-byte registers and each float only uses 4 bytes. So, C51's implementation is actually pretty fast.
When you start to implement double operations, you need 8 bytes for each operand and 16 bytes for both. So, you can't do everything in registers. Assuming that you could do everything in registers, I'd expect most operations to be at least 4 times slower. Since you'll have to swap registers out to memory, a factor of 10x is probably not too bad.
Jon
Unfortunately the hardware was designed when I arrived on the scene so I have to make the best of a bad situation. However, there is not much choice available when one wants a single chip with 24 bit adc, SIO, PIO, I2C and on board programming built in. As far as $5000 for a library is concerned, it is possible to buy a complete development system with full double floating point 'C' compile for a lot less than this.
" ... double-check the resulting compiler output ... " Of course, by the time you've done that, you might as well have writted it in assembler in the first place! :-0
"Maybe the $5000 is sounding a bit less unreasonable...?" Have you seen how little of the standard math library you actually get for your $5000?
"Yes - this one had me perplexed. 10 decades would be enough for me, but since the IEEE format calls for 8 bytes with a 53-bit mantissa (including the assumed leading 1) I don't know why ANSI C only calls for 10 decades." I don't think ANSI requires IEEE754 to be used. The explanation for the seemingly 'easy' requirements is most likely to avoid making old implementations non-conforming. ANSI have always seem to have adopted a policy of formalising existing popular implementations rather than pushing the boundaries forward.
View all questions in Keil forum