Shop OBEX P1 Docs P2 Docs Learn Events
Foating Point Math — Parallax Forums

Foating Point Math

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-05-12 17:12 in Propeller 1
Ok so I need to do floating point math in alot of my projects, especially the frequency counter I am building. I was wondering just how much is the floating point chip on here going to speed things up, and is there even a library written for it?? I mean i searched obex and just saw the float32 stuff which is the props fpu emulation correct?

Also do some other companys make a compatible float chip, TI, National, NXM, Linear tech, i.e somewhere i can request free samples. 20 bucks seems like a whole lot for something that may be only semi usefull in my situation, still nice to have the ability to crunch. I really wanted to do a graphing calc in the future so im sure eventually id need a chip for floats.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-12 11:43
    An external chip will likely slow your calculations down rather than speed them up.

    I'm pretty sure F32 can do your floating point calculations faster than you could send data and receive an answer from the external chip.

    I was pleasantly surprised to find F32 could handle all the FP IK calculations needed for the 18 servo positions of my hexapod within a servo's 20ms refresh cycle.

    It might be worth considering an external chip if you wanted to use 64-bit floating point numbers. I believe cessnapilot has objects for using both the 32-bit and 64-bit floating point chips.
  • BeanBean Posts: 8,129
    edited 2012-05-12 11:44
    The float32 library is pretty good. Unless a chip has some feature you really need, I cannot see any advantage to using an external chip.

    Bean
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-05-12 13:56
    Hmmm ok, well why does parallax carry one in there store if its not any faster? I would assume if you were doing huge scientific calculations on floating point this might be usefull as the prop would take longer than the chips send and recive time?
  • LeonLeon Posts: 7,620
    edited 2012-05-12 14:02
    Perhaps because it saves a lot of code.
  • Heater.Heater. Posts: 21,230
    edited 2012-05-12 14:07
    Those chips might be good for use with Stamps or other such 8bit mcus. Or might be useful when you want floats but don't a floating point library. We have float32 and Lonesock's f32 which is faster and only ever needs a single COG that and the fact that getting data from Prop to float chip is likely to be slower than f32 makes the float chips redundant unless you want double precision or such.
  • jmgjmg Posts: 15,183
    edited 2012-05-12 17:12
    Heater. wrote: »
    .. We have float32 and Lonesock's f32 which is faster and only ever needs a single COG ..

    A good thread on F32 is here
    http://forums.parallax.com/showthread.php?127302-F32-Concise-floating-point-code-for-the-Propeller/page2

    and Bean was looking at an extended float, with better than 24b granularity,

    http://forums.parallax.com/showthread.php?139598-Problem-Floating-point-cannot-hold-32-bit-values&highlight=floating+point

    but not sure of the status of that ?
Sign In or Register to comment.