HP 15c Scientific manual System Flags Flags 8

Page 99

Section 8: Program Branching and Controls

99

In this way, a program can accommodate two different modes of input, such as degrees and radians, and make the correct calculation for the mode chosen. You set a flag if a conversion needs to be made, for instance, and clear it if no conversion is needed.

Suppose you had an equation requiring temperature input in degrees Kelvin, although sometimes your data might be in degrees Celsius. You could use a program with a flag to allow either a Kelvin or Celsius input. In part, such a program might include:

´bC Start program at ―C‖ for degrees Celsius.

"7Flag 7 cleared (=false).

t1

´Start program at ―D‖ for degrees Kelvin.

F7

Flag 7 set (=true).

´b1

(Assuming temperature in X-register.)

?7

Checks for flag 7 (checks for Celsius or Kelvin

 

input).

t2

If set (Kelvin input), goes to a later routine, skipping

 

the next few instructions.

2

If cleared (Celsius input), adds 273 to the

7

value in the X-register, since °K = °C + 273.

3

 

+

 

´b2

Calculation continues for both modes.

 

The System Flags: Flags 8 and 9

Flag 8. Setting flag 8 will activate Complex mode (described in section 11), turning on the C annunciator. If another method is used to activate Complex mode, flag 8 will automatically be set. Complex mode is deactivated only by clearing flag 8; flag 8 is cleared in the same manner as the other flags.

Image 99
Contents HP Part Number 00015-90001 Edition 2.4, Sep HP-15C Owner’s HandbookLegal Notice Introduction Contents Display and Continuous Memory ContentsProgram Branching and Controls Program EditingSubroutines Indirect Display Control Calculating With Complex NumbersCalculating With Matrices Numerical Integration Appendix E a Detailed Look at f Contents Appendix a Error ConditionsAppendix C Memory Allocation Appendix D a Detailed Look atSubject Index Contents Appendix F BatteriesFunction Summary and Index Programming Summary and IndexQuick Look at HP-15C Problem SolverTo Compute Keystrokes Display Manual SolutionsKeystrokes Display Programmed Solutions300.51 KeystrokesDisplay001-42,21,11 002 003 004 005 006 007 008 009 8313HP-15C a Problem Solver Part l HP-15C Fundamentals Section Power On and OffGetting Started Keyboard OperationI O m ´ P I l F T s ? t H b Prefix KeysChanging Signs Keying in ExponentsClear Keys Display Clearing ` and − Digit entry not terminatedClears only the last digit 6532 CalculationsOne-Number Functions Two-Number Functions78.0000 17 +26.0000 22.0000 5000 13.0000Number Alteration Functions Numeric FunctionsGeneral Functions One-Number FunctionsTrigonometric Operations Time and Angle ConversionsPressing Calculates 40.5000 Degrees/Radians Conversions7069 RadiansHyperbolic Functions Logarithmic FunctionsTo Calculate Keystrokes Display Power FunctionTwo-Number Functions PercentagesPolar Conversion. Pressing Polar and Rectangular Coordinate ConversionsEnters the base number the price Calculates 3% of $15.76 the taxKeystrokes Display Always displayed Automatic Memory Stack Last X, and Data StorageAutomatic Memory Stack Stack Manipulation Automatic Memory Stack RegistersStack Manipulation Functions Memory Stack, Last X, and Data StorageLost Lost 12.9000 Last X Register and K287.0000 22.2481Calculator Functions and the Stack 13.9 +20.6475 +15 X15 Order of Entry and the v Key69.0000 Nested Calculations7 + 65.0000Arithmetic Calculations With Constants 5 ‛15 Keys Keystrokes Display Growth factor 1000000 520.8750 Storage Register OperationsStoring and Recalling Numbers 322.5000Storage and Recall Arithmetic Clearing Data Storage RegistersFor recall arithmetic For storage arithmetic15.0000 ProblemsOverflow and Underflow 24 l-0Memory Stack, Last X, and Data Storage Statistics Functions Probability Calculations60.0000 3422 Random Number Generator270,725.0000 5764Registers Accumulating StatisticsRegister Contents Σy2 20.00 40.00 60.00 80.00 Kg per hectareMetric tons per Hectare, y 20 z 61v 40 z 7.21 60 z 7.78 80 z l20 w 20 z Correcting Accumulated StatisticsMean Standard Deviation40.00 Application Linear Regression31.62 Standard deviation about the mean nitrogenLinear Estimation and Correlation Coefficient Statistics Functions 70 ´j Other ApplicationsDisplay Continuous Memory Display ControlFixed Decimal Display 234567 Scientific Notation DisplayEngineering Notation Display 234568Annunciators Round-Off ErrorSpecial Displays Mantissa Display12.345.6700 Error DisplayDigit Separators 12,345.67Low-Power Indication Continuous MemoryStatus Resetting Continuous Memory Page Part ll HP-15C Programming Loading a Program Programming BasicsMechanics Creating a Program´b a Programming BasicsIntermediate Program Stops Running a Program002 003 004 005 006 007 008 300.51 300.51 ´A How to Enter DataProgram Memory Totals Radius, r Height, h Base Area Volume Surface Area010 002004 005 007-44,40Or G a Further Information Program InstructionsInstruction Coding Keycode 25 second row, fifth key Memory Configuration60 ´ m% Initial Memory Configuration19.0000 Program Boundaries´ m % 19 ´ m%Unexpected Program Stops Abbreviated Key Sequences´bA ´b3 End of memory LOG % User ModePolynomial Expressions and Horners Method ¤ @ y ∕12,691.0000 Nonprogrammable Functions001-42,21,12 002 003 004 005 006 007 008 009 0000Problems Moving to a Line in Program Memory Program EditingExamples Deleting Program LinesInserting Program Lines Or use  Single-Step Operations Result Line PositionÂhold ReleaseInitializing Calculator Status Insertions and DeletionsInterest + i nPV 1 + i n ´bA D ´4 O0 2* O1 2÷ * ´ ´ l0 l1 ´r * n 100 270Branching Program Branching ControlsTest Conditional Tests n will clear flag number n FlagsExample Branching and Looping 016-44,40 010-45,20013-43,30 014Formula is Example Flags006-42,21 002-43004-42,21,15 005-43, 410,698.3049 Go to250.0000 48.0000Conditional Branching LoopingSystem Flags Flags 8 Program Branching and Controls ´b.1 SubroutinesGo To Subroutine and Return Subroutine ExecutionSubroutine Limits 004 000 001- ´b9002- R 003- O0´b.5 ´ b.4Nested Subroutines Subroutine ReturnIndex Register Loop Control V and % Keys106 Index Register and Loop Control Indirect Program Control With the Index RegisterProgram Loop Control Index Register Storage and RecallIndex Register Arithmetic Exchanging the X-RegisterIndirect Branching With Indirect Flag Control With Indirect Display Format Control WithLoop Control With Counters I and e Start count at zero Count by twos Count up to Nnnnn x x x y y 5 0 012.3456 Examples Register OperationsIterations Storing and Recalling Keystrokes DisplayExample Loop Control with e Exchanging the X-RegisterStorage Register Arithmetic 013- 22 Loop control number in R2−− 011- 42 012-42, 5Example Display Format Control 15 O64.8420 0000 50.0000 Index Register Contents Indirect Display Control Index Register and Loop Control 118 Part lll HP-15C Advanced Functions 120 Complex Stack and Complex ModeCalculating With Complex Numbers Creating the Complex StackDeactivating Complex Mode Complex Numbers and the StackEntering Complex Numbers ´ % hold 8.0000 release Z 8 Y 7 X Keys Manipulating the Real and Imaginary Stacks Stack Lift in Complex ModeOr other operation Clearing a Complex Number− 4 v Continue with any operation Continue with any operationEntering Complex Numbers with −. The clearing functions − ´ %hold release0000 17.0000 144.0000 Followed by another number Entering a Real Number´ Continue with any operation Entering a Pure Imaginary NumberL 2 ´ Operations With Complex NumbersStoring and Recalling Complex Numbers ´ O+ * ÷ y ¤x N o ∕ @ a0491 20007000 0428´ % hold Release1.5708 Polar and Rectangular Coordinate ConversionsComplex Results from Real Numbers 5708Cos θ + i sin θ = re iθ Polar + ib = ∠ θ 8452 2981+ 3.1434 4721 352.0000872.0000 2361For Further Information 138 Calculating With Matrices= A-1B Keystrokes Display Deactivates Complex Mode2496 Matrix DimensionsRunning 11.2887Number Rows Columns Dimensioning a MatrixKeystrokes l B Display Displaying Matrix DimensionsChanging Matrix Dimensions ´mAStoring and Recalling All Elements in Order Storing and Recalling Matrix Elements⎡ a Checking and Changing Matrix Elements Individually Keystrokes Display Matrix Operations Storing a Number in All Elements of a MatrixMatrix Descriptors Result Matrix One-Matrix Operations Copying a MatrixCalculating with Matrices LB b Scalar OperationsLA a Elements of Result MatrixArithmetic Operations Keystrokes Display Subtracts 1 from the elementsLB b 2 LA a 2 Matrix Multiplication Keystrokes Display l a a = AT BSolving the Equation AX = B 8600 24 OA2400 86 OA274 OB 233 OB 331 OB 120.32 OB 112.96 OB 151.36 OB ´Á Week Cabbage kg 186 141 215 Broccoli kg 116 Calculating the ResidualCalculations With Complex Matrices Using Matrices in LU FormThen Z can be represented in the calculator by Storing the Elements of a Complex MatrixPressing Transforms Into LA a = ⎢Complex Transformations Between ZP and Z Inverting a Complex Matrix ´ a Multiplying Complex Matrices´U lC LC lC lC lC lC lC lC ´U Keystrokes lA lB Display Displays descriptor of matrix aZZ −1 Solving the Complex Equation AX = BAX = B 170.0000 200.00001543 03721311 0437Calculating with Matrices Using a Matrix Element With Register Operations Using Matrix Descriptors in the Index RegisterMiscellaneous Operations Involving Matrices Conditional Tests on Matrix Descriptors Stack Operation for Matrix CalculationsCalculating with Matrices Using Matrix Operations in a Program Summary of Matrix Functions Keystrokes Results´m a Calculates residual in result matrix For Further Information Using Finding the Roots An Equation180 Clear program memory Finding the Roots of an Equation005 006 007 ´b0001-42,21 002 003Desired root Finding the Roots of an Equation003 004 Keystrokes ¥´ bA 000 001-42,21,11200 t 5000 1 e tBrings another t-value Into X-register000 001-42,21 002 003 004 005 When No Root Is FoundError Choosing Initial Estimates Label 6 x + 8 003 004 005 007X + 8 008 009Finding the Roots of an Equation Using in a Program Memory Requirements Restriction on the UseUsing f Numerical Integration194 002 003 004 1416 7652 4040Begin subroutine with a label 3825 $ ÷4401 6054 Accuracy of f ´ i ´ f 7091 8826382 Using f in a ProgramMemory Requirements 205 Error ConditionsError 0 Improper Mathematics Operation Appendix aError 2 Improper Statistics Operation Error 1 Improper Matrix OperationError 6 Improper Flag Number Error 3 Improper Register Number or Matrix ElementError 4 Improper Line Number or Label Call Error 5 Subroutine Level Too DeepPr Error Power Error Appendix B Stack Lift Last X RegisterDigit Entry Termination Stack LiftEnabling Operations Disabling OperationsNnn Clear u ¥ Stack Stack Enabled. disabled 53.1301 No stack LiftNeutral Operations Appendix B Stack Lift and the Last X Register Keys\ k + H ∆ \ h ÷ À P* q r c ‘ / N z ∕ P\ o j Last X RegisterRegisters Memory AllocationMemory Space Appendix CAppendix C Memory Allocation Memory Reallocation Memory Status WM % Function Restrictions on Reallocation ´m% 1.0000 Whold 1 6419 ´ m Automatic Program Memory Reallocation Program MemoryTogether Memory Requirements for the Advanced FunctionsTwo-Byte Program Instructions If executedAppendix C Memory Allocation 220 Detailed Look atHow Works Appendix DAppendix D a Detailed Look at Accuracy of the Root X4 = 000 006 007 008 009 010-43,30 011 012-43,30 013 1718Interpreting Results ´ v B0681 − 45 For 0 x End subroutine Test for x rangeBranch for x ≥ 3x 45x 2 +Possible root 000.0000Initial estimates 1358Appendix D a Detailed Look at 013 014 015 016 ´ b.0 001-42,21,.0 002 003 004 005Bring x-value into X-register 007 008 009 01010 v ´ ‛ 20 017 018Finding Several Roots Error 0000 1250 5626002 003 004 005 006 007 Fx = xx a3 =6667 Deflated function value Same initial estimatesSecond root Stores root for deflationDeflation for third root Limiting the Estimation Time For Advanced Information Counting IterationsSpecifying a Tolerance 240 Detailed Look at fHow f Works Appendix EX = π1 0π cos4θ − x sinθ dθ Accuracy, Uncertainty, and Calculation Time´ i ´ f 0000 1416´ f ´ Clear u hold Keystrokes Display Return approximation to´ Clear u Hold Keystrokes ´ i Display7807 7858Uncertainty and the Display Format Functions values for example Δx = 0.5×10−n ×10m = aδx dxb = ab 0.5×10−n + m x dx Conditions That Could Cause Incorrect Results ∞ xe− xdx 001-42,21 002- 1 003 004 005 Appendix E a Detailed Look at f Appendix E a Detailed Look at f Conditions That Prolong Calculation Time Uncertainty Keys lower limit intoKeys upper limit into Approximation to integralAppendix E a Detailed Look at f Obtaining the Current Approximation to an Integral For Advanced Information Batteries Low-Power IndicationInstalling New Batteries BatteriesAppendix F Batteries 2.C 3.H Verifying Proper Operation Self-TestsDigit Entry Function Summary and IndexComplex Functions ConversionsMantissa. Pressing Display ControlIndex Register Control Logarithmic Exponential FunctionsMathematics Matrix Functions146 Number Alteration To ZP page164To XT Clear u PercentageProbability Stack ManipulationStorage StatisticsTrigonometry 269 Programming Summary and IndexProgramming Summary and Index 271 Subject IndexSubject Index Subject Index Subject Index Subject Index Subject Index Subject Index Subject Index Subject Index Subject Index Subject Index Subject Index Subject Index Product Regulatory Environment Information Federal Communications Commission NoticeModifications Avis Canadien Canadian NoticeBody number is inserted between CE European Union Regulatory Notice
Related manuals
Manual 63 pages 42.15 Kb