# HP HP-15C (02) PDF MANUAL

Post questions, comments, reviews or page errors in the comment box below.

Your File is Ready … Download PDF

CLICK HERE TO DOWNLOAD HP HP-15C (02) PDF MANUAL

**PDF Content Summary: **HP-15C Owner’s Handbook HP Part Number: 00015-90001 Edition 2.4, Sep 2011 Legal Notice This manual and any examples contained herein are provided “as is” and are subject to change without notice. Hewlett-Packard Company makes no warranty of any kind with regard to this manual, including, but not limited to, the implied warranties of merchantability non infringement and fitness for a particular purpose. In this regard, HP shall not be liable for technical or editorial errors or omissions contained in the manual. Hewlett-Packard Company shall not be liable for any errors or incidental or consequential damages in connection with the furnishing, performance, or use of this manual or the examples contained herein. Copyright © 2011 Hewlett-Packard Development Company, LP. Reproduction, adaptation, or translation of this manual is prohibited without prior written permission of Hewlett-Packard Company, except as allowed under the copyright laws. Hewlett-Packard Company Palo Alto, CA 94304 USA Introduction Congratulations! Whether you are new to HP calculators or an experienced user, you will find the HP-15C a powerful and valuable calculating tool. The HP-15C provides: 448 bytes of program memory (one or two bytes per instruction) and sophisticated programming capability, including conditional and unconditional branching, subroutines, flags, and editing. Four advanced mathematics capabilities: complex number calculations, matrix calculations, solving for roots, and numerical integration. Direct and indirect storage in up to 67 registers. This handbook is written for you, regardless of your level of expertise. The beginning part covers all the basic functions of the HP-15C and how to use them. The second part covers programming and is broken down into three subsections – The Mechanics, Examples, and Further Information – in order to make it easy for users with varying backgrounds to find the information they need. The last part describes the four advanced mathematics capabilities. Before starting these sections, you may want to gain some operating and programming experience on the HP-15C by working through the introductory material, The HP-15C: A Problem Solver, on page 12. The various appendices describe additional details of calculator operation, as well as warranty and service information. The Function Summary and Index and the Programming Summary and Index at the back of this manual can be used for quick reference to each function key and as a handy page reference to more comprehensive information inside the manual. Also available from Hewlett-Packard is the HP-15C Advanced Functions Handbook, which provides applications and technical descriptions for the root-solving, integration, complex number, and matrix functions. Note: You certainly do not need to read every part of the manual before delving into the HP-15C Advanced Functions if you are already familiar with HP calculators. The use of _and f requires a knowledge of HP-15C programming. 3 Contents The HP-15C: A Problem Solver .................................... 12 A Quick Look at v ................................................. 12 Manual Solutions ............................................................ 13 Programmed Solutions ..................................................... 14 Part I: HP-15C Fundamentals ................................ 17 Section 1: Getting Started .......................................... 18 Power On and Off .......................................................... 18 Keyboard Operation ....................................................... 18 Primary and Alternate Functions ..................................... 18 Prefix Keys .................................................................. 19 Changing Signs ........................................................... 19 Keying in Exponents ..................................................... 19 The "CLEAR" Keys ........................................................ 20 Display Clearing:`and − ................................... 21 Calculations ................................................................... 22 One-Number Functions ................................................. 22 Two-Number Functions and v............................... 22 Section 2: Numeric Functions ..................................... 24 Pi .................................................................................. 24 Number Alteration Functions ............................................ 24 One-Number Functions .................................................... 25 General Functions ........................................................ 25 Trigonometric Operations .............................................. 26 Time and Angle Conversions ......................................... 26 Degrees/Radians Conversions ....................................... 27 Logarithmic Functions ................................................... 28 Hyperbolic Functions .................................................... 28 Two-Number Functions .................................................... 29 The Power Function ...................................................... 29 Percentages ................................................................. 29 Polar and Rectangular Coordinate Conversions ............... 30 Section 3: The Automatic Memory Stack, LAST X, and Data Storage ........................................................ 32 4 Contents 5 The Automatic Memory Stack and Stack Manipulation ........ 32 Stack Manipulation Functions ........................................ 33 The LAST X Register and K ....................................... 35 Calculator Functions and the Stack ................................. 36 Order of Entry and the vKey ............................... 37 Nested Calculations ..................................................... 38 Arithmetic Calculations With Constants ........................... 39 Storage Register Operations ............................................ 42 Storing and Recalling Numbers ..................................... 42 Clearing Data Storage Registers .................................... 43 Storage and Recall Arithmetic ........................................ 43 Overflow and Underflow .............................................. 45 Problems ........................................................................ 45 Section 4: Statistics Functions ..................................... 47 Probability Calculations ................................................... 47 Random Number Generator ............................................. 48 Accumulating Statistics ..................................................... 49 Correcting Accumulated Statistics ................................... 52 Mean .......................................................................... 53 Standard Deviation ....................................................... 53 Linear Regression ......................................................... 54 Linear Estimation and Correlation Coefficient ................... 55 Other Applications ....................................................... 57 Section 5: The Display and Continuous Memory ........... 58 Display Control .............................................................. 58 Fixed Decimal Display .................................................. 58 Scientific Notation Display ............................................ 59 Engineering Notation Display ........................................ 59 Mantissa Display ......................................................... 60 Round-Off Error ............................................................ 60 Special Displays ............................................................. 60 Annunciators ............................................................... 60 Digit Separators ........................................................... 61 Error Display ............................................................... 61 Overflow and Underflow .............................................. 61 Low-Power Indication .................................................... 62 Continuous Memory ........................................................ 62 Status ......................................................................... 62 6 Contents Resetting Continuous Memory ........................................ 63 Part II: HP-15C Programming ............................... 65 Section 6: Programming Basics .................................. 66 The Mechanics ............................................................... 66 Creating a Program ..................................................... 66 Loading a Program ...................................................... 66 Intermediate Program Stops ........................................... 68 Running a Program ....................................................... 68 How to Enter Data ........................................................ 69 Program Memory ......................................................... 70 Further Information .......................................................... 74 Program Instructions ..................................................... 74 Instruction Coding ........................................................ 74 Memory Configuration .................................................. 75 Program Boundaries ..................................................... 77 Unexpected Program Stops ........................................... 78 Abbreviated Key Sequences .......................................... 78 User Mode .................................................................. 79 Polynomial Expressions and Horner's Method .................. 79 Nonprogrammable Functions ......................................... 80 Problems ........................................................................ 81 Section 7: Program Editing ........................................ 82 The Mechanics ............................................................... 82 Moving to a Line in Program Memory ............................. 82 Deleting Program Lines ................................................. 83 Inserting Program Lines ................................................. 83 Examples ....................................................................... 83 Further Information .......................................................... 85 Single-Step Operations ................................................. 85 Line Position ................................................................ 86 Insertions and Deletions ................................................ 87 Initializing Calculator Status .......................................... 87 Problems ........................................................................ 87 Section 8: Program Branching and Controls ................. 90 The Mechanics ............................................................... 90 Branching ................................................................... 90 Conditional Tests .......................................................... 91 Contents 7 Flags .......................................................................... 92 Examples ....................................................................... 93 Example: Branching and Looping ................................... 93 Example: Flags ............................................................ 95 Further Information .......................................................... 97 GoTo .......................................................................... 97 Looping ...................................................................... 98 Conditional Branching .................................................. 98 Flags .......................................................................... 98 The System Flags: Flags 8 and 9 .................................... 99 Section 9: Subroutines ............................................... 101 The Mechanics ............................................................... 101 GoTo Subroutine and Return .......................................... 101 Subroutine Limits .......................................................... 102 Examples ....................................................................... 102 Further Information .......................................................... 105 The Subroutine Return ................................................... 105 Nested Subroutines ...................................................... 105 Section 10: The Index Register and Loop Control ........... 106 The V and % Keys .................................................... 106 Direct Versus Indirect Data Storage With The Index Register ..................................................... 106 Indirect Program Control With the Index Register ............. 107 Program Loop Control ................................................... 107 The Mechanics ............................................................... 107 Index Register Storage and Recall .................................. 107 Index Register Arithmetic ............................................... 108 Exchanging the X-Register ............................................. 108 Indirect Branching With V ......................................... 108 Indirect Flag Control With V ...................................... 109 Indirect Display Format Control With V ....................... 109 Loop Control with Counters:Iande .................. 109 Examples ....................................................................... 111 Examples: Register Operations ....................................... 111 Example: Loop Control Withs ................................. 112 Example: Display Format Control .................................... 114 Further Information .......................................................... 115 Index Register Contents ................................................. 115 8 Contents Iande .......................................................... 116 Indirect Display Control ........................................... 116 Part III: HP-15C Advanced Functions .................... 119 Section 11: Calculating With Complex Numbers .......... 120 The Complex Stack and Complex Mode ............................ 120 Creating the Complex Stack .......................................... 120 Deactivating Complex Mode ......................................... 121 Complex Numbers and the Stack ...................................... 121 Entering Complex Numbers ........................................... 121 Stack Lift in Complex Mode ........................................... 124 Manipulating the Real and Imaginary Stacks .................. 124 Changing Signs .......................................................... 124 Clearing a Complex Number ....................................... 125 Entering a Real Number ............................................... 128 Entering a Pure Imaginary Number ............................... 129 Storing and Recalling Complex Numbers ....................... 130 Operations With Complex Numbers ................................ 130 One-Number Functions ................................................ 131 Two-Number Functions ................................................. 131 Stack Manipulation Functions ....................................... 131 Conditional Tests ......................................................... 132 Complex Results from Real Numbers .............................. 133 Polar and Rectangular Coordinate Conversions ................. 133 Problems ....................................................................... 135 For Further Information ................................................... 137 Section 12: Calculating With Matrices ........................ 138 Matrix Dimensions ......................................................... 140 Dimensioning a Matrix ................................................. 141 Displaying Matrix Dimensions ....................................... 142 Changing Matrix Dimensions ........................................ 142 Storing and Recalling Matrix Elements .............................. 143 Storing and Recalling All Elements in Order ................... 143 Checking and Changing Matrix Elements Individually ..... 145 Storing a Number in All Elements of a Matrix ................. 147 Matrix Operations ......................................................... 147 Matrix Descriptors ....................................................... 147 The Result Matrix ......................................................... 148 Contents 9 Copying a Matrix ....................................................... 149 One-Matrix Operations ................................................ 149 Scalar Operations ....................................................... 151 Arithmetic Operations .................................................. 153 Matrix Multiplication ................................................... 154 Solving the Equation AX = B.......................................... 156 Calculating the Residual ............................................... 159 Using Matrices in LU Form ............................................ 160 Calculations With Complex Matrices ............................... 160 Storing the Elements of a Complex Matrix ...................... 161 The Complex Transformations Between ZP and Z ............. 164 Inverting a Complex Matrix .......................................... 165 Multiplying Complex Matrices ...................................... 166 Solving the Complex Equation AX = B ............................ 168 Miscellaneous Operations Involving Matrices ..................... 173 Using a Matrix Element With Register Operations ............ 173 Using Matrix Descriptors in the Index Register ................. 173 Conditional Tests on Matrix Descriptors .......................... 174 Stack Operation for Matrix Calculations ............................ 174 Using Matrix Operations in a Program .............................. 176 Summary of Matrix Functions ........................................... 177 For Further Information .................................................... 179 Section 13: Finding the Roots of an Equation ................ 180 Using _................................................................. 180 When No Root Is Found .................................................. 186 Choosing Initial Estimates ................................................ 188 Using_in a Program .............................................. 192 Restriction on the Use of_....................................... 193 Memory Requirements ..................................................... 193 For Further Information .................................................... 193 Section 14: Numerical Integration .............................. 194 Using f....................................................................... 194 Accuracy of f ............................................................. 200 Using fin a Program .................................................. 203 Memory Requirements ..................................................... 204 For Further Information .................................................... 204 10 Contents Appendix A: Error Conditions .................................... 205 Appendix B: Stack Lift and the LAST X Register ............... 209 Digit Entry Termination .................................................... 209 Stack Lift ........................................................................ 209 Disabling Operations ................................................... 210 Enabling Operations .................................................... 210 Neutral Operations ...................................................... 211 LAST X Register ............................................................... 212 Appendix C: Memory Allocation ................................ 213 The Memory Space ......................................................... 213 Registers ..................................................................... 213 Memory Status (W) .................................................. 215 Memory Reallocation ...................................................... 215 The m% Function ................................................ 215 Restrictions on Reallocation ........................................... 216 Program Memory ............................................................ 217 Automatic Program Memory Reallocation ........................ 217 Two-Byte Program Instructions ....................................... 218 Memory Requirements for the Advanced Functions ............. 218 Appendix D: A Detailed Look at _ ...................... 220 How _Works ....................................................... 220 Accuracy of the Root ....................................................... 222 Interpreting Results .......................................................... 226 Finding Several Roots ...................................................... 233 Limiting the Estimation Time .............................................. 238 Counting Iterations ....................................................... 239 Specifying a Tolerance ................................................. 239 For Advanced Information ................................................ 239 Appendix E: A Detailed Look at f ........................... 240 How f Works ............................................................. 240 Accuracy, Uncertainty, and Calculation Time ..................... 241 Uncertainty and the Display Format ................................... 245 Conditions That Could Cause Incorrect Results .................... 249 Conditions That Prolong Calculation Time .......................... 254 Obtaining the Current Approximation to an Integral ........... 257 For Advanced Information ................................................ 258 Contents 11 Appendix F: Batteries ............................................. 259 Low-Power Indication ....................................................... 259 Installing New Batteries ................................................ 259 Verifying Proper Operation (Self-Tests) ............................... 261 Function Summary and Index ..................................... 262 Complex Functions .......................................................... 262 Conversions ................................................................... 262 Digit Entry ...................................................................... 262 Display Control .............................................................. 263 Hyperbolic Functions ....................................................... 263 Index Register Control ..................................................... 263 Logarithmic and Exponential Functions .............................. 263 Mathematics .................................................................. 264 Matrix Functions ............................................................. 264 Number Alteration .......................................................... 265 Percentage ..................................................................... 266 Prefix Keys ..................................................................... 266 Probability ..................................................................... 266 Stack Manipulation ......................................................... 266 Statistics ........................................................................ 267 Storage ......................................................................... 267 Trigonometry .................................................................. 268 Programming Summary and Index .............................. 269 Subject Index ........................................................... 271 The HP-15C: A Problem Solver The HP-15C Advanced Programmable Scientific Calculator is a powerful problem solver, convenient to carry and easy to hold. Its continuous memory retains data and program instructions indefinitely until you choose to reset it. Though sophisticated, it requires no prior programming experience or knowledge of programming languages to use it. The new HP-15C is a modern re-release of the original HP-15C introduced in 1982. While the battery life of the new version is now estimated to be 1 year for normal use, the calculator is now at least 150 times faster than the original. The low-power indicator gives you plenty of warning before the calculator stops functioning. The HP-15C also conserves power by automatically shutting its display off if it is left inactive for a few minutes. But don't worry about losing data – any information contained in the HP-15C is saved by Continuous Memory.

A Quick Look at v

Your Hewlett-Packard calculator uses a unique operating logic, represented by the vkey, that differs from the logic in most other calculators. You will find that using v makes nested and complicated calculations easier and faster to work out. Let's get acquainted with how this works. For example, let's look at the arithmetic functions. First we have to get the numbers into the machine. Is your calculator on? If not, press =. Is the display cleared? To display all zeros, you can press |`that is, press

|, then −.* To perform arithmetic, key in the first number, press v to separate the first number from the second, then key in the second number

and press +, -, *or ÷. The result appears immediately after you press any numerical function key. *If you have not used an HP calculator before, you will notice that most keys have three labels. To use the primary function – the one printed in white on top of the key – just press that key. For those printed in gold or blue, press the gold ´key or the blue |key first. 12 The HP-15C: A Problem Solver 13 The display format used in this handbook is •4 (the decimal point is ―fixed‖ to show four decimal places) unless otherwise mentioned. If your calculator does not show four decimal places, you may want to press ´•4 to match the displays in the examples. Manual Solutions Run through the following two-number calculations. It is not necessary to clear the calculator between problems. If you enter a digit incorrectly, press −to undo the mistake, then key in the correct number. To Compute Keystrokes Display 9 - 6 = 3 9 v6 - 3.0000 9 × 6 = 54 9 v6 * 54.0000 9 ÷ 6 = 1.5 9 v6 ÷ 1.5000 96= 531,441 9 v6 Y 531,441.0000 Notice that in the four examples: Both numbers are in the calculator before you press the function key. vis used only to separate two numbers that are keyed in one after the other. Pressing a numeric function key, in this case -*÷or Y, executes the function immediately and displays the result. To see the close relationship between manual and programmed problem solving, let's first calculate the solution to a problem manually, that is, from the keyboard. Then we'll use a program to calculate the solution to the same problem with different data. 14 The HP-15C: A Problem Solver The time an object takes to fall to the ground (ignoring air friction) is given by the formula 2h t = , g where t = time in seconds, h= height in meters, g= the acceleration due to gravity, 9.8 m/s2. Example: Compute the time taken by a stone falling from the top of the Eiffel Tower (300.51 meters high) to the earth. Keystrokes Display 300.51 v 300.5100 Enter h. 2 * 601.0200 Calculates 2h. 9.8 ÷ 61.3286 (2h) /g. ¤ 7.8313 Falling time, seconds. Programmed Solutions Suppose you wanted to calculate falling times from various heights. The easiest way is to write a program to cover all the constant parts of a calculation and provide for entry of variable data. Writing the Program. The program is similar to the keystroke sequence you used above. A label is useful to define the beginning of a program, and a return is useful to mark the end of a program. Also, the program must accommodate the entry of new data. Loading the Program. You can load a program for the above problem by pressing the following keys in sequence. (The display shows information which you can ignore for now, though it will be useful later.) The HP-15C: A Problem Solver 15 Keystrokes Display |¥ 000- Sets HP-15C to Program mode. (PRGM annunciator on.) ´CLEAR M 000- Clears program memory. (This step is optional here.) ´bA 001-42,21,11 Label "A" defines the beginning of the program. 2 002- 2 * 003- 20 9 004- 9 The same keys you pressed to solve the . 005- 48 problem manually. 8 006- 8 ÷ 007- 10 ¤ 008- 11 |n 009- 43 32 ―Return‖ defines the end of the program. |¥ 7.8313 Switches to Run mode. (No PRGM annunciator.) Running the Program. Enter the following information to run the program. Keystrokes Display 300.51 300.51 Height of the Eiffel Tower. ´A 7.8313 Falling time you calculated earlier. 1050 ´A 14.6385 The time (seconds) for a stone to reach the ground after release from a blimp 1050 m high. 16 The HP-15C: A Problem Solver With this program loaded, you can quickly calculate the time of descent of an object from different heights. Simply key in the height and press ´A. Find the time of descent for objects released from heights of 100 m, 2 m, 275 m, and 2,000 m. The answers are: 4.5175 s; 0.6389 s; 7.4915 s; and 20.2031 s. That program was relatively easy. You will see many more aspects and details of programming in part II. For now, turn the page to take an in-depth look at some of the calculator's important operating basics. Part l HP-15C Fundamentals Section 1 Getting Started Power On and Off The = key turns the HP-15C on and off.* To conserve power, the calculator automatically turns itself off after a few minutes of inactivity. Keyboard Operation Primary and Alternate Functions Most keys on your HP-15C perform one primary and two alternate, shifted functions. The primary function of any key is indicated by the character(s) on the face of the key. The alternate functions are indicated by the gold characters printed above the key and the blue characters printed on the lower face of the key. To select the primary function printed on the face of a key, press only that key. For example: ÷. To select the alternate function printed in gold or blue, press the like-colored prefix key (´or |) followed by the function

key. For example: ´_;|

£ .

Throughout this handbook, we will observe certain conventions in referring to alternate functions. References to the function itself will appear as just the key name in a box, such as ―the Wfunction.‖ References to the use of the key will include the prefix key, such as ―press |W.‖ References to the four gold functions printed under the bracket labeled ―CLEAR‖ will be preceded by the word ―CLEAR‖, such as "the CLEARQfunction,‖ or ―press ´CLEARM.‖ * Note that the =key is lower than the other keys to help prevent its being pressed inadvertently. 18 Section 1: Getting Started 19 Notice that when you press the ´ or |

prefix key, an f or g annunciator appears and remains in the display until a function key is pressed to complete the sequence. Prefix Keys 0.0000 f

A prefix key is any key which must precede another key to complete the key sequence for a function. Certain functions require two parts: a prefix key and a digit or other key. For your reference, the prefix keys are: " ^ • G f > i O m ´ | P I l F T s ? t H b < _ X If you make a mistake while keying in a prefix for a function, press ´ CLEARuto cancel the error. The CLEARukey is also used to show the mantissa of a displayed number, so all 10 digits of the number in the display will appear for a moment after the ukey is pressed. Changing Signs Pressing “(change sign) will change the sign (positive or negative) of any displayed number. To key in a negative number, press “after its digits have been keyed in. Keying in Exponents ‛(enter exponent) is used when keying in a number with an exponent. First key in the mantissa, then press ‛and key in the exponent. For a negative exponent press “ after keying in the exponent.*For example, to key in Planck's constant (6.6262×10-34 Joule-seconds) and multiply it by 50: *“may also be pressed after ‛and before the exponent, with the same result (unlike the mantissa, where digit entry must precede “). 20 Section 1: Getting Started Keystrokes Display 6.6262 6.6262 ‛ 6.6262 00 The 00 prompts you to key in the exponent. 3 6.6262 03 (6.6262×103). 4 6.6262 34 (6.6262×1034). “ 6.6262 -34 (6.6262×10-34 ).

v 6.6262 -34 Enters number.

50 * 3.3131 -32 Joule-seconds. Note: Decimal digits from the mantissa that spill into the exponent field will disappear from the display when you press ―, but will be retained internally. To prevent a misleading display pattern, ‛ will not operate with a number having more than seven digits to the left of the radix mark (decimal point), nor with a mantissa smaller than 0.000001. To key in such a number, use a form having a greater exponent value (whether positive or negative). For example, 123456789.8×1023 can be keyed in as 1234567.898×1025; 0.00000025×10-15 can be keyed in as 2.5×10-22. The “CLEAR” Keys Clearing means to replace a number with zero. The clearing operations in the HP-15C are (the table is continued on the next page): Clearing Sequence Effect |` Clears display (X-register). − In Run mode: Clears last digit or entire display. In Program mode: Deletes current instruction. ´CLEAR∑ Clears statistics storage registers, display, and the memory stack (described in section 3). Section 1: Getting Started 21 Clearing Sequence Effect

´ CLEAR M

In Run mode: Repositions program memory to line 000.

In Program mode: Deletes all program memory. ´CLEARQ Clears all data storage registers. ´CLEARu* Clears any prefix from a partially entered key sequence. * Also temporarily displays the mantissa. Display Clearing:`and − The HP-15C has two types of display clearing operations: `(clear X) and −(back arrow). In Run mode: `clears the display to zero. − deletes only the last digit in the display if digit entry has not been terminated by vor most other functions. You can then key in a new digit or digits to replace the one(s) deleted. If digit entry has been terminated, then −acts like `. Keystrokes Display 12345 12,345 Digit entry not terminated. − 1,234 Clears only the last digit. 9 12,349 ¤ 111.1261 Terminates digit entry. − 0.0000 Clears all digits to zero. In Program mode: ` is programmable: it is stored as a programmed instruction, and will not delete the currently displayed instruction. − is not programmable, so it can be used for program correction. Pressing −will delete the entire instruction currently displayed. 22 Section 1: Getting Started Calculations One-Number Functions A one-number function performs an operation using only the number in the display. To use any one-number function, press the function key after the number has been placed in the display. Keystrokes Display 45 45 |o 1.6532 Two-Number Functions andv A two-number function must have two numbers present in the calculator before executing the function. +, -, * and ÷ are examples of two-number functions. Terminating Digit Entry. When keying in two numbers to perform an operation, the calculator needs a signal that digit entry is terminated for the first number. This is done by pressing vto separate the two numbers. If, on the other hand, one of the numbers is already in the calculator as the result of a previous operation, you do not need to use the vkey. All functions except the digit entry keys themselves*have the effect of terminating digit entry. Notice that, regardless of the number, a decimal point always appears and a set number of decimal places are displayed when you terminate digit entry (as by pressing v). Chain Calculations. In the following calculations, notice that: The vkey is used only for separating the sequential entry of two numbers. The operator is keyed in only after both operands are in the calculator. The result of any operation may itself become an operand. Such intermediate results are stored and retrieved on a last-in, first-out basis. New digits keyed in following an operation are treated as a new number. * The digit keys, +, “, ‛, and −. Section 1: Getting Started 23 Example: Calculate (9 + 17 − 4) ÷ 4. Keystrokes Display 9 v 9.0000 Digit entry terminated. 17+ 26.0000 (9 + 17). 4 - 22.0000 (9 + 17 – 4). 4 ÷ 5.5000 (9 + 17 – 4) ÷ 4. Even more complicated problems are solved in the same manner-using automatic storage and retrieval of intermediate results. It is easiest to work from the inside of parentheses outwards, just as you would with calculations on paper. Example: Calculate (6 + 7) × (9 − 3) Keystrokes Display 6 v 6.0000 First solve for the intermediate result of (6 + 7). 7 + 13.0000 9 v 9.0000 Then solve for the intermediate result of (9 − 3). 3- 6.0000 * 78.0000 Then multiply the intermediate results together (13 and 6) for the final answer. Try your hand at the following problems. Each time you press vor a function key in a calculation, the preceding number is saved for the next operation. (16 × 38) – (13 × 11) = 465.0000 4 × (17 – 12) ÷ (10 – 5) = 4.0000 232– (13 × 9) + 1/7 = 412.1429 [(5.4 0.8) (12.5 0.7 )] 0.5998 2 × ÷ − = Section 2 Numeric Functions This section discusses the numeric functions of the HP-15C (excluding statistics and advanced functions). The nonnumeric functions are discussed separately (digit entry in section 1, stack manipulation in section 3, and display control in section 5). The numeric functions of the HP-15C are used in the same way whether executed from the keyboard or in a program. Some of the functions (such as a) are, in fact, primarily of interest for programming. Remember that the numeric functions, like all functions except digit entry functions, automatically terminate digit entry. This means a numeric function does not need to be preceded or followed by v. Pi Pressing | $ places the first 10 digits of π into the calculator. $ does not need to be separated from other numbers by v. Number Alteration Functions The number alteration functions act upon the number in the display (X-register). Integer Portion. Pressing |‘replaces the number in the display with the nearest integer of lesser or equal magnitude. Fractional Portion. Pressing ´qreplaces the number in the display with its fractional part (that is, the difference between the number and its integer part). Rounding. Pressing |&rounds all 10 internally held digits of the mantissa of the displayed value to the number of digits specified by the current •, i, or ^display format. Absolute Value. Pressing | a yields the absolute value of the number in the display. 24 Section 2: Numeric Functions 25 Keystrokes Display 123.4567 |‘ 123.0000 |K“|‘ -123.0000 Reversing the sign does not alter digits. |K´q -0.4567 1.23456789 “ |& -1.2346

´ CLEAR u 1234600000 Temporarily displays all (release) -1.2346 digits in the mantissa.

|a 1.2346 One-Number Functions One-number math functions in the HP-15C operate only upon the number in the display (X-register). General Functions Reciprocal. Pressing ∕ calculates the reciprocal of the number in the display. Factorial and Gamma. Pressing ´ ! calculates the factorial of the displayed value, where x is an integer 0≤x≤69. You can also use ! to calculate the Gamma function, Γ(x), used in advanced mathematics and statistics. Pressing ´!calculates Γ(x + 1), so you must subtract 1 from your initial operand to get Γ(x). For the Gamma function, x is not restricted to nonnegative integers. Square Root. Pressing ¤ calculates the positive square root of the number in the display. Squaring. Pressing | x calculates the square of the number in the display. Keystrokes Display 25 ∕ 0.0400 8 ´! 40,320.0000 Calculates 8! or Γ(9). 3.9 ¤ 1.9748 12.3 |x 151.2900 26 Section 2: Numeric Functions Trigonometric Operations Trigonometric Modes. The trigonometric functions operate in the trigonometric mode you select. Specifying a trigonometric mode does not convert any number already in the calculator to that mode; it merely tells the calculator what unit of measure (degrees, radians, or grads) to assign a number for a trigonometric function. Pressing | D sets Degrees mode. No annunciator appears in the display. Degrees are in decimal, not minutes-seconds form. Pressing |Rsets Radians mode. The RAD annunciator appears in the display. In Complex mode, all functions (except : and ;) assume values are in radians, regardless of the trigonometric annunciator displayed. Pressing | gsets Grads mode. The GRAD annunciator appears in the display. Continuous Memory will maintain the last trigonometric mode selected. At "power up" (initial condition or when Continuous Memory is reset), the calculator is in Degrees mode, Trigonometric Functions. Given x in the display (X-register): Pressing Calculates [ sine of x |, arc sine of x \ cosine of x |{ arc cosine of x ] tangent of x |/ arc tangent of x Before executing a trigonometric function, be sure that the calculator is set to the desired trigonometric mode (Degrees, Radians, or Grads). Time and Angle Conversions Numbers representing time (hours) or angles (degrees) can be converted by the HP-15C between a decimal-fraction and a minutes-seconds format: Section 2: Numeric Functions 27 Hours.Decimal Hours Hours.Minutes Seconds Decimal Seconds (H.h) (H.MMSSs) Degrees.Decimal Hours Degrees.Minutes Seconds Decimal Seconds (D.d) (D.MMSSs)

Hours/Degrees -Minutes-Seconds Conversion. Pressing ´ h

converts the number in the display from a decimal hours/degrees format to an hours/degree-minutes-seconds-decimal seconds format. For example, press ´hto convert 1.2 3 4 5 1 . 1 4 0 4

to hours seconds minutes hours

Press ´uto display the value to all possible decimal places: 1 1 4 0 4 2 0 0 0 0 to the hundred-thousandth of a second. Decimal Hours (or Degrees) Conversion. Pressing | À converts the number in the display from an hours/degrees-minutes-seconds-decimal seconds format to a decimal hours/degrees format. Degrees/Radians Conversions The dand rfunctions are used to convert angles to degrees or radians (D.d↔R.r). The degrees must be expressed as decimal numbers, and not in a minutes-seconds format. Keystrokes Display 40.5 ´r 0.7069 Radians. |d 40.5000 40.5 degrees (decimal fraction). 28 Section 2: Numeric Functions Logarithmic Functions Natural Logarithm. Pressing |Z calculates the natural logarithm of the number in the display; that is, the logarithm to the base e. Natural Antilogarithm. Pressing ' calculates the natural antilogarithm of the number in the display; that is, raises e to the power of that number. Common Logarithm. Pressing | o calculates the common logarithm of the number in the display; that is, the logarithm to the base 10. Common Antilogarithm. Pressing @ calculates the common antilogarithm of the number in the display; that is, raises 10 to the power of that number. Keystrokes Display 45 |Z 3.8067 Natural log of 45. 3.4012 ' 30.0001 Natural antilog of 3.4012. 12.4578 |o 1.0954 Common log of 12.4578. 3.1354 @ 1,365.8405 Common antilog of 3.1354. Hyperbolic Functions Given x in the display (X-register): Pressing Calculates ´P[ hyperbolic sine of x |H[ inverse hyperbolic sine of x ´P\ hyperbolic cosine of x |H\ inverse hyperbolic cosine of x ´P] hyperbolic tangent of x |H] inverse hyperbolic tangent of x Section 2: Numeric Functions 29 Two-Number Functions The HP-15C performs two-number math functions using two values entered sequentially into the display. If you are keying in both numbers, remember

that they mu st be separated byvor any other function – like |

‘ or ∕– that terminates digit entry.

For a two-number function, the first value entered is considered the y-value because it is placed into the Y-register for memory storage. The second value entered is considered the x-value because it remains in the display, which is the X-register. The arithmetic operators, +, -, *, and ÷, are the four basic two number functions. Others are given below. The Power Function Pressing Y calculates the value of y raised to the x power. The base number, y, is keyed in before the exponent, x. To Calculate Keystrokes Display 21.4 2v1.4 Y 2.6390 2-1.4 2v1.4“Y 0.3789 (-2)32“v3Y -8.0000 32or 21/3 2v3∕Y 1.2599 Percentages The percentage functions, k and ∆, preserve the value of the original base number along with the result of the percentage calculation. As shown in the example below, this allows you to carry out subsequent calculations using the base number and the result without re-entering the base number. Percent. The k function calculates the specified percentage of a base number. 30 Section 2: Numeric Functions For example, to find the sales tax at 3% and total cost of a $15.76 item: Keystrokes Display 15.76 v 15.7600 Enters the base number (the price). 3|k 0.4728 Calculates 3% of $15.76 (the tax). + 16.2328 Total cost of item ($15.76 + $0.47). Percent Difference. The ∆ function calculates the percent difference between two numbers. The result expresses the relative increase (a positive result) or decrease (a negative result) of the second number entered compared to the first number entered. For example, suppose the $15.76 item only cost $14.12 last year. What is the percent difference in last year’s price relative to this year’s? Keystrokes Display 15.76v 15.7600 This year's price (our base number) 14.12|∆ -10.4061 Last year's price was 10.41% less than this year's price. Polar and Rectangular Coordinate Conversions The :and ;functions are provided in the HP-15C for conversions between polar coordinates and rectangular coordinates. The angle θ is assumed to be in the mode, whether degrees (in a decimal format, not a minutes seconds format), radians, or grads. θ is measured as shown in the illustration at right. Polar Conversion. Pressing |: (polar) converts a set of rectangular coordinates (x, y) to polar coordinates (magnitude r, angle θ). The y-value must be entered first, the x-value

second. Upon executing |: r will appear in the display. Press ®

(X exchange Y) to bring θ out of the Y -register and into the display (X -

register). θ will be returned as a value between -180° and 180°, between -π and π radians, or between -200 and 200 grads. Section 2: Numeric Functions 31 Rectangular Conversion. Pressing´;(rectangular) converts a set of polar coordinates (magnitude r angle θ) into rectangular coordinates (x, y). θ must be entered first then r. Upon executing ´;, x will be displayed first; press ®to display y. Keystrokes Display |D Set to Degrees mode (no annunciator). 5 v 5.0000 y-value. 10 10 x-value. |: 11.1803 r. ® 26.5651 θ; rectangular coordinates converted to polar coordinates. 30 v 30.0000 θ. 12 12 r. ´; 10.3923 x-value. ® 6.0000 y-value. Polar coordinates converted to rectangular coordinates. Section 3 The Automatic Memory Stack, LAST X, and Data Storage The Automatic Memory Stack and Stack Manipulation HP operating logic is based on a mathematical logic known as ―Polish Notation,‖ developed by the noted Polish logician Jan Łukasiewicz (Wookashye'veech) (1878-1956). Conventional algebraic notation places the algebraic operators between the relevant numbers or variables when evaluating algebraic expressions. Łukasiewicz’s notation specifies the operators before the variables. For optimal efficiency of calculator use, HP applied the convention of specifying (entering) the operators after specifying (entering) the variable(s). Hence the term "Reverse Polish Notation" (RPN). The HP-15C uses RPN to solve complicated calculations in a straightforward manner, without parentheses or punctuation. It does so by automatically retaining and returning intermediate results. This system is implemented through the automatic memory stack and the vkey, minimizing total keystrokes. The Automatic Memory Stack Registers T 0.0000 Z 0.0000 Y 0.0000 X 0.0000 Always displayed When the HP-15C is in Run mode (no PRGM annunciator displayed), the number that appears in the display is the number in the X-register. 32 Section 3: The Memory Stack, LAST X, and Data Storage 33 Any number that is keyed in or results from the execution of a numeric function is placed into the display (X-register). This action will cause numbers already in the stack to lift, remain in the same register, or drop, depending upon both the immediately preceding and the current operation. Numbers in the stack are stored on a last-in, first-out basis. The three stacks drawn below illustrate the three types of stack movement. Assume x, y, z, and t represent any numbers which may be in the stack. Stack Lift No Stack Lift or Drop lost T t z T t t Z z y Z z z Y y x Y y y X x π X xx Keys: |$ ¤ Stack Drop T t t Z z t Y y z X x x + y Keys: + Notice the number in the T-register remains there when the stack drops, allowing this number to be used repetitively as an arithmetic constant. Stack Manipulation Functions v. Pressing vseparates two numbers keyed in one after the other. It does so by lifting the stack and copying the number in the display (X-register) into the Y-register. The next number entered then writes over the value in the X-register; there is no stack lift. The example below shows what happens as the stack is filled with the numbers 1, 2, 3, 4. (The 34 Section 3: The Memory Stack, LAST X, and Data Storage shading indicates that the contents of that register will be written over when the next number is keyed in or recalled.) lost lost lost T t z y y x Z z y x x 1 Y y x 1 1 2 X x 1 1 2 2 Keys: 1 v 2 v lost T x x 1 1 Z 1 1 2 2 Y 2 2 3 3 X 2 3 3 4 Keys: 3 v 4 )(roll down), ((roll up), and®(X exchange Y). )and ( roll the contents of the stack registers up or down one register (one value

moves between the X - and the T -register). No values are lost. ®

exchanges the numbers in the X - and Y -registers. If the stack were loaded

with the sequence 1, 2, 3, 4, the following shifts would result from pressing ))and®. T 1 4 1 1 Z 2 1 2 2 Y 3 2 3 4 X 4 3 4 3 Keys: ) | ( ® Section 3: The Memory Stack, LAST X, and Data Storage 35 The LAST X Register and K The LAST X register, a separate memory register, preserves the value that was last in the display before execution of a numeric operation.*Pressing |K(LAST X) places a copy of the contents of the LAST X register into the display (X-register). For example: lost T t t z Z z z y Y y y 16 X 4 16 4 Keys: |x |K LAST X: / 4 4 TheKfeature saves you from having to re-enter numbers you want to use again (as shown under Arithmetic Calculations With Constants, page 39). It can also assist you in error recovery, such as executing the wrong function or keying in the wrong number. For example, suppose you mistakenly entered the wrong divisor in a chain calculation: Keystrokes Display 287 v 287.0000 12.9 + 22.2481 Oops! The wrong divisor. |K 12.9000 Retrieves from LAST X the last entry to the X-register (the incorrect divisor) before + was executed. * Unless that operation was ’, S, or L, which don’t use or preserve the value in the display (X register), but instead calculate from data in the statistics storage registers (R2 to R7). For a complete list of operations which save x in LAST X, refer to appendix B. 36 Section 3: The Memory Stack, LAST X, and Data Storage Keystrokes Display * 287.0000 Reverses the function that produced the wrong answer. 13.9 + 20.6475 The correct answer. Calculator Functions and the Stack

When you want to key in two numbers, one after th e other, you press v between entries of the numbers. However, when you want to key

in a number immediately following any function (including manipulations like )), you do not need to use v. Why? Executing most HP-15C functions has this additional effect: • The automatic memory stack is lift-enabled that is, the stack will lift automatically when the next number is keyed or recalled into the display. • Digit entry is terminated, so the next number starts a new entry. lost T t t z z Z z z y z Y y y 2 y X 4 2 5 7 Keys: ¤ 5 + There are four functions –v, `, z, and w– that disable stack lift.* They do not provide for the lifting of the stack when the next number is keyed in or recalled. Following the execution of one of these functions, a new number will simple write over the currently displayed number instead of causing the stack to lift. (Although the stack lifts when vis pressed, it will not lift

when the next number is keyed in or recalled. The operation of v

illustrated on page 34 shows how vthus disables the stack.) In most

cases, the above effects will come so naturally that you won’t even think about them.

* − will also disable the stack lift if digit entry is terminated, making − clear the entire display like

` . Otherwise, it is neutral. For a further discussion of the stack, refer to appendix B.

Section 3: The Memory Stack, LAST X, and Data Storage 37 lost T z z z z Z z z z z Y y y y y X 7 0 6 y6 Keys: |` 6 Y Order of Entry and thevKey An important aspect of two-number functions is the positioning of the numbers in the stack. To execute an arithmetic function, the numbers should be positioned in the stack in the same way that you would vertically position them on paper. For example: 98 98 98 98 -15 +15 x15 15 As you can see, the first (or top) number would be in the Y-register, while the second (or bottom) number would be in the X-register. When the mathematics operation is performed, the stack drops, leaving the result in the X-register. Here is how a subtraction operation is executed in the calculator: lost lost T t z y y y Z z y x x y Y y x 98 98 x X x 98 98 15 83 Keys: 98 v 15 - The same number positioning would be used to add 15 to 98, multiply 98 by 15, or divide 98 by 15. 38 Section 3: The Memory Stack, LAST X, and Data Storage Nested Calculations The automatic stack lift and stack drop make it possible to do nested calculations without using parentheses or storing intermediate results. A nested calculation is solved simply as a series of one- and two-number operations. Almost every nested calculation you are likely to encounter can be done using just the four stack registers. It is usually wisest to begin the calculation at the innermost number or pair of parentheses and work outward (as you would for a manual calculation). Otherwise, you may need to place an intermediate result into a storage register. For example, consider the calculation of 3 [4 + 5 (6 + 7)] : Keystrokes Display 6v7 + 13.0000 Intermediate result of (6 + 7). 5* 65.0000 Intermediate result of 5 (6 + 7). 4 + 69.0000 Intermediate result of [4 + 5 (6 + 7)]. 3* 207.0000 Final result: 3 [4 + 5 (6 + 7)]. The following sequence illustrates the stack manipulation in this example. The stack automatically drops after each two-number calculation, and then lifts when a new number is keyed in. (For simplicity, throughout the rest of this handbook we will not show arrows between the stacks.) T t z y y y Z z y x x y Y y x 6 6 x X x 6 6 7 13 Keys: 6 v 7 + Section 3: The Memory Stack, LAST X, and Data Storage 39 T y y y y Z y x y x Y x 13 x 65 X 13 5 65 4 Keys: 5 * 4 T y y y y Z x y x y Y 65 x 69 x X 4 69 3 207 Keys: + 3 * Arithmetic Calculations With Constants There are three ways (without using a storage register) to manipulate the memory stack to perform repeated calculations with a constant: 1. Use the LAST X register. 2. Load the stack with a constant and operate upon different numbers. (Clear the X-register every time you want to change the number operated upon) 3. Load the stack with a constant and operate upon an accumulating number. (Do not change the number in the X register.) LAST X. Use your constant in the X-register (that is, enter it second) so that it always will be saved in the LAST X register. Pressing |Kwill retrieve the constant and place it into the X-register (the display). This can be done repeatedly. 40 Section 3: The Memory Stack, LAST X, and Data Storage Example: Two close stellar neighbors of Earth are Rigel Centaurus (4.3 light-years away) and Sirius (8.7 light-years away). Use the speed of light, c (3.0×108 meters/second, or 9.5×1015 meters/year), to figure the distances to these stars in meters. (The stack diagrams show only one decimal place.) T t z y y Z z y x x Y y x 4.3 4.3 X x 4.3 4.3 9.5 15 Keys: 4.3 v 9.5‛15 LAST X: / / / / T y y y x Z x y x 4.1 16 Y 4.3 x 4.1 16 8.7 X 9.5 15 4.1 16 8.7 9.5 15 Keys: * 8.7 |K LAST X: / 9.5 15 9.5 15 9.5 15 T x x Z 4.1 16 x Y 8.7 4.1 16 (Rigel Centaurus is

X 9.5 15 8.3 16 Keys: * LAST X: 9.5 15 9.5 15 4.1×1016 meters away.) (Sirius is 8.3×1016 meters away.)

Section 3: The Memory Stack, LAST X, and Data Storage 41 Loading the Stack with a Constant. Because the number in the T-register is replicated when the stack drops, this number can be used as a constant in arithmetic operations. T c c New constant

Z c c generation.

Y c c Drops to interact

X x cx Keys: * with X-register.

Fill the stack with a constant by keying it into the display and pressing v three times. Key in your initial argument and perform the arithmetic operation. The stack will drop, a copy of the constant will "fall" into the Y-register, and a new copy of the constant will be generated in the T-register. If the variables change (as in the preceding example), be sure and clear the display before entering the new variable. This disables the stack so that the arithmetic result will be written over and only the constant will occupy the rest of the stack. If you do not have different arguments, that is, the operation will be performed upon a cumulative number, then do not clear the display—simply repeat the arithmetic operation. Example: A bacteriologist tests a certain strain of microorganisms whose population typically increases by 15% each day (a growth factor of 1.15). If she starts with a sample culture of 1000, what will be the bacteria population at the end of each day for four consecutive days? Keystrokes Display

1.15 vv v 1.15 Growth factor. 1.1500 Filling the stack.

1000 1,000 Initial culture size. 42 Section 3: The Memory Stack, LAST X, and Data Storage Keystrokes Display * 1,150.0000 Population at the end of day 1. * 1,322.5000 Day 2. * 1,520.8750 Day 3. * 1,749.0063 Day 4. Storage Register Operations When numbers are stored or recalled, they are copied between the display (X-register) and the data storage registers. At ―power-up‖ (initial turn-on or Continuous Memory reset) the HP-15C has 21 directly accessible storage registers: R0 through R9, R.0 through R.9, and the Index register (RI) (see the diagram of the registers on the inside back cover). Six registers, R2 to R7, are also used for statistics calculations. The number of available data storage registers can be increased or decreased. The m function, which is used to reallocate registers in calculator memory, is discussed in appendix C, Memory Allocation. The lowest-numbered registers are the last to be deallocated from data storage, therefore it is wisest to store data in the lowest-numbered registers available. Storing and Recalling Numbers O(store). When followed by a storage register address (0 through 9 or .0 through .9*), this function copies a number from the display (X-register) into the specified data storage register. It will replace any existing contents of that register. l(recall). Similarly, you can recall data from a particular register into the display by pressing lfollowed by the register address. This brings a copy of the desired data into the display; the contents of the storage register remain unaltered. X (X exchange). Followed by 0 through .9,*this function exchanges the contents of the X-register and the addressed data storage register. This is useful to view storage registers without disturbing the stack. * All storage register operations can also be performed with the Index register (using Vor %), which is covered in section 10, and with matrices, section 12. Section 3: The Memory Stack, LAST X, and Data Storage 43 The above are stack lift-enabling operations, so the number remaining in the X-register can be used for subsequent calculations. If you address a nonexistent register, the display will show Error 3. Example: Springtime is coming and you want to keep track of 24 crocuses planted in your garden. Store the number of crocuses blooming the first day and add to this the number of new blooms the second day. Keystrokes Display 3O0 3.0000 Stores the number of first-day blooms in R0. Turn the calculator off. Next day, turn it back on again. l0 3.0000 Recalls the number of crocuses that bloomed yesterday. 5+ 8.0000 Adds today's new blooms to get the total blooming crocuses. Clearing Data Storage Registers Pressing ´CLEARQ(clear registers) clears the contents of all data storage registers to zero. (It does not affect the stack or the LAST X register.) To clear a single data storage register, store zero in that register. Resetting Continuous Memory clears all registers and the stack. Storage and Recall Arithmetic Storage Arithmetic. Suppose you not only wanted to store a number, but perform arithmetic with it and store the result in the same register. You can do this directly – without using l– by using the following procedure. 1. Have your second operand (besides the one in storage) in the display (as the result of a calculation, a recall, or keying in). 2. Press O. 3. Press +, -, *, or ÷. 4. Key in the register address (0 to 9, .0 to .9). (The Index register, discussed in section 10, can also be used.) 44 Section 3: The Memory Stack, LAST X, and Data Storage The number in the register is determined as follows: For storage arithmetic, + new contents

of register =old contents − of register × ÷ number in display

R0 r T t R0 r-x T t Z z Z z Y y Y y X x X x Keys: O-0 Recall Arithmetic. Recall arithmetic allows you to perform arithmetic with the displayed value and a stored value without lifting the stack, that is, without losing any values from the Y-, Z, and T-registers. The keystroke

sequence is the same as for storage arithmetic using l in place of

O .

For recall arithmetic, + − new display = old display × ÷ contents of register

R0 r T t R0 r T t Z z Z z Y y Y y X x X x-r Keys: l-0 Section 3: The Memory Stack, LAST X, and Data Storage 45 Example: Keep a running count of your newly blooming crocuses for two more days. Keystrokes Display 8O0 8.0000 Places the total number of blooms as of day 2 in R0. 4O+0 4.0000 Day 3: adds four new blooms to those already blooming. 3O+0 3.0000 Day 4: adds three new blooms. 24l-0 9.0000 Subtracts total number of blooms summed in R0(15) from the total number of plants (24); 9 crocuses have not bloomed. l0 15.0000 (The number in R0 does not change.) Overflow and Underflow If an attempted storage or recall arithmetic operation would result in overflow in a data storage register, the value in the affected register will be replaced with ±9.999999999×1099 and the display will blink. To stop the blinking (clear the overflow condition), press −or =or |"9. In case of underflow, the value in the register will be replaced with zero (no display blinking). Overflow and underflow are discussed further on page 61. Problems 1. Calculate the value of x in the following equation. 8.33(4 5.2) [(8.33 7.46)0.32]

x − ÷ − = 4.3(3.15 2.75) (1.71)(2.01) − −

Answer: 4.5728. A possible keystroke solution is: 4 v5.2 -8.33*|K7.46 -0.32 *÷3.15

v 2.75 -4.3*1.71v2.01*- ÷¤

46 Section 3: The Memory Stack, LAST X, and Data Storage 2. Use arithmetic with constants to calculate the remaining balance of a $1000 loan after six payments of $100 each and an interest rate of 1% (0.01) per payment period. Procedure: Load the stack with (1 + i), where i = interest rate, and key in the initial loan balance. Use the following formula to find the new balance after each payment. New Balance = ((Old Balance)×(1 + i)) - Payment The first part of the key sequence would be: 1.01vvv1000 For each payment, execute: *100- Balance after six payments: $446.32. 3. Store 100 in R5. Then: 1. Divide the contents of R5 by 25. 2. Subtract 2 from the contents of R5. 3. Multiply the contents of R5 by 0.75. 4. Add 1.75 to the contents of R5. 5. Recall the contents of R5. Answer: 3.2500. Section 4 Statistics Functions A word about the statistics functions: their use is based on an understanding of memory stack operation (Section 3). You will find that order of entry is important for most statistics calculations. Probability Calculations The input for permutation and combination calculations is restricted to nonnegative integers. Enter the y-value before the x-value. These functions, like the arithmetic operators, cause the stack to drop as the result is placed in the X-register. Permutations. Pressing ´p calculates the number of possible different arrangements of y different items taken in quantities of x items at a time. No item occurs more than once in an arrangement, and different orders of the same x items in an arrangement are counted separately. The formula is y ! Py x− = ,y x ( )! Combinations. Pressing |ccalculates the number of possible sets of y different items taken in quantities of x items at a time. No item occurs more than once in a set, and different orders of the same x items in a set are not counted separately. The formula is

y !

Cy x− = ,x y x !( )! Examples: How many different arrangements are possible of five pictures which can be hung on the wall three at a time? Keystrokes Display 5v3 3 Five (y) pictures put up three (x) at a time. ´p 60.0000 Sixty different arrangement possible. 47 48 Section 4: Statistics Functions How many different four-card hands can be dealt from a deck of 52 cards? Keystrokes Display 52v4 4 Fifty-two (y) cards dealt four (x) at a time. |c 270,725.0000 Number of different hands possible. The maximum size of x or y is 9,999,999,999. Random Number Generator Pressing ´# (random number) will generate a random number (part of a uniformly distributed pseudo-random number sequence) in the range 0 ≤ r <1.* At initial power-up (including reset of Continuous Memory), the HP-15C random number generator will use zero as a ―seed‖ to initiate a random number sequence. Any time you generate a random number, that number becomes the seed for the next random number. You can initiate a different random number sequence by storing a new seed for the random number generator. (Repetition of a random number seed will produce repetition of the random number sequence.) O´#will store the X-register number (0 ≤ r < 1) as a new seed for the random number generator. (A value for r outside this range will be converted to fit within the range.) l´#will recall to the display the current random number seed. Keystrokes Display .5764 0.5764 Stores 0.5764 as random number seed.

O´ # 0.5764 (The ´keystroke may be omitted.)

´# 0.3422 Random number sequence initiated by the ´# 0.2809 above seed. − 0.0000 *Passes the spectral test (D. Knuth, The Art of Computer Programming. Vol. 2. Seminumerical Algorithms, Third Edition, 1998). Section 4: Statistics Functions 49 Keystrokes Display

l´ # 0.2809 Recall last random number generated, which is the new seed. (The ´may be omitted.)

Accumulating Statistics The HP-15C performs one- and two-variable statistical calculations. The data is first entered into the Y- and X-registers. Then the z function automatically calculates and stores statistics of the data in storage registers R2 through R7. These registers are therefore referred to as the statistics registers. Before beginning to accumulate statistics for a new set of data, press ´ CLEAR ∑ to clear the statistics registers and stack. (If you have reallocated registers in memory and any of the statistics registers no longer exist, Error 3 will be displayed when you try to use CLEAR ∑, z, or wAppendix C explains how to reallocate memory.) In one-variable statistical calculations, enter each data point (x-value) by keying in x and then press z. In two-variable statistical calculations, enter each data pair (the x- and y values) as follows: 1. Key y into the display first. 2. Press v. The displayed y-value is copied into the Y-register. 3. Key x into the display. 4. Press z. The current number of accumulated data points, n, will be displayed. The x-value is saved in the LAST X register and y remains in the Y-register. z disable stack lift, so the stack will not lift when the next number is keyed in. 50 Section 4: Statistics Functions In some cases involving x or y data values that differ by a relatively small amount, the calculator cannot compute s, r, linear regression, or ŷ, and will display Error 2. This will not happen, however, if you normalize the data by keying in only the difference between each value and the mean or approximate mean of the values. This difference must be added back to the calculations of x, ŷ, and the y-intercept (L). For example, if your x-values were 665999, 666000, and 666001, you should enter the data as -1, 0, and 1; then add 666000 back to the relevant results. The statistics of the data are compiled as follows: Register Contents R2 n Number of data points accumulated (n also appears in the X-register). R3 Σx Summation of x-values. R4 Σx 2Summation of squares of x-values. R5 Σy Summation of y-values. R6 Σy2Summation of squares of y-values. R7 Σxy Summation of products of x- and y-values. You can recall any of the accumulated statistics to the display (X-register) by pressing land the number of the data storage register containing the desired statistic. If you press l z, Σy and Σx will be copied simultaneously from R3 and R5 respectively, into the X-register and the Y register, respectively. (The sequence lzlifts the stack twice if stack lift is enabled, once if not, and then enables stack lift.) Example: Agronomist Silas Farmer has developed a new variety of high-yield rice, and has measured the plant's yield as a function of fertilization. Use the zfunction to accumulate the data below to find the values for Σx, Σx2 Σy, Σy2, and Σxy for nitrogen fertilizer application (x) versus grain yield (y). Section 4: Statistics Functions 51 XNITROGEN APPLIED 0.00 20.00 40.00 60.00 80.00 (kg per hectare *), x GRAIN YIELD Y (metric tons per 4.63 4.78 6.61 7.21 7.78 hectare), y *A hectare equals 2.47 acres. Keystrokes Display ´CLEAR∑ 0.0000 Clears statistical storage registers (R2 through R7 and the stack). ´•2 0.00 Limits display to two decimal places, like the data. 4.63 v 4.63 0 z 1.00 First data point. 4.78 v 4.78 20 z 2.00 Second data point. 6.61v 6.16 40 z 3.00 Third data point. 7.21 v 7.21 60 z 4.00 Fourth data point. 7.78 v 7.78 80 z 5.00 Fifth data point. l3 200.00 Sum of x-values, Σx (kg of nitrogen). l4 12.000.00 Sum of squares of x-values, Σx2. l5 31.01 Sum of y-values, Σy (grain yield). l6 200.49 Sum of squares of y-values, Σy2. l7 1,415.00 Sum of products of x- and y-values, Σxy. 52 Section 4: Statistics Functions Correcting Accumulated Statistics If you discover that you have entered data incorrectly, the accumulated statistics can be easily corrected. Even if only one value of an (x, y) data pair is incorrect, you must delete and re-enter both values. 1. Key the incorrect data pair into the Y- and X-register. 2. Press|wto delete the incorrect data. 3. Key in the correct values for x and y. 4. Press z. Alternatively, if the incorrect data point or pair is the most recent one entered and z has been pressed, you can press |K |w to remove the incorrect data.* Example: After keying in the preceding data. Farmer realizes he misread a smeared figure in his lab book. The second y-value should have been 5.78 instead of 4.78. Correct the data input. Keystrokes Display

4.78 v 4.78 Keys in the data pair we want to replace and deletes the accompanying statistics.

20|w 4.00 The n-value drops to four.

5.78 v 5.78 Keys in and accumulates the replacement data pair.

20 z 5.00 The n -value is back to five. We will use these statistics in the rest of the examples in this section. * Note that these methods of data deletion will not delete any rounding errors that may have been generated in the statistics registers. This difference will not be serious unless the erroneous pair has a magnitude that is enormous compared with the correct pair, in such a case, it would be wise to start over! Section 4: Statistics Functions 53 Mean The ’ function computes the arithmetic mean (average) of the x-and y values using the formulas shown in appendix A and the statistics accumulated in the relevant registers. When you press |’the contents of the stack lift (two registers if stack lift is enabled, one if not); the mean of x ( x) is copied into the X-register as the mean of y ( y) is copied simultaneously into the Y-register. Press ®to view y. Example: From the corrected statistics data we have already entered and accumulated, calculate the average fertilizer application, x. and average grain yield y, for the entire range. Keystrokes Display |’ 40.00 Average kg of nitrogen, x, for all cases. ® 6.40 Average tons of rice, y, for all cases. Standard Deviation Pressing |S computes the standard deviation of the accumulated statistics data. The formulas used to compute sx, the standard deviation of the accumulated x-values, and sy, the standard deviation of the accumulated y-values, are given in appendix A. This function gives an estimate of the population standard deviation from the sample data, and is therefore termed the sample standard deviation.* When you press|S, the contents of the stack registers are lifted (twice if stack lift is enabled, once if not); sxis placed into the X-register and syis placed into the Y-register. Press ®to view sy. * When your data constitutes not just a sample of a population but all of the population, the standard deviation of the data is the true population standard deviation (denoted σ). The formula for the true population standard deviation differs by a factor of (n −1)/ nfrom the formula used for the S function. The difference between the values is small for large n, and for most applications can be ignored. But if you want to calculate the exact value of the population standard deviation for an entire population, you can easily do so: simply add, using z, the mean ( x) of the data to the data before pressing |S. The result will be the population standard deviation. (If you subsequently correct any of your accumulated data values, remember to delete the first mean value and add the corrected one.) 54 Section 4: Statistics Functions Example: Calculate the standard deviation about the mean calculated above. Keystrokes Display |S 31.62 Standard deviation about the mean nitrogen application, x. ® 1.24 Standard deviation about the mean grain yield, y. Linear Regression Linear regression is a statistical method for finding a straight line that best fits a set of two or more data pairs, thus providing a relationship between two or more data pairs, thus providing a relationship between two variables. By the method of least squares, ´L will calculate the slope, A, and y intercept, B, of the linear equation: y=Ax+B 1. Accumulate the statistics of your data using the zkey. 2. Press ´L. The y-intercept, B, appears in the display (X register). The slope, A, is copied simultaneously into the Y register. 3. Press ®to view A. (As is the case with the functions ’ and S, L causes the stack to lift two registers if it's enabled, one if not). T t y y Z z x y Y y A slope B y-intercept X x B y-intercept A slope Keys: ´L ® The slope and y-intercept of the least squares line of the accumulated data are calculated using the equations shown in appendix A. Section 4: Statistics Functions 55 Example: Find the y-intercept and slope of the linear approximation of the data and compare to the plotted data on the graph below. Keystrokes Display ´L 4.86 y-intercept of the line. ® 0.04 Slope of the line. Linear Estimation and Correlation Coefficient When you press ´j the linear estimate, ŷ, is placed in the X-register and the correlation coefficient, r, is placed in the Y-register. To display r, press®. 56 Section 4: Statistics Functions Linear Estimation. With the statistics accumulated, an estimated value for y, denoted ŷ, can be calculated by keying in a proposed value for x and pressing´j. An Estimated value for x (denotedxˆ) can be calculated as follows: 1. Press´L. 2. Key in the known y-value. 3. Press®-®÷. Correlation Coefficient. Both linear regression and linear estimation presume that the relationship between the x and y data values can be approximated by a linear function. The correlation coefficient, r, is a determination of how closely your data fit a straight line. The range is -1 ≤ r ≤ 1, with -1 representing a perfectly negative correlation and +1 representing a perfectly positive correlation. Note that if you do not key in a value for x before executing ´j, the number previously in the X-register will be used (usually yielding a meaningless value for ŷ). Example: What if 70 kg of nitrogen fertilizer were applied to the rice field? Predict the grain yield based on Farmer’s accumulated statistics. Because the correlation coefficient is automatically included in the calculation, you can view how closely the data fit a straight line by pressing ®after the y prediction appears in the display. Section 4: Statistics Functions 57 Keystrokes Display 70´j 7.56 Predicted grain yield in tons/hectare. ® 0.99 The original data closely approximates a straight line. Other Applications Interpolation. Linear interpolation of tabular values, such as in thermodynamics and statistics tables, can be carried out very simply on the HP-15C by using the j function. This is because linear interpolation is linear estimation: two consecutive tabular values are assumed to form two points on a line, and the unknown intermediate value is assumed to fall on that same line. Vector Arithmetic. The statistical accumulation functions can be used to perform vector addition and subtraction. Polar vector coordinates must be converted to rectangular coordinates upon entry (θ,v, r ;,z). The results are recalled from R3 (Σx) and R5 (Σy) (using lz) and converted back to polar coordinates, if necessary. Remember that for polar coordinates the angle is between -180° and 180° (or -π and π radians, or - 200 and 200 grads). To convert to a positive angle, add 360 (or 2π or 400) to the angle. For the second vector entered, the final keystroke will be either z or w, depending on whether the two vectors should be added or subtracted. Section 5 The Display and Continuous Memory Display Control The HP-15C has three display formats –•, i, and ^ – that use a given number (0 through 9) to specify display format. The illustration below shows how the number 123,456 would be displayed specified to four places in each possible mode. ´•4 : 123,456.0000 ´i4 : 1.2346 05 ´^4 : 123.46 03 Owing to Continuous Memory, any change you make in the display format will be preserved until Continuous Memory is reset. The current display format takes effect when digit entry is terminated; until then, all digits you key in (up to 10) are displayed. Fixed Decimal Display •(fixed decimal) format displays a figure with the number of decimal places you specify (up to nine, depending on the size of the integer portion.) Exponents will be displayed if the number is too small or too large for the display. At ―power-up,‖ the HP-15C is in •4 format. The key sequence is´•n. Keystrokes Display 123.4567895 123.4567895 ´•4 123.4568 ´•6 123.456790 Display is rounded to six decimal places. (Ten places are stored internally.) ´•4 123.4568 Usual •4 display. 58 Section 5: The Display and Continuous Memory 59 Scientific Notation Display i (scientific) format displays a number in scientific notation. The sequence ´in specifies the number of decimal places to be shown. Up to six decimal places can be shown since the exponent display takes three spaces. The display will be rounded to the specified number of decimal places; however, if you specify more decimal places than the six places the display can hold (that is, i7, 8, or 9), rounding will occur in the undisplayed seventh, eighth, or ninth decimal place.* With the previous number still in the display: Keystrokes Display ´i6 1.234568 02 Rounds to and shows six decimal places. ´i8 1.234567 02 Rounds to eight decimal places, but displays only six. Engineering Notation Display ^(engineering) format displays numbers in an engineering notation format in a manner similar to i, except: In engineering notation, the first significant digit is always present in the display. The number you key in after ´^ specifies the number of additional digits to which you want to round the display. Engineering notation shows all exponents in multiples of three. Keystrokes Display .012345 0.012345

´^ 1 12. -03 Rounds to the first digit after the leading digit.

´^3 12.35 -03 10* 123.5 -03 Decimal shifts to maintain multiple of three in exponent. ´•4 0.1235 Usual •4 format. * Therefore, the display shows no distinction among i. 7, 8, and 9 unless the number rounded up is a 9, which carries a 1 over into the next higher decimal place. 60 Section 5: The Display and Continuous Memory Mantissa Display Regardless of the display format, the HP-15C always internally holds each number as a 10-digit mantissa and a two-digit exponent of 10. For example, π is always represented internally as 3.141592654×1000, regardless of what is in the display. When you want to view the full 10-digit mantissa of a number in the X register, press ´ CLEARu. To keep the mantissa in the display, hold the ukey down. Keystrokes Display |$ 3.1416

´ CLEAR

u (hold) 3141592654

Round-Off Error As mentioned earlier, the HP-15C holds every value to 10 digits internally. It also rounds the final result of every calculation to the 10th digit. Because the calculator can provide only a finite approximation for numbers such as π or 2/3 (0.666…), a small error due to rounding can occur. This error can be increased in lengthy calculations, but usually is insignificant. To accurately assess this effect for a given calculation requires numerical analysis beyond our scope and space here! Refer to the HP-15C Advanced Functions Handbook for a more detailed discussion. Special Displays Annunciators The HP-15C display contains eight annunciators that indicate the status of the calculator for various operations. The meaning and use of these annunciators is discussed on the following pages: * Low-power indication, page 62. USER User mode, pages 79 and 144. f and g Prefixes for alternate functions, pages 18-19. RAD and GRAD Trigonometric modes, page 26. C Complex mode, page 121. PRGM Program mode, page 66. Section 5: The Display and Continuous Memory 61 Digit Separators The HP-15C is set at power-up so that it separates integral and fractional portions of a number with a period (a decimal point), and separates groups of three digits in the integer portion with a comma. You can reverse this setting to conform to the numerical convention used in many countries. To do so, turn off the calculator. Press and hold =, press and hold ., release =, then release . (= / .). (Repeating this sequence will set the calculator to the previous display convention.) Keystrokes Display 12345.67 12,345.67 =/ . 12.345.6700 =/ . 12,345.6700 Error Display If you attempt an improper operation—such as division by zero—an error message (Error followed by a digit) will appear in the display. For a complete listing of error messages and their causes, refer to appendix A. To clear the Error display and restore the calculator to its prior condition, press any key. You can then resume normal operation. Overflow and Underflow Overflow. When the result of a calculation in any register is a number with a magnitude greater than 9.999999999×1099, ± 9.999999999×1099 is placed in the affected register and the overflow flag, flag 9, is set.*Flag 9 causes the display to blink. When overflow occurs in a running program, execution continues until completion of the program, and then the display blinks. The blinking can be stopped and flag 9 cleared by pressing −, = or |"9. Underflow. If the result of a calculation in any register is a number with a magnitude less than 1.000000000×10-99, that number will be replaced by zero. Underflow does not have any other effect. * Recall that display does not include the last three digits of the mantissa. 62 Section 5: The Display and Continuous Memory Low-Power Indication

When a flashing asterisk, which indicates low battery power, appears in the lower left-hand side of the display, there is no reason to panic. You still have plenty of calculator time remaining: at least 10 minutes if you continuously run programs, and at least an hour if you do calculations manually. Refer to appendix F (page 259) for information on replacing the batteries. Continuous Memory Status 0.0000 *

The Continuous Memory feature of the HP-15C retains the following in the calculator, even when the display is turned off: ∙ All numeric data stored in the calculator. ∙ All programs stored in the calculator. ∙ Position of the calculator in program memory. ∙ Display mode and setting. ∙ Trigonometric mode (Degrees, Radians, or Grads). ∙ Any pending subroutine returns. ∙ Flag settings (except flag 9, which clears when the display is manually turned off). ∙ User mode setting. ∙ Complex mode setting. When the HP-15C is turned on, it always ―wakes up‖ in Run mode. If the calculator is turned off, Continuous Memory will be preserved for a short period while the batteries are removed. Data and programs are preserved longer than other aspects of calculator status. Refer to appendix F for instructions on changing batteries. Section 5: The Display and Continuous Memory 63 Resetting Continuous Memory If at any time you want to reset (entirely clear) the HP-15C Continuous Memory: 1. Turn the calculator off. 2. Press and hold the =key, then press and hold the - key. 3. Release the =key, then the -key. (This convention is represented as =/ -.) When Continuous Memory is reset, Pr Error (power error) will be displayed. Press any key to clear the display. Note: Continuous Memory can inadvertently be interrupted and reset if the calculator is dropped or otherwise traumatized. Part ll HP-15C Programming Section 6 Programming Basics The next five sections are dedicated to explaining aspects of programming the HP-15C. Each of these programming sections will first discuss basic techniques (The Mechanics), then give examples for the implementation of these techniques (Examples), and lastly discuss finer points of operation in greater detail (Further Information). Read only as far as you need to support your use of the HP-15C. The Mechanics Creating a Program Programming the HP-15C is an easy matter, based simply on recording the keystroke sequence used when calculating manually. (This is called ―keystroke programming‖.) To create a program out of a series of calculation steps requires two extra manipulations: deciding where and how to enter your data; and loading and storing the program. In addition, programs can be instructed to make decisions and perform iterations through conditional and unconditional branching. As we step through the fundamentals of programming, we'll rework the falling object program illustrated in the Problem Solver (page 14). Loading a Program Program Mode. Press | ¥(program/run) to set the calculator to Program mode (PRGM annunciator on). Functions are stored and not executed when keys are pressed in Program mode. Keystrokes Display |¥ 000- Switches to Program mode; PRGM annunciator and line number (000) displayed. 66 Section 6: Programming Basics 67 Location in Program Memory. Program memory – and therefore the calculator's position in program memory – is demarcated by line numbers. Line 000 marks the beginning of program memory and cannot be used to store an instruction. The first line that contains an instruction is line 001. Program lines other than 000 do not exist until instructions are written for them. You can start a program at any existent line (designated nnn), but it is simplest and safest to start an independent program (as opposed to a subroutine) at the beginning of program memory. As you write, any existing program lines will be preserved and ―bumped‖ down in program memory. Press t “ 000 (in Program or Run mode) to move to line 000

without recording the tstatement. In Run mode, ´CLEARM

will also reset the calculator to line 000 - without clearing program memory.

Alternatively, you can clear program memory, which will erase all programs in memory and position you to line 000. To do so, press ´ CLEARMin Program mode. Program Begin. A label instruction – ´b followed by a letter (Athrough E) or number (0 through 9 or .0 through .9) – is used to define the beginning of a program or routine. The use of labels allows you to quickly select and run one particular program or routine out of several. Keystrokes Display

´ CLEAR 000- Clears program memory and M ´bA 001-42,21,11 sets to line 000 (start of program memory).

Recording a Program. Any key pressed—operator or constant—will be recorded in memory as a programmed instruction.* * Except the nonprogrammable functions, which are listed on page 80. 68 Section 6: Programming Basics Keystrokes Display 2 002- 2 * 003- 20 9 004- 9 Given h in the X-register, . 005- 48 lines 002 to 008 calculate

8 006- 8 2h

÷ 007- 10 .

¤ 008- 11 9.8

Program End. There are three possible endings for a program: ∙ |n(return) will end a program, return to line 000, and halt. ∙ ¦will stop a program without moving to line 000. ∙ The end of program memory contains an automatic n. Keystrokes Display |n 009- 43 32 Optional if this is the last program in memory. Intermediate Program Stops Use ´ ©(pause) as a program instruction to momentarily stop a program and display an intermediate result. (Use more than one ©for a longer pause.) Use a ¦ (run/stop) instruction to stop the program indefinitely. The program will remain positioned at that line. You can resume program execution (from that line) by pressing ¦during Run mode, that is, from the keyboard. Running a Program Run Mode. Switch back to Run mode when you are done programming: |¥. Program execution must take place in Run mode. Section 6: Programming Basics 69 Keystrokes Display |¥ Run mode; no PRGM annunciator displayed. (The display will depend on any previous result.) The position in program memory does not change when modes are switched. Should the calculator be shut off, it always ―wakes up‖ in Run mode. Executing a Program. In Run mode, press ´ letter label or Gdigit (or letter) label. This addresses a program and starts its execution. The display will flash running. Keystrokes Display 300.51 300.51 Key a value for h into the X-register. ´A 7.8313 The result of executing program ―A‖. (The number of seconds it takes an object dropped from 300.51 meters high to hit the ground.) Restarting a Program. Press ¦ to continue execution of a program that was stopped with a ¦instruction. User Mode. User mode is an optional condition to save keystrokes when executing letter-named programs. Pressing ´Uwill interchange the ´-shifted and primary functions of the Athrough E keys. You can

then execute a program using just one keystroke (skipping the ´ or

G ).

How to Enter Data Every program must take into account how and when data will be supplied. This can be done in Run mode before running the program or during an interruption in the program. 1. Prior entry. If a variable value will be used in the first line of the program, enter it into the X-register before starting the program. If it will be used later, you can store it (with O) into a storage register, and recall it (with a programmed l) within the program. 70 Section 6: Programming Basics This is the method used above, where h was placed in the X-register before running the program. No vinstruction is necessary because program execution (here: ´A) both terminates digit entry and enables the stack lift. The above program then multiplied the contents of the X-register (h) by 2. The presence of the stack even makes it possible to load more than one variable prior to running a program. Keeping in mind how the stack moves with subsequent calculations and how the stack can be manipulated (as with ®), it is possible to write a program to use variables which have been keyed into the X-, Y-, Z-, and T-registers.

2. Direct entry . Enter the data as needed as the program runs. Write a ¦ (run/stop) instruction into the program where needed so the

program will stop execution. Enter your data, then press ¦ to restart the program. Do not key variable data into the program itself. Any values that will vary should be entered anew with each program execution. Program Memory At power-up (Continuous Memory reset), the HP-15C offers 322 bytes of program memory and 21 storage registers. Most program steps (instructions) use one byte, but some use two. The distribution of memory capacity can be altered, as explained in appendix C. The maximum attainable program memory is 448 bytes (with the permanent storage registers—RI, R0, and R1 — remaining); maximum number of storage registers is 67 (with no program memory). Example. Mother's Kitchen, a canning company, wants to package a ready-to eat spaghetti mix containing three different cylindrical cans: one of spaghetti sauce, one of grated cheese, and one of meatballs. Mother's needs to calculate the base areas, total surface areas, and volumes of the three different cans. It would also like to know, per package, the total base area, surface area, and volume. Section 6: Programming Basics 71 The program to calculate this information uses these formulas and data: base area = πr2. volume = base area × height = πr2h. surface area = 2 base areas + side area = 2πr2+ 2πrh. Radius, r Height, h Base Area Volume Surface Area 2.5cm 8.0 cm ? ? ? 4.0 10.5 ? ? ? 4.5 4.0 ? ? ? TOTALS ? ? ? Method: 1. Enter an r value into the calculator and save it for other calculations. Calculate the base area (πr2), store it for later use, and add the base area to a register which will hold the sum of all base areas. 2. Enter h and calculate the volume (πr2h). Add it to a register to hold the sum of all volumes. 3. Recall r. Divide the volume by r and multiply by 2 to yield the side area. Recall the base area, multiply by 2, and add to the side area to yield the surface areas. Sum the surface areas in a register. Do not enter the actual data while writing the program – just provide for their entry. These values will vary and so will be entered before and/or during each program run. Key in the following program to solve the above problem. The display shows line numbers and keycodes (the row and column location of a key), which will be explained under Further Information. Keystrokes Display |¥ 000- Sets calculator to Program mode (PRGM displayed). ´CLEAR M 000- Clears program memory. Starts at line 000. 72 Section 6: Programming Basics Keystrokes Display ´bA 001-42,21,11 Assigns this program the label ―A‖. O0 002- 44 0 Stores the contents of X-register into R0. r must be in the X register before running the program. |x 003- 43 11 Squares the contents of the X register (which will be r). |$ 004- 43 26 * 005- 20 πr2, the BASE AREA of a can. O4 006- 44 4 Stores the BASE AREA in R4. O+1 007-44,40, 1 Keeps a sum of all BASE AREAS in R1. ¦ 008- 31 Stops to display BASE AREA and allow entry of the h value. * 009- 20 Multiplies h by the BASE AREA, giving VOLUME. ´© 010- 42 31 Pauses briefly to display VOLUME. O+2 011-44,40, 2 Keeps a sum of all can VOLUMES in R2. l0 012- 45 0 Recalls r. ÷ 013- 10 Divides VOLUME by r. 2 014- 2 * 015- 20 2 πrh, the SIDE AREA of a can. l4 016- 45 4 Recalls the BASE AREA of the can. 2 017- 2 Multiplies base area by two (for * 018- 20 top and bottom). Section 6: Programming Basics 73 Keystrokes Display + 019– 40 SIDE AREA + BASE AREA = SURFACE AREA. O+3 020–44,40, 3 Keeps a sum of all SURFACE AREAS in R3. |n 021– 43 32 Ends the program and returns program memory to line 000. Now, let's run the program: Keystrokes Display |¥ Sets calculator to Run mode. (PRGM cleared.) ´CLEARQ Clears all storage registers. The display does not change. 2.5 2.5 Enter r of the first can.

´A (or: GA) 19.6350 Starts program A. BASE AREA of first can. (running flashes during execution.)

8 8 Enter h of first can. Then restart program. ¦ 157.0796 VOLUME of first can. 164.9336 SURFACE AREA of first can. 4 4 Enter r of the second can. ¦ 50.2655 BASE AREA of second can. 10.5 10.5 Enter h of second can. ¦ 527.7876 VOLUME of second can. 364.4247 SURFACE AREA of second can. 4.5 4.5 Enter r of the third can. ¦ 63.6173 BASE AREA of third can. 74 Section 6: Programming Basics Keystrokes Display 4 4 Enter h of third can. ¦ 254.4690 VOLUME of third can. 240.3318 SURFACE AREA of third can. l1 133.5177 Sum of BASE AREAS. l2 939.3362 Sum of VOLUMES. l3 769.6902 Sum of SURFACE AREAS. The preceding program illustrates the basic techniques of programming. It also shows how data can be manipulated in Program and Run modes by

entering, storing, and recalling data (input and output) using v,

O , l, storage register arithmetic, and programmed stops.

Further Information Program Instructions Each digit, decimal point, and function key is considered an instruction and is stored in one line of program memory. An instruction may include prefixes (such as ´, O, tand b) and still occupy only one line. Most instructions require one byte of program memory; however, some require two. For a complete list of two-byte instructions, refer to Appendix C. Instruction Coding Each key on the HP-15C keyboard – except for the digit keys 0 through 9 – is identified in Program mode by a two-digit ―keycode‖ that corresponds to the key's position on the keyboard. Instruction Code O+1 006-44,40, 1 Sixth program line. ´eV XXX-42, 5,25 eis just ―5‖. The first digit of a keycode refers to the row (1 to 4 from top to bottom), and the second digit refers to the column (1, 2, 9, 0 from left to right). Exception: the keycode for a digit key is simply that digit. Section 6: Programming Basics 75 Keycode 25: second row, fifth key. Memory Configuration Understanding memory configuration is not essential to your use of the HP-15C. It is essential, however, for obtaining maximum efficiency in memory and programming use. The more you program, the more useful this knowledge will be. Memory configuration and allocation is thoroughly explained in appendix C, Memory Allocation. Should you ever get an Error 10, you have run up against limitations of the HP-15C memory. If you learn how to reallocate memory, you can greatly increase your ability to store information in the HP-15C. The HP-15C memory consists of 67 registers (R0 to R65 and the Index register) divided between data storage and programming/advanced function capability. The initial configuration is: ∙ 46 registers for both programming and the advanced functions (_, f, the imaginary stack, and >functions). At seven bytes of memory per register, this is worth 322 program bytes if no memory is dedicated to advanced functions. ∙ 21 registers for data storage (R0 to R9, R.0 to R.9, and the Index register). 76 Section 6: Programming Basics Initial Memory Configuration Memory is reallocated by telling the calculator which data storage register shall be the highest data register; all other registers are left for programming and advanced functions. Keystrokes Display 60 ´m%* 60.0000 R60 and below allocated to data storage; five (R61 to R65) remain for programming. * The optional omission of the ´keystroke after another prefix key is explained on page 78, Abbreviated Key Sequences. Section 6: Programming Basics 77 Keystrokes Display 1´m% 1.0000 R1 and R0 allocated for data storage; R2 to R65 available for programming and advanced functions. 19´m% 19.0000 Original allocation: R19 (R.9) and below for data storage; R20, to R65 for programming and advanced functions.* lm% 19.0000 Displays the current highest data register. The mand W(memory status) functions are described in detail in appendix C. Keep in mind that an error message will result (given the above memory configuration) if 1. You try to address a register higher than R19 (R.9), which initially is the highest register allocated to data storage (Error 3). 2. You have 322 occupied program bytes and try to load more program lines (Error 4). 3. You try to run an advanced function with insufficient available memory (Error 10). Program Boundaries End. Not every program needs to end with a nor ¦instruction. If

you are at the end of occupied program memory, there is an automatic n instruction, so you do not need to enter one. This can save you one

line of memory. On the other hand, a program can ―end‖ by simply transferring execution to another routine using t(section 7). Labels. Labels in a program (or subroutine) are markers telling the calculator where to begin execution. Following an ´label or Glabel instruction, the calculator will search downward in program memory for the *For memory allocation and indirect addressing, registers R.0 through R.9 are referred to as R10 through R19. 78 Section 6: Programming Basics corresponding label. If need be, the search will wrap around at the end of program memory and continue at line 000. When it encounters an appropriate label, the search stops and execution begins. If a label is encountered as part of a running program, it has no effect, that is, execution simply continues. Therefore, you can label a subordinate routine within a program (more on subroutines in section 9). Since the calculator searches in only one direction from its present position, it is possible (though not advisable) to use duplicate program labels. Execution will begin at the first appropriately labeled line encountered. 000-

If an ´ A entry starts the search for ―A‖ here, it then proceeds downward through memory, wraps around to line 000, and stops at label ―A‖. Execution then starts and continues (ignoring any other labels) until a halt instruction. Unexpected Program Stops ´bA ´b3 ¦ end of memory (stop)

Pressing Any Key. Pressing any key will halt program execution. It will not halt in the middle of an operation. This instruction will be completed before the program stops. Error Stops. Program execution is immediately halted when the calculator attempts an improper operation that results in an Error display. To see the line number and keycode of the error-causing instruction (the line at which the program stopped), press any one key to remove the Error message, then switch to Program mode. If the display is flashing when a program stops, an overflow condition exists (page 61). Press −=, or |"9 to stop the blinking. Abbreviated Key Sequences In certain cases, an ´ prefix you might expect to include in a key sequence is not needed. The rule for using an abbreviated key sequence is: the ´ prefix key is unnecessary after any other prefix key. (Page 19 contains a list of prefix keys.) Section 6: Programming Basics 79 For example, ´b´A becomes ´bA, ´m´% becomes ´m%, and O´# becomes O#. The removal of the ´is not ambiguous because the ´-shifted function is the only logical one in these cases. The keycodes for such instructions do not include the extraneous ´even if you do key it in. User Mode User mode is a convenience to save keystrokes when addressing (calling up) programs for execution. Pressing ´Uwill exchange the primary functions and ´-shifted functions of the A through E keys only. In User mode (USER annunciator displayed):

´shift Primary A B C D E ¤ ' @ y ∕

|shift x2LN LOG % Δ% Press |Uagain to deactivate User mode. Polynomial Expressions and Horner's Method Some expressions, such as polynomials, use the same variable several times for their solution. For example, the expression f(x) = Ax4 + Bx3 + Cx2 + Dx + E uses the variable x four different times. A program to solve such an equation could repeatedly recall a stored copy of x from a storage register. A shorter programming method, however, would be to use a stack which has been filled with the constant (refer to Loading the Stack with a Constant, page 41). Horner's Method is a useful means of rearranging polynomial expressions to c ut calculation steps and calculation time. It is especially expedient in

_ and f, two rather long-running functions that use subroutines.

This method involves rewriting a polynomial expression in a nested fashion to eliminate exponents greater than 1: Ax4+ Bx3 + Cx2+ Dx + E (Ax3+ Bx2 + Cx + D)x + E ((Ax2 + Bx + C)x + D)x + E (((Ax + B)x + C)x + D)x + E 80 Section 6: Programming Basics Example: Write a program for 5x4 + 2x3as (((5x + 2)x)x)x, then evaluate for x = 7 Keystrokes Display |¥ 000- Assumes position in memory is line 000. If it is not, clear program memory. ´bB 001-42,21,12 5 002- 5 * 003- 20 5x. 2 004- 2 + 005- 40 5x + 2. * 006- 20 (5x + 2)x. * 007- 20 (5x + 2)x2. * 008- 20 (5x + 2)x3. |n 009- 43 32 |¥ Returns to Run mode, Prior result remains in display. 7 vv 7.0000 Loads the stack (X-, Y-, Z-,

v ´B 12,691.0000 Nonprogrammable Functions and T-registers) with 7.

When the calculator is in Program mode, almost every function on the keyboard can be recorded as an instruction in program memory. The following functions cannot be stored as instructions in program memory.

´ CLEAR u | ‚ ´ CLEAR M |W −

´% |¥ =/. ´U t“nnn =/-

FREE ENGLISH PDF

OPERATING INSTRUCTIONS

USER GUIDE - USER MANUAL

OWNER GUIDE - OWNER MANUAL

REFERENCE GUIDE - REFERENCE MANUAL

INSTRUCTION GUIDE - INSTRUCTION MANUAL