HP 12C Manual

hp calculators
HP 12C Platinum
Using the RPN stack to solve
problems efficiently
The benefits of understanding RPN stack operations
Understanding the HP12C Platinum RPN stack operation
Viewing and reordering stack-register contents
Using Last-x contents in chain calculations
Practice with solving problems using stack registers

hp calculators
HP 12C Platinum Using the RPN stack to solve problems efficiently
hp calculators - 2 -HP 12C Platinum Using the RPN stack to solve problems efficiently - Version 1.0
The benefits of understanding RPN stack operations
RPN stands for Reverse Polish Notation and is one of two operating modes available on the HP12C Platinum. Mastering
RPN leads to an enhanced performance when using the calculator. The first step to master RPN usage is to know all of
its available resources.
Understanding the HP12C Platinum operation
When in normal, 'run' mode, every operation performed in the HP12C Platinum uses the display contents or places
results on it. The display always shows the contents of the X-register. A register is a predefined place in the calculator
memory that is able to hold a formatted number with a ten-digit mantissa and a two-digit exponent of ten. The X-register
is one of five registers that form the RPN stack, represented in Figure 1 with all contents cleared to zero.
Stack registers
T
Z
Y
X
L
Anytime a number is keyed in, the X-register is updated to hold this number. It is then available for use.
Example 1: What is the most common keystroke sequence to compute the reciprocal of 7.2? What registers in the
stack are used?
Solution: The most common keystroke sequence to compute the reciprocal of 7.2 is:
7.2 y
Figure 2
In this case, simply typing in the number and pressing the related key are enough to compute the resulting
value. There are other functions that use only the X-register contents, like g¿ or gr. These are
the 'one-number functions', and when they are pressed, the calculator proceeds with the following
operation sequence:
1. take a copy of the X-register contents and put it in L-register (last-x);
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 \key. For example, to add 3 and 5 together, you would press 3\5+.
Figure 1
(normally shown in the display)

hp calculators
HP 12C Platinum Using the RPN stack to solve problems efficiently
hp calculators - 3 -HP 12C Platinum Using the RPN stack to solve problems efficiently - Version 1.0
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.5 \ 2.33 +
Figure 3
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 L-register (last-x);
2. take Y-register contents and add to X-register contents;
3. replace actual X-register contents for 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.
Based on these facts, it is seen that \not only separates two numbers entered in a keystroke sequence, but it
actually provides that a copy of the number currently in the X-register is preserved for immediate use, and this copy is
kept in the Y-register. This way, when +is pressed in this example, the number that is in the Y-register is the one that
was copied there by \. This same operational sequence is observed when -, §, zand qare used. These
are the 'two-number functions'. When the \key is pressed, the copy of the number shown in the display is actually
kept in the Y-register. This pushes the previous contents of the Z- and Y-registers up to the T- and Z-registers,
respectively. This is called "stack lifting" because the stack register contents are "lifted" or pushed up. Previous
T-register contents are lost after \is pressed, since they are "pushed" off the top of the stack.
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 \ 33 \ 22 \ 11
The stack registers contents would be updated according to the diagrams shown below:
T 44.00 44.00
Z 44.00 44.00 33.00 33.00
Y 44.00 44.00 33.00 33.00 22.00 22.00
X 44 44.00 33 33.00 22 22.00 11
44 \(∗) 33 \(∗) 22 \(∗) 11
Figure 4
(∗)Entering a number in the X-register right after \, O, _or g^ overwrites current X-register contents and does not lift stack contents

hp calculators
HP 12C Platinum Using the RPN stack to solve problems efficiently
hp calculators - 4 -HP 12C Platinum Using the RPN stack to solve problems efficiently - Version 1.0
Under certain circumstances, keeping track of whatever is in each stack register is not practical for daily, quick
computations. To help viewing the stack contents, two functions are an aid: ~(X exchanges Y contents) and d
(roll-down all stack registers contents). Keeping previous contents as they are, let us try the following keystroke:
T 44.00 11.00 22.00 22.00 22.00 22.00 44.00
Z 33.00 44.00 11.00 11.00 11.00 11.00 22.00
Y 22.00 33.00 44.00 33.00 44.00 33.00 11.00
X 11.00 22.00 33.00 44.00 33.00 44.00 33.00
d d ~ ~ ~ d
Figure 5
Using Last-x contents in chain calculations
The L-register is automatically updated anytime the X-register contents are changed. In this case, the L-register is
loaded with a copy of the last value in X prior to executing the function, hence the reference Last x. Whenever possible,
using L-register contents in chain calculations avoids numbers or intermediate results to be typed in again. The L-
register's contents can be retrieved to the X-register anytime it is needed with the sequence gF.
Example 4: What is the shortest keystroke sequence to find yvalue in the following expression given x=3.4567?
)ln(2 xxy ×+= Figure 6
Solution: The shortest keystroke sequence to compute yis:
3.4567 gr gF g¿ 2 § +
Figure 7
When gr is pressed after 3.4567 is keyed in, the L-register is loaded with 3.4567(1), a copy of X-
register contents, before the square is applied. Right after gr, gF retrieves L-register contents
back to the X-register(2) so ln(x)can be calculated. What must be remembered is that gF also
causes the stack contents to be lifted because gF in fact acts like a number entry, as if 3.4567 is
keyed in. The sequence g° 2 §(4) computes the second part of the right side of the equation. As
it can be seen, the 2(3) key enters a value in the X-register, so the stack is lifted. Now both x2and
3×ln(x)are correctly located in the stack and +(5) computes the answer for the yvalue at once. The
diagram below shows each operation and the related stack register contents. a, b, c, dand lare any
random values previously in the stack registers. The dashed arrow indicates the first number entry, while
straight-line arrows indicate L-register contents change and use.

hp calculators
HP 12C Platinum Using the RPN stack to solve problems efficiently
hp calculators - 5 -HP 12C Platinum Using the RPN stack to solve problems efficiently - Version 1.0
T d c c b b a a a
Z c b b a a 1.86 a a
Y b a a 1.86 1.86 1.24 1.86 a
X a 3.4567 1.86 3.46 1.24 2 2.48 4.34
3.4567 gr(1) gF(2) g¿ 2(3) §(4) +(5)
L l l 3.4567 3.4567 3.4567 3.4567 2.00 2.48
Figure 8
Using the stack registers efficiently does not mean to keep track of all stack register contents all the time. Instead
keeping track of what is happening, like which registers have their contents being used, is helpful.
Practice solving problems with stack registers
Example 5: Now what is the shortest keystroke sequence to find yvalue if the previous expression is changed for the
one below, given x=3.4567?
x
xxy 1
)ln(2 −×+= Figure 9
Solution: One of the shortest keystroke sequences to compute yin the expression is:
3.4567 gr gF y Þ gF g¿ 2 § + +
Figure 10
In this example, a single shift in the sequence of terms was made. The term 2×ln(x)needs four keystrokes
and does not leave a copy of xin L-register, so it was left as the last term to be computed. The expression
is written like this:
)ln(2
1x
x
xy ×+−= Figure 11
Another sequence to compute the expression is:
3.4567 gr gF \(6) g¿ 2 § ~(7)y - +
This sequence uses \to duplicate the number in the X-register(6) so it can be used to compute 2×ln(x)
while a copy of it held in Y-register is retrieved to compute -1/xlater(7).

hp calculators
HP 12C Platinum Using the RPN stack to solve problems efficiently
hp calculators - 6 -HP 12C Platinum Using the RPN stack to solve problems efficiently - Version 1.0
T d c c b a a 1.86 1.86
Z c b b a 1.86 1.86 3.46 1.86
Y b a a 1.86 3.46 3.46 1.24 3.46
X a 3.4567 1.86 3.46 3.46 1.24 2 2.48
3.4567 gr gF \ g¿ 2 §
L l l 3.4567 3.4567 3.4567 3.4567 3.4567 2.00
T 1.86 1.86 1.86 1.86 1.86
Z 1.86 1.86 1.86 1.86 1.86
Y 3.46 2.48 2.48 1.86 1.86
X 2.48 3.46 0.29 2.19 4.05
~ y - =
L 2.00 2.00 3.4567 0.29 2.19
Figure 12
Another possible keystroke sequence to compute yin this example is:
3.4567 \ \ gr ~ g¿ 2 § + ~ y -
These examples only begin to scratch the surface of the possibilities that exist when using RPN.
Other manuals for 12C
20
Table of contents
Other HP Calculator manuals
Popular Calculator manuals by other brands

Calculated Industries
Calculated Industries 4225 Pocket reference guide

Calculated Industries
Calculated Industries PIPE TRADES PRO 4095 Pocket reference guide

NexxTech
NexxTech Desk Calculator owner's manual

Casio
Casio DL-220LA(GY) Service manual & parts list

Casio
Casio CFX-9800G owner's manual

Casio
Casio FX-9750G manual