Hi,
suppose this is the stack
T: 0
Z: 1
Y: 1
X: 1
I hit 6 (!) times '+' and get "3' as a result. "From above" '0's are filling the stack, when the "1"s are consumed.
but if the stack has this layout
T: 1
Z: 1
Y: 1
X: 1
again I hit 6 (!) times '+' and get "7' as a result. "From above" '1's are filling the stack, when the "1"s are consumed.
The act of filling '0's as replacement for "missing" items which get consumed at the bottom of the stack is what I would exspect since it is that what
CLST also does.
But what is the reason behind filling "1" (or whatever is in "T" at the start of the procedure) if the stack get consumed?
Thanks for any help and information in advance!
Cheers
Meino
Question about a certain featue of the stack
Question about a certain featue of the stack
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
Re: Question about a certain featue of the stack
The T register is being replicated, which has always been the practice with HP RPN calculators. So it acts like a perpetual constant that gets repeated as the stack drops. See what happens when you put zero in the T register, and repeatedly press X (multiplication).
DM15L, S/N 00548. DM42, SN: 00159. DM41X, SN: 00973. DM32, SN 00054.
Re: Question about a certain featue of the stack
Hi Mike,
thanks for your answer.
It repeats with other words what I already had figured out.
But is the technical/mathematical reason for that NOT to feed the initial value ("0" after CLST) into the stack which it is consumed?
Cheers
Meino
thanks for your answer.
It repeats with other words what I already had figured out.
But is the technical/mathematical reason for that NOT to feed the initial value ("0" after CLST) into the stack which it is consumed?
Cheers
Meino
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
-
- Posts: 564
- Joined: Mon Apr 24, 2017 8:38 pm
Re: Question about a certain featue of the stack
I don't understand the question
Re: Question about a certain featue of the stack
Hi Keith,
I want to know the mathematical and or technical reason behind HP's decision to repeat T's value over and over again despite the
fact, that the initial value put onto the stack after CLST is different.
Cheers
Meino
I want to know the mathematical and or technical reason behind HP's decision to repeat T's value over and over again despite the
fact, that the initial value put onto the stack after CLST is different.
Cheers
Meino
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
-
- Posts: 564
- Joined: Mon Apr 24, 2017 8:38 pm
Re: Question about a certain featue of the stack
So, if I am right in my understanding, you are asking why CLST clears the T register of the stack as well as the other registers? It clears the whole stack, that makes sense to me. I cannot think of a reason why CLST should clear the stack except for the T register.
As for why the T register copies down as values are popped off, it has some advantages for programming equations (such as polynomials), but I also find it useful if I'm to perform a series of calculations that all involve the same constant so I don't have to re-enter it or STO and RCL it.
As for why the T register copies down as values are popped off, it has some advantages for programming equations (such as polynomials), but I also find it useful if I'm to perform a series of calculations that all involve the same constant so I don't have to re-enter it or STO and RCL it.
Re: Question about a certain featue of the stack
Replicating T value on stack drop enables constant arithmetic, as explain for example in the HP-67 manual :
This is very easy to program and uses only a very small amount of program steps. Remember that the RPN logic was defined when the calculator memory was scarce and expensive.
What would be the benefit of having 0 in T instead of replicating the previous value?
The replicating of T is also very useful to evaluate polynomials using the Horner method. For example to evaluate 8*x^4 + 5*x^3 + 2*x^2 - 7*x - 6 for the value in X you just have to do: ENTER, ENTER, ENTER, 8, *, 5, +, *, 2, +, *, 7, -, *, 6, -Example: A bacteriologist tests a certain strain whose population typically increases by 15% each day. If he starts a sample culture of 1000, what will be the bacteria population at the end of each day for six consecutive days?
Method: Put the growth factor (1.15) in the Y-, Z-, and T-registers and put the original population (1000) in the X-register. Thereafter, you get the new population whenever you press ×.
This is very easy to program and uses only a very small amount of program steps. Remember that the RPN logic was defined when the calculator memory was scarce and expensive.
What would be the benefit of having 0 in T instead of replicating the previous value?
DM42: 00425 - DM41X: β00066 - WP43: 00042
Re: Question about a certain featue of the stack
Look, Meino, the facts are:
- In the beginning and after CLST, the stack is all clear (i.e. loaded with zeros).
- When you enter a number, e.g. 47.11, this is in stack level X.
- When you press ENTER, the content of X is copied into stack level Y.
- Now enter a second number, e.g. 11.47; this goes into X again.
- When you press a dyadic function, e.g. +, y is added to x and the result (58.58) is loaded into X; then the previous content of Z (=0) is copied to Y; then the previous content of T (=0) is copied to Z; since there is no higher stack level, the previous content of T stays there unchanged.
- In the beginning and after CLST, the stack is all clear.
- When you enter a number, e.g. 1.11, this is in stack level X.
- When you press ENTER, the content of X is copied into stack level Y.
- Now enter a second number, e.g. 111; this goes into X again.
- When you press a dyadic function, e.g. 'multiply', y is multiplied by x and the result (=123.21) is loaded into X; then the previous content of Z (=0) is copied to Y; then the previous content of T (=0) is copied to Z; since there is no higher stack level, the previous content of T stays there unchanged.
- Press 'multiply' again and you'll get zero.
- In the beginning and after CLST, the stack is all clear.
- When you enter a number, e.g. 1.11, this is in stack level X.
- When you press ENTER, the content of X is copied into stack level Y. Press it twice more and also Z and T will contain 1.11.
- Now enter a second number, e.g. 111; this goes into X again.
- When you press a dyadic function, e.g. 'multiply', y is multiplied by x and the result (=123.21) is loaded into X; then the previous content of Z (=1.11) is copied to Y; then the previous content of T (=1.11) is copied to Z; since there is no higher stack level, the previous content of T stays there unchanged.
- Press 'multiply' again and you'll get 136.7631.
- Press 'multiply' again and you'll get 151.807041.
- Press 'multiply' again and you'll get 168.50581551.
- etc.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041