



Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Prepare-se para as provas
Estude fácil! Tem muito documento disponível na Docsity
Prepare-se para as provas com trabalhos de outros alunos como você, aqui na Docsity
Encontra documentos específicos para os exames da tua universidade
Prepare-se com as videoaulas e exercícios resolvidos criados a partir da grade da sua Universidade
Responda perguntas de provas passadas e avalie sua preparação.
Ganhe pontos para baixar
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
An in-depth understanding of the hp 12c calculator's reverse polish notation (rpn) stack, its benefits, and efficient problem-solving techniques using stack registers. Learn how to use the x, y, z, t, and l registers, understand the difference between one-number and two-number functions, and explore various examples to master the hp 12c calculator.
Tipologia: Notas de estudo
1 / 6
Esta página não é visível na pré-visualização
Não perca as partes importantes!




HP 12C Using the RPN stack to solve problems efficiently
The benefits of understanding RPN stack operations
Understanding the HP12C RPN stack operation
Viewing and reordering stack-register contents
Using Last-x contents in chain calculations
Practice with solving problems using stack registers
HP 12C Using the RPN stack to solve problems efficiently
The benefits of understanding RPN stack operations
RPN stands for Reverse Polish Notation. Anytime the simplest operation is performed in the HP12C, many of these RPN resources are used. 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 operation
When in normal, 'run' mode, every operation performed in the HP12C 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:
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 12C Using the RPN stack to solve problems efficiently
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:
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 y value in the following expression given x =3.4567?
Solution: The shortest keystroke sequence to compute y is:
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 x^2 and 3×ln( x ) are correctly located in the stack and +(5)^ computes the answer for the y value at once. The diagram below shows each operation and the related stack register contents. a , b , c , d and l are 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 12C Using the RPN stack to solve problems efficiently
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.
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. 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 y value if the previous expression is changed for the one below, given x =3.4567?
Solution: One of the shortest keystroke sequences to compute y in 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 x in L-register, so it was left as the last term to be computed. The expression is written like this:
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/ x later(7).