EmbeddedRelated.com
Forums

floating point question on MSP430

Started by David R. McCoy July 11, 2004
Hi All,

What is TI talking about when they refer to the floating point package(FPP)?
Is is able to be used on any of their uC?

I need the uC to take the square root of a number and it seems that I'll
have to use the FPP to do it.  Is that true?

What is the FPP used for?

Thanks

David


On Mon, 12 Jul 2004 02:57:49 GMT, the renowned "David R. McCoy"
<laserprojector2003@yahoo.com> wrote:

>Hi All, > >What is TI talking about when they refer to the floating point package(FPP)? >Is is able to be used on any of their uC? > >I need the uC to take the square root of a number and it seems that I'll >have to use the FPP to do it. Is that true?
Certainly not. But doing it that way might avoid having to write any code. If that's the only reason you need to include floating point math it will likely be quite inefficient wrt code size and speed. If the MSP430 you are using has a hardware multiplier- you can simply flip bits from the MSB down to the LSB, test (by squaring the number), correct and move down to the next bit till you get to the LSB- and it will be pretty fast and compact. 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
"Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message

> If the MSP430 you are using has a hardware multiplier- you can simply > flip bits from the MSB down to the LSB, test (by squaring the number), > correct and move down to the next bit till you get to the LSB- and it > will be pretty fast and compact. >
Otherwise google on "Newton's method" or "Newton-Raphson". What could Sir Isaac have achieved with a PC? Cheers, Alf
On Mon, 12 Jul 2004 22:50:31 +1000, the renowned "Unbeliever"
<alfkatz@remove.the.bleedin.obvious.ieee.org> wrote:

> >"Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message > >> If the MSP430 you are using has a hardware multiplier- you can simply >> flip bits from the MSB down to the LSB, test (by squaring the number), >> correct and move down to the next bit till you get to the LSB- and it >> will be pretty fast and compact. >> > >Otherwise google on "Newton's method" or "Newton-Raphson". What could Sir >Isaac have achieved with a PC? > >Cheers, >Alf
All that time he wasted writing _Principia_ could have been better spent getting to the top level of Doom. 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
Spehro Pefhany wrote:
>> >>Otherwise google on "Newton's method" or "Newton-Raphson". What could Sir >>Isaac have achieved with a PC? >> >>Cheers, >>Alf > > > All that time he wasted writing _Principia_ could have been better > spent getting to the top level of Doom. > > Best regards, > Spehro Pefhany
LOL! -- Mike Page BEng(Hons) MIEE www.eclectic-web.co.uk Quiet! Tony's battling the forces of conservatism, whoever we are.
"Unbeliever" <alfkatz@remove.the.bleedin.obvious.ieee.org> wrote in message
news:40f28918$0$18195$afc38c87@news.optusnet.com.au...
> > "Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message > > > If the MSP430 you are using has a hardware multiplier- you can simply > > flip bits from the MSB down to the LSB, test (by squaring the number), > > correct and move down to the next bit till you get to the LSB- and it > > will be pretty fast and compact. > > > > Otherwise google on "Newton's method" or "Newton-Raphson". What could
Sir
> Isaac have achieved with a PC? > > Cheers, > Alf
A very big dent in his head instead of a bump. Peter
"Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message
news:gft4f0puqf9ckmurmr66nv0mn5s2f5tjvb@4ax.com...
> On Mon, 12 Jul 2004 02:57:49 GMT, the renowned "David R. McCoy" > <laserprojector2003@yahoo.com> wrote: > > >Hi All, > > > >What is TI talking about when they refer to the floating point
package(FPP)?
> >Is is able to be used on any of their uC? > > > >I need the uC to take the square root of a number and it seems that I'll > >have to use the FPP to do it. Is that true? > > Certainly not. But doing it that way might avoid having to write any > code. If that's the only reason you need to include floating point > math it will likely be quite inefficient wrt code size and speed. > > If the MSP430 you are using has a hardware multiplier- you can simply > flip bits from the MSB down to the LSB, test (by squaring the number), > correct and move down to the next bit till you get to the LSB- and it > will be pretty fast and compact. > > 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
>
I don't believe that the uC that I'm using has a hardware multiplier but I'll check. The calculation that I need to perform will only need to perform 1 square root per event. The period between each event is measured in tens of seconds. Writing a routine that sets a bit and then squares it & tests sounds like it might be the way to go. thanks for everyones response. David
"David R. McCoy" <laserprojector2003@yahoo.com> wrote in message
news:d9EIc.44118$IX4.4683637@twister.tampabay.rr.com...
> > "Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message > news:gft4f0puqf9ckmurmr66nv0mn5s2f5tjvb@4ax.com... > > On Mon, 12 Jul 2004 02:57:49 GMT, the renowned "David R. McCoy" > > <laserprojector2003@yahoo.com> wrote: > > > > >Hi All, > > > > > >What is TI talking about when they refer to the floating point > package(FPP)? > > >Is is able to be used on any of their uC? > > > > > >I need the uC to take the square root of a number and it seems that
I'll
> > >have to use the FPP to do it. Is that true? > > > > Certainly not. But doing it that way might avoid having to write any > > code. If that's the only reason you need to include floating point > > math it will likely be quite inefficient wrt code size and speed. > > > > If the MSP430 you are using has a hardware multiplier- you can simply > > flip bits from the MSB down to the LSB, test (by squaring the number), > > correct and move down to the next bit till you get to the LSB- and it > > will be pretty fast and compact. > > > > 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 > > > > I don't believe that the uC that I'm using has a hardware multiplier but > I'll check. The calculation that I need to perform will only need to > perform 1 square root per event. The period between each event is
measured
> in tens of seconds. Writing a routine that sets a bit and then squares it
&
> tests sounds like it might be the way to go. > > thanks for everyones response. > > David > >
Fine if you have time to re-invent the wheel again.. if it's only of that period then use fp and get on with your application..!!
"TheDoc" <TheDoc@ev1.net> wrote in message
news:10f6b43esmgk771@corp.supernews.com...
> > "David R. McCoy" <laserprojector2003@yahoo.com> wrote in message > news:d9EIc.44118$IX4.4683637@twister.tampabay.rr.com... > > > > "Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message > > news:gft4f0puqf9ckmurmr66nv0mn5s2f5tjvb@4ax.com... > > > On Mon, 12 Jul 2004 02:57:49 GMT, the renowned "David R. McCoy" > > > <laserprojector2003@yahoo.com> wrote: > > > > > > >Hi All, > > > > > > > >What is TI talking about when they refer to the floating point > > package(FPP)? > > > >Is is able to be used on any of their uC? > > > > > > > >I need the uC to take the square root of a number and it seems that > I'll > > > >have to use the FPP to do it. Is that true? > > > > > > Certainly not. But doing it that way might avoid having to write any > > > code. If that's the only reason you need to include floating point > > > math it will likely be quite inefficient wrt code size and speed. > > > > > > If the MSP430 you are using has a hardware multiplier- you can simply > > > flip bits from the MSB down to the LSB, test (by squaring the number), > > > correct and move down to the next bit till you get to the LSB- and it > > > will be pretty fast and compact. > > > > > > 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 > > > > > > > I don't believe that the uC that I'm using has a hardware multiplier but > > I'll check. The calculation that I need to perform will only need to > > perform 1 square root per event. The period between each event is > measured > > in tens of seconds. Writing a routine that sets a bit and then squares
it
> & > > tests sounds like it might be the way to go. > > > > thanks for everyones response. > > > > David > > > > > > Fine if you have time to re-invent the wheel again.. if it's only of that > period > then use fp and get on with your application..!! > > >
You make a good point. Reinventing the wheel isn't something that I'm looking to do, it's just that I'm a bit unsure of how to use the floating point tool. A guy at my day job told me that floating point was only understood by the Aseembly Language Gurus. Now, I'm sure that I could eventually figure out how to use it; it's just that right now I'm weighing the amount of time it would take to come up to speed on FP versus writing code without it. I'm using a MSP430F149 uC. The FP tool seems to be a header file that I add into my code but when I try to compile it, the compiler pukes and says that it doesn't recognize any of the commands in that file. What am I doing wrong? Thanks
"David R. McCoy" <laserprojector2003@yahoo.com> wrote in message
news:N6nIc.43428$IX4.4412882@twister.tampabay.rr.com...
> What is TI talking about when they refer to the floating point
package(FPP)?
> Is is able to be used on any of their uC?
Probably yes.
> I need the uC to take the square root of a number and it seems that I'll > have to use the FPP to do it. Is that true?
No.
> What is the FPP used for?
For floating point arithmetics. If all you need is an integer square root, going for FP is an overkill. There are several simple methods of computing integer (or fixed point) square root.