bs2 cant do it...Can the Propeller?
gennarobasso81
Posts: 84
Hello again everyone,
Quick yes or no question.
The BS2 cannot do integer math. It will round down to the nearest whole number to keep it with in a given range for an assigned value making it difficult to get more exact and precise messurements.
Can a propeller chip handle interger math (or any other chip parallax sells)?
Quick yes or no question.
The BS2 cannot do integer math. It will round down to the nearest whole number to keep it with in a given range for an assigned value making it difficult to get more exact and precise messurements.
Can a propeller chip handle interger math (or any other chip parallax sells)?
Comments
The Propeller can do integer and floating point and logs and sines. It is all there.
The propeller natively does integer math, but it has better handling of negative numbers, and its long variables offer hugely more range to play with if you want to stick to lean and mean integer and fixed point math. The prop also has the rudiments of floating point variable types, and it takes a separate object like F32 with methods to take full advantage of that.
Very true but not every micro does 32 bit integer add/subtract with a single instruction.
Nobody does a loop 6.69 times or jumps to address 9534.55639. For the occasional need to convert output to some calibrated percentage, there are ways to get around the problem.
We are not doing finance applications; nor are we calculating the half life of plutonium. It is about controlling devices, sensing, and buffering data. Even decimal is rather an annoyance, might as well count in 16s - called hexadecimal.
Not always true. For assays and calibrations using some short half life isotopes you need to calculate the corrected DPM for the standards when each standard and sample is counted. If you don't do that the errors get larger as you proceed through the samples. This is typically done on a PC after the sample counts and time have been recorded but for a standalone instrument in the field this can also be done by the microcontroller.
Actually there are many scientific and control applications which performed all of the various functions mentioned long before math co-processors were in existence. An interesting feature of the Prop is the choice of look-up tables.
Some links to follow:
http://www.afcea.org/signal/articles/templates/SIGNAL_Article_Template.asp?articleid=843&zoneid=142
or
http://degiorgi.math.hr/~singer/aaa_sem/Div/97-105.pdf
Thank you to everyone for replying and again... love this community forum
Parallax really is a good company. Think I'll have to look up if you're traded publicly...lol
make everything 8 or 16 times bigger etc
Say you have 10 and want to add 0.5, shift everything left 4 steps for x8
80+4= 84
Spin uses 16bit fixed point, so the smalllest number in decimal you can add or sub is 1 / 65535th of a point.