HELP WANTED ON ALGORITHMS - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: HELP WANTED ON ALGORITHMS (/thread-242802.html) |
HELP WANTED ON ALGORITHMS - Joerg Woerner - 04-26-2013 Hello community, I received this email:
I am a maths teacher at a Collège (high school I believe) in Geneva, My student would have preferred to do her work on the calculator she uses (TI-30XS MultiView already a little further on than the basic models), but we were not able to find specific information on this model on the internet and Texas Instruments wasn't willing to share either, maybe because the model is too recent ?
Would you have any idea where my student could find information ANY IDEAS?
Regards, Re: HELP WANTED ON ALGORITHMS - Gerson W. Barbosa - 04-26-2013 Here is an article on transcendental function algorithms from the TI graphic products team you might want to take a look at: ftp://ftp.ti.com/pub/graph-ti/calc-apps/info/cordic.txt
P.S.: Yet another one, in French: Edited: 26 Apr 2013, 8:57 p.m.
Re: HELP WANTED ON ALGORITHMS - Thomas Klemm - 04-26-2013 Cochran's patent: DIGITAL CALCULATOR SYSTEM FOR COMPUTING SQUARE ROOTS
Re: HELP WANTED ON ALGORITHMS - Thomas Klemm - 04-26-2013 If she owns an iPhone I suggest to install rpn-21 which provides a debugger:
This allows to track a calculation and thus gives an impression of its complexity.
Kind regards Re: HELP WANTED ON ALGORITHMS - Namir - 04-26-2013 The family of CORDIC algorithms are able to calculate square root, exponential, logarithm, trigonometric functions, and inverse trigonometric functions. The heart of the CORDIC algorithm resembles a hi-low number guessing game.
Namir
Re: HELP WANTED ON ALGORITHMS - Thomas Klemm - 04-26-2013 Quote:
From the same source: Re: HELP WANTED ON ALGORITHMS - Thomas Klemm - 04-26-2013 Quote: Coconut VASM Listing by Jackie F. Woldering If she's not afraid of assembler it might be enlightening to compare the description of the algorithm in Cochran's patent with it's implementation in the HP-41C. Here's the core of the routine:
279 336 SQR60 1042 C=C+1 PT Re: HELP WANTED ON ALGORITHMS - Thomas Klemm - 04-27-2013 From SQRT_CORDIC:
for i = 1 : n Probably not the most efficient way to do that.
Cheers Re: HELP WANTED ON ALGORITHMS - Namir - 04-27-2013 Very easy to read and understand, especially for a high school student. Edited: 27 Apr 2013, 12:46 a.m.
Re: HELP WANTED ON ALGORITHMS - Mic - 04-27-2013 TI-30XS MultiView is nit programmable ! Here is a review of the calc :
http://www.calc-bank.com/index.php?mod=archives&ac=voir&id=841
Re: HELP WANTED ON ALGORITHMS - Thomas Klemm - 04-27-2013 Given the task to produce a list of squares these are two ways to do it:
0 0 0 * 0 0 The left one uses multiplication and doesn't use the previous result. The right one reuses the previous result and thus needs only addition which is more efficient. I assume a high school student will understand both solutions. But when somebody wants to know how a calculator works I prefer to point to the real thing. Because it's not Matlab code running within a calculator. But I like this example because it shows that it's worth to ask yourself: what do I know and how can I use that to improve my next step?
Re: HELP WANTED ON ALGORITHMS - NateB - 04-27-2013 Inside Your Calculator: From Simple Programs to Significant Insights by Gerald R. Rising may be useful. Re: HELP WANTED ON ALGORITHMS - Eddie W. Shore - 04-27-2013 Quote:
Re: HELP WANTED ON ALGORITHMS - Eddie W. Shore - 04-27-2013 From my understanding CORDIC is used for transcendental functions. (sin, cos, ln, e^x, etc) As far as arithmetic is concerned (+, -, x, ÷), I believe binary representations of numbers are used to carry out these operations. An example for addition in an eight bit system: 17 + 54
17 in binary is 000010001 The sum is 71, 71 in binary is 001000111 In a bit system, there is n-1 bits that are dedicated to number representation, with the left most bit being the "sign bit". If the sign bit is 1, the number is negative.
I found this video Hope this helps,
Eddie
Re: HELP WANTED ON ALGORITHMS - Eric Smith - 04-27-2013 Usually CORDIC isn't used for logs and exponentials, although it is possible to do so by using hyperbolic CORDIC. CORDIC is in the general class of shift-and-add algorithms, and there is a simpler one for logs and exponential first published in 1624, only ten years after the invention of logarithms by Napier. I'm not sure whether the HP 9100A (1968) used Briggs' algorithm, but all of HP's handheld and handheld-derived calculators from the HP-35 (1972) through the Saturn-based and Saturn-emulating calculators have used it. Recent HP-designed calculators such as the HP 10bII+, 20b, 30b, and 49gII apparently use a math library based on that from Saturn calculators, so they presumably also use Briggs' algorithm. There is a good description of Briggs' algorithm on Jacques Laporte's "Briggs and the HP35" web page. Another excellent reference for algorithms for transcendental functions is Elementary Functions: Algorithms and Implementations by Jean-Michel Muller, second edition, which covers many classes of algorithms including shift-and-add (Briggs', CORDIC, and others), and has especially good coverage of accurate argument range reduction algorithms. It should be noted that the HP algorithms for sine and cosine use CORDIC, but not in the most basic method normally described. Instead, they compute the tangent (or cotangent), and use an identity to compute the sine (or cosine) from it. This avoids an issue with each CORDIC iteration effectively multiplying the resulting sine and cosine by a scale factor; by using tangent (or cotangent), these scale factors cancel out. In binary CORDIC, the number of CORDIC iteration is fixed, so the result can be multiplied by the inverse of the product of the scale factors, which is constant. In decimal CORDIC as implemented by HP, the number of CORDIC iterations is variable, so it would take more work to compensate for the non-constant product of the scale factors.
For specifics of the algorithms used by HP, see:
Edited: 27 Apr 2013, 1:04 p.m.
Re: HELP WANTED ON ALGORITHMS - Eric Smith - 04-27-2013 Note that in binary floating-point arithmetic, two's complement representation is almost never used. For the significand (also known as the coefficient, and often incorrectly referred to as the mantissa), sign-magnitude representation is normally used, and for the exponent, a biased integer representation is normally used.
However, the BCD floating point used in most HP calculators uses ten's complement representation for the significand.
Re: HELP WANTED ON ALGORITHMS - Matt Agajanian - 04-27-2013 Y'know, as I have some of these RPN-Woodstock and RPN-Spice calcs on my iPhone, I've wondered what that code was. Now I know it's the debugger. Thanks for the explanation.
Re: HELP WANTED ON ALGORITHMS - Namir - 04-27-2013 Does a high school student want to know the machine code for ANY calculator????? Really??????? If he/she does, then he/she is truly exceptional and should contact Cyrille who conveniently (for the Geneva student) lives near Geneva. Cyrille may well put that student on HP's R&D payroll. I am not knowledgeable in machine code for any machine and I doubt the high school student in Geneva is either. However, I can understand the algorithm used. When that algorithm is expressed in high level languages like Matlab or Visual Basic, I can get a better grasp of it. Namir
Edited: 27 Apr 2013, 10:08 p.m.
Re: HELP WANTED ON ALGORITHMS - Thomas Klemm - 04-28-2013 Cyrille described the method to calculate the square root in HP Solve: Quote:cf. Computing Square Roots Donald Knuth uses assembly language, which runs on the hypothetical MIX computer, to describe the algorithms in The Art of Computer Programming. And he has some good reasons to do so. That's only one example where assembler is used as an educational programming language. I don't mind a high level description of an algorithm. There's a nice flow-chart diagram in Cochran's patent which describes it best IMHO. There are different levels of understanding and some may be satisfied with that. But I think it's worth the effort to go one step deeper and then you might end up stepping through assembler code using a debugger. Hopefully this will give you a more profound understanding. As source code was requested I pointed to the VASM listing. We are lucky that we have the original with comments in a searchable format. What else could you want? Just hope you might take the occasion and start having a look at MCODE. After all it's not that difficult.
Kind regards Re: HELP WANTED ON ALGORITHMS - Joerg Woerner - 04-28-2013 She ;-)
Joerg
|