HP Forums

Full Version: HP35s simple query about stacks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I've been using my HP35s for a little bit now and slowly starting to prefer RPN for everything (basically in uni math classes panic-reaching for my casio less and less and trusting my, what feels to be more blind, RPN entry more and more) but I've found a few oddities that I haven't been able to figure out and I'm hoping someone can help me understand?

So my question is around the stack on the HP35s.

I recently found a tip on this forum about the fact that entering any menu/mode/setting window and pressing the "R(down)" key will show you the 4 stack variables currently held which is nice.

But in doing so, I've noticed more and more that I'll have a strange situation where my stacks never empties..?

To explain a little better, an example:

- Clear entire stack, all 4 showing as 0.
- 3, enter, 2, divide
- 3, enter, 2, divide
- 3, enter, 2, divide
- 3, enter, 2, divide
(Now all 4 are filled)
- multiply, multiply, multiply, multiply, multiply, multiply

Basically I expected each value to be used and so shift down the stack, but it seems that I've just got an infinite stack of 1.5 and can multiply forever which I wasn't expecting. I'm assuming I'm missing some logic here?!

I've also experienced this with some complex equations. The minute I go beyond using just X and Y, suddenly the rest of my stack fills with values and they stay there indefinitely.

Cheers!
Others will probably chime in with better explanations, but short and simple, you have discovered the replicating T-register behavior of the classic HP 4-level stack. Effectively, whenever you perform an operation on two values in X and Y, those values are consumed by your function and the result placed in X. The value initially in Z drops to Y, the value in T is copied to Z, but a copy also remains in T. If T had a zero, it appears that the stack is just dropping, but you can look at it as if the zero is being copied.
Exactly as Jeff said. Take a look at this picture of the back label on the orignal HP-35. It's a classic, showing exactly what happens to the stack for all operations, with nice Feynman-like diagrams!
(10-08-2014 03:01 PM)Katie Wasserman Wrote: [ -> ]It's a classic, showing exactly what happens to the stack for all operations, with nice Feynman-like diagrams!
Except for the case where the original 35, being short of memory, had to discard the contents of T when performing trig operations. That's not an issue with any later model, including your 35s.
Thanks for your replies everyone, helped clear that up for me!

I'm in the funny middle ground of using brackets and having to cursor sideways (on the casio) now seems very annoying, but still not 100% confident with myself remembering to hit every RPN keystroke in the correct order when coming to complicated calculations.... But I'm certainly getting there!

Totally side question - I'm also soon to start working with MATLAB, I've picked up a somewhat dummies guide to it also as I've never used it but I was wondering if that also works in an RPN fashion or just ALG? If anyone knows Smile
(10-08-2014 03:06 PM)Marcus von Cube Wrote: [ -> ]
(10-08-2014 03:01 PM)Katie Wasserman Wrote: [ -> ]It's a classic, showing exactly what happens to the stack for all operations, with nice Feynman-like diagrams!
Except for the case where the original 35, being short of memory, had to discard the contents of T when performing trig operations. That's not an issue with any later model, including your 35s.

The label footnotes exactly that. So I think it's a complete stack description for all operations.
(10-08-2014 03:43 PM)Kyburo Wrote: [ -> ]Totally side question - I'm also soon to start working with MATLAB, I've picked up a somewhat dummies guide to it also as I've never used it but I was wondering if that also works in an RPN fashion or just ALG? If anyone knows Smile

There is no built-in RPN evaluation capability in MATLAB. It probably would not be too hard to write an RPN parser for MATLAB -- this kind of exercise used to be a common assignment in programming classes back when I was in school -- but it probably would require you to pass the RPN expression as a string to the parser, rather than have it evaluated directly on the MATLAB command line. So rather than simply entering an expression like "2 3 +" at the command line, you would need to define a parser function RPN() and then enter expressions in the manner of "RPN('2 3 +')".
Reference URL's