Download Print this page

Figure 3 - HP 20b Instruction Manual

Using the rpn stack to solve problems efficiently
Hide thumbs Also See for HP 20b:

Advertisement

hp calculators
HP 20b Using the RPN stack to solve problems efficiently
1. take a copy of the X-register contents and put it in the ANS register;
2. replace actual X-register contents with the resulting value.
If a second number needs to be typed in right after the first one to be used with it, they must be separated
with the I key. For example, to add 3 and 5 together, you would press 3I5+. Note:
The = key can also be used like the I key. Long time HP users will probably feel more
comfortable using the double-wide key.
Example 2: What is the most common keystroke sequence to enter 2.33 and 4.5 and add them to each other? What
registers in the stack are used?
Solution:
The most common keystroke sequence to add 2.33 to 4.5 is:
4.5I2.33+
In fact, all of the stack registers have their contents changed during this single addition. However, the real question is
that since both numbers must "exist" in the calculator memory before + is pressed, "Where do they exist?" When +
is pressed, the calculator proceeds with the following operation sequence:
1. take a copy of the X-register contents and put it in ANS register;
2. take Y-register contents and add to X-register contents;
3. replace actual X-register contents with this resulting value;
4. "drop" T- and Z-register contents respectively to Z- and Y-registers;
5. maintain a copy of T-register contents in T.
NOTE: On the HP 20b, the I key terminates digit entry and places the keyed value into the X register. It does not
copy this value into the Y-register the way previous RPN calculator implementations have done. In this sense, the HP
20b operates more like the graphical RPL calculators. Therefore, when you want to evaluate 4 + 5 using these
keystrokes: 4I5+, the HP 20b would place the 4 into the X-register when I is pressed, but only
copy this 4 into the Y-register when the 5 is keyed and an operation is performed on the 5. In most normal situations, this
will not cause any issues, but a long time RPN user should be aware of this behavior.
To have the HP 20b copy the value from the X-register to the Y-register, you should press I twice after keying a
number.
Viewing and reordering stack registers contents
Example 3: How would you fill the T, Z, Y and X stack registers with the numbers 44, 33, 22 and 11, respectively?
Solution:
The most common keystroke sequence to fill the stack registers with these numbers is:
44 I 33 I 22 I 11
hp calculators
- 3 -
HP 20b Using the RPN stack to solve problems efficiently - Version 1.0

Figure 3

Advertisement

loading