I don't know of any micro-controller that has floating point
hardware support. Are there such? The telosb MSP chip doesn't
even have int multiply or divide instructions. The mica Atmega
has an 8-bit multiply but no divide.

With you, I always recommend fixed-point math.

MS

Sergio Valcarcel wrote:
> Hi Malissa,
> 
> Depending on the platform you are using, your CPU may accept  float or 
> even double numbers. Also, depending on the architecture float 
> computations might be accelerated with dedicated hardware or not. 
> So the main points you have to verify is whether the extensively use of 
> float operations will decrease the overall performance of your system. 
> Of course, it is not the same to compute a numerical integration than to 
> average two numbers... 
> 
> Another main point is the memory footprint. Float numbers typically 
> could use 4 bytes. So you must take care of how much available RAM you 
> have for your application.
> 
> A final concern is that you can not use network data types (i.e. 
> nx_struct) for communications since there is not defined a nx_float type.
> 
> The other option, instead of using floats, could be to convert to 
> integer, scaling as many decimals you want. For instance, 165.32 could 
> be converted to 16532 (remembering that it is multiplied by 1e2).
> 
> I hope it helps!
> Sergio
> 
> 
> On Sat, Sep 10, 2011 at 10:30 AM, Maissa Ben Jamaa 
> <maisa.benja...@gmail.com <mailto:maisa.benja...@gmail.com>> wrote:
> 
>     Hello sir,
> 
>     Please can I ask you a question: does using float number in a nc
>     code for real compilation matter?
> 
>     Thank you
> 
>     Best regards,
>     Maissa Ben Jamaa
> 
> 
>     2011/9/9 Maissa Ben Jamaa <maisa.benja...@gmail.com
>     <mailto:maisa.benja...@gmail.com>>
> 
>         Hello sir,
> 
>         I am very thankful for your answer, I tried to do something
>         similar to blip code but I got the following error:
>         gcc: cannot specify -o with -c or -S and multiple languages.
>         Noting that I am now testing my code with Tossim.
> 
>         Best regards,
>         Maissa Ben Jamaa
> 
> 
>         2011/9/8 Sergio Valcarcel <serteck...@gmail.com
>         <mailto:serteck...@gmail.com>>
> 
>             Dear Maissa,
> 
>             Please, check this thread:
>             
> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg36375.html
> 
>             It is pretty straight forward, but do not hesitate to mail
>             me if you need further help.
> 
>             Cheers!
>             Sergio
> 
> 
>             On Thu, Sep 8, 2011 at 5:12 PM, Maissa Ben Jamaa
>             <maisa.benja...@gmail.com <mailto:maisa.benja...@gmail.com>>
>             wrote:
> 
>                 Hello sir,
> 
>                 I saw your interaction in tinyos help about porting c
>                 code with nc code.
>                 here is the
>                 link: 
> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg38966.html
> 
>                 Please can you tell me the steps to follow in order to
>                 make this porting.
> 
>                 Thanks.
> 
>                 Best ragards,
>                 Maissa Ben Jamaa
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to