Saturday, September 6, 2025

HP 71B Programs: September 2025

HP 71B Programs: September 2025


One of my favorite calculators/pocket calculators of all time is the HP 71B.



ADDMOD: (a + b) mod n = a mod n + b mod n


10 DESTROY A, B, N

20 DISP “(A+B) MOD N” @ WAIT .5

30 INPUT “A? “; A

40 INPUT “B? “; B

50 INPUT “C? “; C

60 S = MOD(A, N) + MOD(B, N)

70 S = MOD(S, N)

80 DISP “SUM = “; S


MULTMOD: (a * b) mod n = a mod n * b mod n


10 DESTROY A, B, N

20 DISP “(A*B) MOD N” @ WAIT .5

30 INPUT “A? “; A

40 INPUT “B? “; B

50 INPUT “N? “; N

60 P = MOD(A, N) * MOD(B, N)

70 P = MOD(P, N)

80 DISP “PRODUCT = “; P


Examples:

A

630

48

15

B

320

99

47

N

700

15

7

SUM:

250

12

6

PRODUCT:

0

12

5



GABLE: Area of a Gable Roof


10 DESTROY P, S, L

20 DEGREES

30 INPUT “PITCH (IN.)? “; P

40 INPUT “SPAN (FT.)? “; S

50 INPUT “LENGTH (FT.)? “; L

60 A = 2 * S * L / COS(ATAN(P/12))

70 DISP “AREA = “; A; “ FT^2”


Input: Pitch (P)

6”

3”

4”

Input: Span (S)

110” (110/12 ft)

5’ 8” (5 + 8/12 ft)

15 ft

Input: Length (L)

100” (100/12 ft)

10’

10 ft

Output: Area (A)

170.81074828 ft^2

116.821326059 ft^2

316.227766017 ft^2



INTENSE: Light Intensity of a Spherical or a Cylindrical Light Source


intensity = power / surface area

intensity (W/m^2), power (W), surface area (m^2)

Surface area: sphere = 4 * π * r^2, cylinder = 2 * π * (r * h + r^2)


10 DESTROY P, K$, R, H

20 DISP “INTENSITY OF LIGHT!” @ WAIT .5

30 INPUT “POWER (W)? “; P


40 DISP “1. SPHERE 2. CYLINDER”

50 DELAY 0,0

60 K$ = KEY$

70 IF K$ = “1” OR K$ = “S” THEN GOTO 100

80 IF K$ = “2” OR K$ = “C” THEN GOTO 200

90 GOTO 40


100 INPUT “RADIUS (M)? “; R

110 A = 4 * PI * R^2

120 GOTO 300


200 INPUT “RADIUS (M)? “; R

210 INPUT “HEIGHT (M)? “; H

220 A = 2 * PI * (R * H + R^2)

230 GOTO 300


300 I = P / A

310 DISP I; “W/M^2”


Examples:


Sphere: r = 4 m, Power = 60 W: Intensity = .298415518297 W/M^2


Cylinder: r = 1.25 m, h = 0.75 m, Power = 70 W; Intensity = 4.45633840656 W/M^2



SIMPLE: Simple Interest – Banker’s Rule


interest = amount * rate% / 100 * #days / 360

final = principal + interest (final, maturity value)


10 DESTROY P, R, I, M

20 DISP “SIMPLE INTEREST” @ WAIT .5

30 INPUT “AMT? “; P

40 INPUT “RATE%? “; R

50 INPUT “# DAYS? “; D

60 I = P * R * D / 360 / 100

70 M = P + I

80 IMAGE K, M10D.2D

90 DISP USING 80; “INT.=”, I @ PAUSE

100 DISP USING 80; “FINAL=”, M


Notes:


* When the HP 71B is in pause, press [ f ] [ + ] to continue (CONT).

* To stop execution, press [ ON ] (ATTN).

* IMAGE K, M10D.2D: display “prompt string”, number rounded to 2 decimal places. The number is right-justified, make the prompt string 7 characters or less to fit both the string and number on the screen.


Examples


Input: Amount

1500

2000

2800

Input: Rate %

4.00%

8.00%

6.65%

Input: # Days

180

90

60

Output: Interest

30

40

31.03

Output: Final

1530

2040

2831.03



AIRSOUND: Speed of Sound in Air


S = 331.5 + .606 * T

S = speed of sound in air, m/s

T = temperature in °C


10 DESTROY K$, S, T

20 DISP “SPEED OF SOUND IN AIR” @ WAIT .5

30 DISP “SOLVE FOR…” @ WAIT .5

40 DISP “1. SPEED 2. TEMP”

60 K$ = KEY$

70 IF K$=”1” OR K$=”S” THEN GOTO 100

80 IF K$=”2” OR K$=”T” THEN GOTO 200

90 GOTO 40


100 INPUT “TEMP (°C)? “; T

110 S = 331.5 + .606 * T

120 DISP “S=”; S; “ M/S”

130 END


200 INPUT “SPEED (M/S)? “; S

210 T = (S- 331.5) / .606

220 DISP “T=”; T ; “°C”

230 END



Examples:


Input: T = 74 °F = (32 + 1/3) °C

Output: S = 345.64 m/s

Input: S = 350 m/s

Output: T = 30.5280528053 °C

Input: T = -8.5 °C

Output: S = 326.349 m/s

Input: S = 382 m/s

Output: T = 83.3333333333 °C



Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

The author does not use AI engines and never will.

Saturday, August 30, 2025

Casio fx-991CW: Editing Variables

Casio fx-991CW: Editing Variables


Introduction



The newer set of Casio scientific calculators, better known as the Classwiz series, revised the way variables are dealt with. For the fx-991CW, storing and editing are dealt with through the Variable button, [ ⇄x ]. We have two options for recalling values of variables, one by the aforementioned variable button or by pressing [ SHIFT ] and the key that holds the variable that is needed.


In the Variables screen, use the key arrows to select a variable then press either [ OK ] or [ EXE ]. Depending on the calculator’s state and mode, we are given one of three options: Store, Edit, and/or Recall.


While editing variables, we are not restricted to just entering numbers. We can enter expressions that can be evaluated. This give us the ability to store several values in one screen.


Apps on the fx-991CW: Ability to Edit Variables in the Variable Screen


App

Access

Notes

Calculate

Yes

Statistics

Yes


Distribution

Yes


Spreadsheet

Yes


Table

Yes


Equation

Yes


Inequality

Yes


Complex

Yes

Catalog-Complex menu is limited to i, ∠

Base

No


Matrix

Yes


Vector

Yes


Ratio

Yes


Math Box

Only during input and Relative Freq (frequency) results screens



Notes:

* In the Variable Edit screen, the Catalog-Func Analysis menu contains only the functions logab, log, and ln.

* The [ ↓FORMAT↑ ] button is inactive in the Variable Edit screen.

* The [ f(x) ] (FUNCTION) button is inactive in the Variable Edit screen.

* Expressions can include other variables including its own.

* Executing the expression by pressing the [ EXE ] also stores the result to the variable.



Examples


Example 1: Use the Variable Edit screen to store the following:

A = 2^2, B = 2^4, and C = 2^3


Keystrokes:

[ ⇄x ] (variable key) select A, select Edit, 2 [ x² ] [ OK ]**

Select B, select Edit, 2 [☐^☐] 3 [ OK ]

Select C, select Edit, 2 [☐^☐] 4 [ OK ]


Result:



A = 4, B = 8, C = 16


Example 2: Use the Variable Edit screen to store the following:

E = 11/5, F = 11/(5 + E), x = 11 * F/E


Keystrokes:

[ ⇄x ], select E, select Edit, 11 [ ÷ ] 5 [ OK ]

Select F, select Edit, 11 [ ÷ ] [ ( ] 5 [ + ] [ SHIFT ] (E) [ ) ] [ OK ]

Select x, select Edit, 11 [ × ] [ SHIFT ] ( F ) [ ÷ ] [ SHIFT ] (E) [ OK ]


Result:



E = 2.2, F = 1.527777777, x = 7.638888888


** or [ EXE ]


Side note: it’s fun to find and use Unicode symbols, like ⇄ (21C4) and ☐ (2610).



Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


The author does not use AI engines and never will.


Sunday, August 24, 2025

HP 20S: Acoustics Programs

HP 20S: Acoustics Programs


Program A: Speed of Sound in Dry Air


cs = 20.05 × √(273.15 + T°C)


Code:

01: 61, 41, A: LBL A

02: 75: +

03: 2: 2

04: 7: 7

05: 3: 3

06: 73: .

07: 1: 1

08: 5: 5

09: 74: =

10: 11: √

11: 55: ×

12: 2: 2

13: 0: 0

14: 73: .

15: 0: 0

16: 5: 5

17: 74: =

18: 61, 25: RTN



Program B: Mersenne's Law: Fundamental Frequency



f0 = √(F ÷ µ) ÷ (2 × L)

F: force (N)

µ: mass per unit length (kg/m)

L: string length (m)

f0: fundamental frequency (Hz)

(Marshall, pg. 19)



Store before running:

R1: force

R2: µ

R3: L



Code (continuing from the previous section):

19: 61, 41, b: LBL B

20: 33: (

21: 22, 1: RCL 1

22: 45: ÷

23: 22, 2: RCL 2

24: 34: )

25: 11: √

26: 45: ÷

27: 33: (

28: 2: 2

29: 55: ×

30: 22, 3: RCL 3

31: 34: )

32: 74: =

33: 61, 26: RTN



Program C: Standing Wavelength in an Open Pipe for the 1st through 5th Harmonic



λ = 2 × L ÷ n

L: length of the pipe

n: nth harmonic (positive integer)

(Marshall, pg. 21)



Code (continuing from the previous section):

34: 61, 41, C: LBL C

35: 21, 1: STO 1

36: 1: 1

37: 21, 2: STO 2

38: 61, 41, 3: LBL 3

39: 2: 2

40: 55: ×

41: 22, 1: RCL 1

42: 45: ÷

43: 22, 2: RCL 2

44: 74: =

45: 26: R/S

46: 1: 1

47: 21, 75, 2: STO+ 2

48: 22, 2: RCL 2

49: 31: INPUT

50: 5: 5

51: 61, 42: x≤y?

52: 51, 41, 3: GTO 3

53: 61, 26: RTN



Program D: Finding the perfect length and height for recording studios given the width.



Length = W × φ (stored in R1)

Width = W (stored in R2)

Height = W ÷ φ (stored in R3)

φ = (1 + √5) ÷ 2

(Marshall, pg. 34)



Code (continuing from the previous section):

54: 61, 41, d: LBL D

55: 21, 1: STO 1

56: 22, 2: STO 2

57: STO 3: STO 3

58: 33: (

59: 1: 1

60: 75: +

61: 5: 5

62: 11: √

63: 34: )

64: 45: ÷

65: 2: 2

66: 74: =

67: 21, 55, 1: STO× 1

68: 21, 45, 3: STO÷ 3

69: 22, 1: RCL 1

70: 26: R/S

71: 22, 2: RCL 2

72: 26: R/S

73: 22, 3: RCL 3

74: 61, 26: RTN


HP 20S - The Complete Code:

01: 61, 41, A: LBL A

02: 75: +

03: 2: 2

04: 7: 7

05: 3: 3

06: 73: .

07: 1: 1

08: 5: 5

09: 74: =

10: 11: √

11: 55: ×

12: 2: 2

13: 0: 0

14: 73: .

15: 0: 0

16: 5: 5

17: 74: =

18: 61, 25: RTN

19: 61, 41, b: LBL B

20: 33: (

21: 22, 1: RCL 1

22: 45: ÷

23: 22, 2: RCL 2

24: 34: )

25: 11: √

26: 45: ÷

27: 33: (

28: 2: 2

29: 55: ×

30: 22, 3: RCL 3

31: 34: )

32: 74: =

33: 61, 26: RTN

34: 61, 41, C: LBL C

35: 21, 1: STO 1

36: 1: 1

37: 21, 2: STO 2

38: 61, 41, 3: LBL 3

39: 2: 2

40: 55: ×

41: 22, 1: RCL 1

42: 45: ÷

43: 22, 2: RCL 2

44: 74: =

45: 26: R/S

46: 1: 1

47: 21, 75, 2: STO+ 2

48: 22, 2: RCL 2

49: 31: INPUT

50: 5: 5

51: 61, 42: x≤y?

52: 51, 41, 3: GTO 3

53: 61, 26: RTN

54: 61, 41, d: LBL D

55: 21, 1: STO 1

56: 22, 2: STO 2

57: STO 3: STO 3

58: 33: (

59: 1: 1

60: 75: +

61: 5: 5

62: 11: √

63: 34: )

64: 45: ÷

65: 2: 2

66: 74: =

67: 21, 55, 1: STO× 1

68: 21, 45, 3: STO÷ 3

69: 22, 1: RCL 1

70: 26: R/S

71: 22, 2: RCL 2

72: 26: R/S

73: 22, 3: RCL 3

74: 61, 26: RTN


Examples


LBL A:

Input: T = 0°C: Speed of sound: 331.371367011 m/s

Input: T = 10°C (50°F): Speed of sound: 337.82583835 m/s

Input: T = 26.66666667 (80°F) C: Speed of sound: 347.170058532 m/s



LBL B:

R1: 45 N, R2: 0.008 kg, R3: 0.06 m; f: 625 Hz

R1: 3 N, R2: 0.006 kg, R3: 0.058 m; f: 192.764480819 Hz



LBL C:

Open ended pipe length: 1.2 m

The wavelengths for the 1st, 2nd, 3rd, 4th, and 5th harmonics respectively:

2.4, 1.2, 0.8, 0.6, 0.48

Open ended pipe length: 0.059 m

The wavelengths for the 1st, 2nd, 3rd, 4th, and 5th harmonics respectively:

0.118, 0.059, 3.933333333E-2, 0.0295, 0.0236



LBL D:

Width: 12 ft; Length: 19.416407865 ft, Height: 7.416407865 ft

Width: 18 ft 6 in = 18.5 ft; Length: 29.9336287919 ft, 11.4336287919 ft



Source

Marshall, Steve. Acoustics: The Art of Sound. Wooden Books, LLC. San Rafael, California. 2023. ISBN 978-1-952178-33-7


Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


The author does not use AI engines and never will.

First Look: HP 16C Collector's Edition

 First Look: HP 16C Collector's Edition I just got the HP 16C Collector's Edition.   This is the famous HP 16C that specializes in c...