(71B) RPN (v2)
|
06-13-2024, 05:17 AM
Post: #1
|
|||
|
|||
(71B) RPN (v2)
Memory Used:
U = temporary register X = x stack Y = y stack Z = z stack T = t stack L = last x register M = memory register Keys Stack Operation [ END LINE ]: Enters a number. The number is placed on the X stack while everything else is pushed up one level. Note: The key string code for END LINE is #38. [ ↑ ]: Swap: swaps the contents of X and Y stacks. The key string code for ↑ is #50. [ ↓ ]: Roll Down: brings the stack contents down one level (T to Z, Z to Y, Y to X, X wraps around to T). The key string code for ↓ is #51. [ f ] [ ↓ ] (-LINE): Drop: Drops the stack down, Y replaces X, Z goes to Y, and T is copied to Z. This is effectively erasing the contents of stack X, and is similar to the HP 48’s DROP command. The key string code for -LINE is #107. [ f] [ ) ] (COPY): Duplicate: Duplicates the contents of the X stack to the Y stack, after Y transfer to Z and Z transfers to T. This command is similar to the HP 48’s DUP command. The key string code for COPY is f) (small F, right parenthesis). [ P ]: Pi (π): Enters the numeric constant π to the X stack and pushes everything else up. The contents of the T stack are lost. [ M ]: Stores the contents of X into the memory register. [ S ]: Adds the contents of X to the memory register (M+). [ g ] [ M ] (m): Recalls the contents of the memory register to the X stack and pushes everything else up. The contents of the T stack are lost. [ f ] [ END LINE ] (RES): Recalls the contents of the last X register to the X stack and pushes everything else up. The contents of the T stack are lost. The key string code for RES is #94. [ N ]: Negate: changes the sign of the X stack. This is the change sign key. Arithmetic and Two-Argument Operations All these operations update the Last X register. The contents of the Z register get copied to the Y register, then the contents of T gets copied to Z. [ + ]: Addition: Y + X. [ - ]: Subtraction. Y – X. [ * ]: Multiplication. Y * X [ / ]: Division: Y / X [ g ] [ / ] (^) : Power: Y^X [ g ] [ 5 ] (%): Modulus. mod(Y,X) One-Argument Operations All these operations update the Last X register. No other stack levels are affected. [ f ] [ / ] (SQR): Principal (positive) Square Root of X. The key string code for SQR is f/ (small f, division). [ U ]: Square of X. (X^2 = X * X). [ I ]: Reciprocal of X. (1/X) [ F ]: Fractional part of X. [ g ] [ F ] (f): Integer part of X. [ f ] [ - ] (LOG): Natural logarithm of X. ln(X) The key string code for LOG is f- (small f, subtraction). [ f ] [ * ] (EXP): Exponential of X. e^X (e is about 2.71828...) The key string code for EXP is f* (small f, multiplication). [ f ] [ 4 ] (SIN): Sine of X. [ f ] [ 5 ] (COS): Cosine of X [ f ] [ 6 ] (TAN): Tangent of X [ f ] [ 1 ] (ASIN): Arc-sine of X [ f ] [ 2 ] (ACOS): Arc-cosine of X [ f ] [ 3 ] (ATAN): Arc-tangent of X [ D ]: Change to Degrees mode [ g ] [ D ] (d): Convert X from radians to degrees [ R ]: Change to Radians mode [ g ] [ R ] (r): Convert X from degrees to radians [ g ] [ 3 ] (#): Generate a random number between 0 and 1. [ f ] [ = ] (FACT): Factorial of X. X must be a positive integer. [ f ] [ , ] ( > ): Convert rectangular to polar. X: x-coordinate to radius, Y: y-coordinate to angle [ f ] [ . ] ( < ): Convert polar to rectangular. X: radius to x-coordinate, Y: angle to y-coordinate HP 71B Basic Program Code: RPNT Memory: 1253 bytes Code: 10 DESTROY U,X,Y,Z,T,M,L,K$ Example Calculations 1. Find the percent change from 8000 to 12000. Formula: (12000 – 8000) / 8000 * 100 Keystrokes: [END LINE] 12000 [END LINE] [END LINE] 8000 [END LINE] [ - ] [ f ] [END LINE] (RES) <LASTx> [ / ] [END LINE] 100 [END LINE] [ * ] Result: 50 (50%) 2. e^(2*π – 1) Keystrokes: [END LINE] 2 [END LINE] [ P ] <enter π to the stack> [ * ] [END LINE] 1 [END LINE] [ - ] [ f ] [ * ] (EXP) <exp(x) =e^x> Result: 196.996371 3. 1/(1/9 + ln 11 + 8^2) Keystrokes: [END LINE] 9 [END LINE] [ I ] <1/x> [END LINE] 11 [END LINE] [ f ] [ - ] (LOG) <ln(x)> [ + ] [END LINE] 8 [END LINE] [ U ] <x^2> [ + ] [ I ] Result: 1.50355576541E-2 4. Use the memory register to calculate: 3 * 18 + 8 * 17 Keystrokes: [END LINE] 3 [END LINE] [END LINE] 18 [END LINE] [ * ] [ M ] <store into memory> [END LINE] 8 [END LINE] [END LINE] 17 [END LINE] [ * ] [ S ] <add to memory> [ g ] [ M ] (m) <recall memory> Result: 190 5. Find the arc-sin of 0.5 in degrees and radians Keystrokes: [ D ] <set degrees mode> [END LINE] 0.5 [END LINE] [ f ] [ ) ] (COPY) < copies 0.5 to Y > [ f ] [ 1 ] (ASIN) < Result: 30 degrees > [ ↑ ] < swap > [ R ] < set radians mode, RAD indicator is on > [ f ] [ 1 ] (ASIN) < Result: 0.523598775598 radians > 6. Calculate | 99 – 164 * 1.03^3 | Keystrokes: [END LINE] 99 [END LINE] [END LINE] 164 [END LINE] [END LINE] 1.03 [END LINE] [END LINE] 3 [END LINE] [ g ] [ / ] (^) [ * ] [ - ] [ A ] < absolute value > Result: 80.207228 7. Convert Rectangular to Polar with X = 4, Y = 5. Calculate the angle in degrees mode. Keystrokes: [ D ] <set degrees mode> [END LINE] 5 [END LINE] <enter y first> [END LINE] 4 [END LINE] <enter x next> [ g ] [ , ] ( > ) < rectangular to polar> Display: 6.40312423743 (radius) [ ↑ ] <swap> Display: 51.3401917459 (angle) 8. Convert Polar to Rectangular with R = 11, θ = 60°. Keystrokes: [ D ] <set degrees mode> [END LINE] 60 [END LINE] <enter θ first> [END LINE] 11 [END LINE] <enter r next> [ g ] [ . ] ( < ) <polar to rectangular> Display: 5.5 (x) [ ↑ ] Display: 9.52627944162 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)