Showing posts with label Hewlett Packard. Show all posts
Showing posts with label Hewlett Packard. Show all posts

Sunday, May 3, 2026

HP 65 Programs: Triangulation, Percentile, Roots of Unity, Partial Fractions

 HP 65 Programs: Triangulation, Percentile, Roots of Unity, Partial Fractions


Triangulation

(done with HP-65 Emulator for Windows, Bernhard Emese)




Given:

Side angle α

Side angle ß

r = Length of base

Find:

h = height which crosses the base line at right angles



Code:

23: LBL

12: B

35: g

41: DEG

33 01: STO 1

35 08: R↓

41: ENTER

41: ENTER

44: CLX

51: -

31: f

04: SIN

35 09: R↑

31: f

04: SIN

71: *

33: STO

71: *

01: 1

35 08: R↓

61: +

31: f

04: SIN

33: STO

81: ÷

01: 1

34 01: RCL 1

24: RTN



Example: ß = 50°, α = 30°, r = 10

Result: h ≈ 3.89


Source:

“Triangulation (surveying)” Wikipedia. https://en.wikipedia.org/wiki/Triangulation (surveying) (last edited October 24, 2025). Retried March 17, 2026


Percentile in a Range


The program calculates the percentile of x in the range [a, b].


percentile = (x – a) ÷ (b – a) * 100%


Stack:

Z: x

Y: a

X: b


23: LBL

11: B

35 07: x<>y

51: -

35 00: LSTx

35 07: R↓

51: -

35 09: R↑

81: ÷

02: 2

32: f^-1

08: LOG (10^x)

71: ×

24: RTN


Example: The range: [210, 470], x = 376

Stack: Z: 376, Y: 210, X: 470

Result: 63.85



Roots of Unity

(done with HP-65 Emulator for Windows, Bernhard Emese)


w^n = 1

Registers used: R1 = n, R8 = n (counter)


n [ A ]


Cycle:

root # [ R/S ]

real part [ R/S ]

imaginary part [ R/S ] (the cycle starts again)


Repeat the cycle until the display is flashing zeros (forced 1/0 error). Hit [ CLx ] to stop the flashing.


This program switches the mode to radians angle measurement.



Code:

23: LBL

11: A

33 01: STO 1

33 08: STO 8

35: g

42: RAD

23: LBL

00: 0 (LBL 0 - subroutine)

34 08: RCL 8

84: R/S (show root #)

35: g

02: π

71: ×

02: 2

71: ×

34 01: RCL 1

81: ÷

01: 1

32: f^-1

01: R->P (->rect)

84: R/S (show real part)

35 07: x<>y

84: R/S (show imaginary part)

35: g

83: DSZ (decrement R8 by 1)

22: GTO

00: 0 (GOTO LBL 0)

34 08: RCL 8

35: g

04: 1/x

24: RTN


Example (FIX 4):

w^3 = 1

#; R/S; real part; R/S; imaginary part

3; 1.0000; -0.0000

2; -0.5000; -0.8660

1; -0.5000; 0.8660

(flashing zeroes)




Partial Fractions

(w is the variable, and T, Z, Y, and X are the stack contents)

(Tw+Z) ÷ ((w+Y)(w+X)) → B÷(w+Y) + A÷(w+X)

Input Stack: T, Z, Y, X 

Output Stack: B, A


Code: 

23: LBL 

11: A 

35, 07: x<>y 

51: - 

35, 00: LST x 

35, 09: R↑ 

71: × 

35, 00: LST x 

35, 07: x<>y 

35, 09: R↑ 

35, 07: x<>y 

51: - 

35, 09: R↑ 

81: ÷ 

41: ENTER 

35, 08: R↓ 

51: - 

35, 09: R↑ 

35, 07: x<>y 

24: RTN



Example 1: 

(12*w + 28) ÷ ((w+2) * (w+3)) = 4 ÷ (w+2) + 8 ÷ (w+3) 

Input Stack: T: 12, Z: 28, Y: 2, X: 3 press [ A ] 

Output Stack: Y (B): 4, X (A): 8



Example 2: 

(33) ÷ ((w-5) * (w+6)) = 3 ÷ (w-5) + -3 ÷ (w+6) 

Input Stack: T: 0, Z: 33, Y: -5, X: 6 press [ A ] 

Output Stack: Y (B): 3, X (A): -3



Example 3: 

(2*w - 3) ÷ ((w-1) * (w+4)) = -0.2 ÷ (w-1) + 0.2 ÷ (w+4) 

Input Stack: T: 2, Z: -3, Y: -1, X: 4 press [ A ] 

Output Stack: Y (B): -0.2, X (A): 0.2





Eddie


All original content copyright, © 2011-2026. 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.

Sunday, April 26, 2026

Retro Review: HP 65

Retro Review: HP 65







Quick Facts



Company: Hewlett Packard

Years: 1974 - 1977

Type: Scientific, RPN (Reverse Polish Notation)

Memory: 9 memory registers, 100 steps



Batteries: originally Ni-Cad, there are battery packs that can use AAA batteries (Ebay seller: waterhosko, https://www.ebay.com/usr/waterhosko)



DISCLAIMER:  I am not page for referring the website on eBay, nor I do not guarantee that inventory is available.



The HP 65 is first programmable calculator. I recently purchased a HP 65 from Persnickity Antiquity in Pomona, California. I saw that HP 65 a year earlier. What got me to purchase was it was for two reasons, (1) I have a HP 67 and fell in love with the classical HP calculators and (2), it had the AAA battery pack (see waterhosko above).Originally the HP 65 is ran with rechargeable Ni-Cad batteries.



Format Settings



The HP 65 has two format settings:



Scientific Format: [ DSP ] # (0-9)

Fixed Format: [ DSP ] [ . ] # (0 – 9)





Modifier Keys



There are three modifier keys: two orange shifts [ f ] and [ f^-1 ] and one blue shift [ g ]. The label for the orange shift is above the key and the label for the blue shift is below the key.



Inverse Key Table

[ f ]

[ f^-1 ]

LN

e^x

LOG

10^x

√x

SIN

SIN^-1

COS

COS^-1

TAN

TAN^-1

R→P (to polar)

P→R (to rectangular)

D.MS+

D.MS-

→D.MS (decimal, minute, seconds)

D.MS→ (decimal)

→OCT (to octal base)

→DEC (to decimal base)

INT (integer part)

FRAC (fractional part)

SF 1/SF 2 (set flag 1 or 2)

CF 1/CF 2 (clear flag 1 or 2)

TF 1/TF 2 (is flag 1 or 2 set?)

TF^-1 1/TF^-1 2 (is flag 1 or 2 clear?)





Programming



Program Steps



In program mode, the HP 65 displays only the key code. The key code is usually two digits, the first is the row (top-down), second is column (left-right). The exception is the digit keys where they would be labeled in the format 0#.



Editing is limited to SST (single step forward) and delete key ([ g ] [ Clx ] (DEL)).



Partially Merged Steps



The first programmable calculator holds up to 100 steps. Steps are partially merged. The program commands that are merged are:

STO # (1 – 8)

* does not include storage arithmetic

Swap X and Y: x<>y

Comparisons: x≠y, x=y, x≤y, x>y

RCL # (1 - 8)

Roll Down: R↓

All but STO/RCL are followed by the [ g ] shift key.

NOP (No operation)

Roll Up: R↑






Memory Registers



The HP 65 has nine memory registers R1 through R9. There is no R0 (register zero), which would be added in later calculators.



Two registers are used for specific purposes:

R8: Register 8 is used the counter in the DSZ command (Decrement and Skip if Zero command).

R9: Register 9 is used as a temporary register from trigonometric function calculations, rectangular/polar conversions, and for comparison tests, R9 is used as a Last X register.



R8 and R9 can be used for general use, but would be subject to change.



Comparisons and Labels



The HP 65 has four comparisons (x = y, x ≠ y, x ≤ y, x > y) and the DSZ command operate somewhat like most RPN calculators: if the test is true, the next step is executed. However, if the result is false, the next two steps are skipped. That’s right, the next two steps.



Example:

x > y

[ if true, x > y, execute this step; if false, x ≤ y, skip this step ]

[ also skip this step if x ≤ y ]

[ third step ]



Why two steps? The goto (GTO) command takes two steps on the HP 65. The HP 65 has 15 labels, 0 – 9 and A – E. If both steps are not needed, one can be filled by the NOP (No Op (Operation)) command.



Subroutines and Instant Labels



The labels A through E (A, B, C, D, E) are user programs that can be accessed by keys. They are the only labels act as subroutines. There is no XEQ/GSB command, subroutines are automatically called by pressing the corresponding key. Only one subroutine can be called at a time.



One quirk for the HP 65, if there is a program without a label A, then pressing [ A ] in run mode, execution starts from the first step.



The HP 65 loads five short default programs every time the calculator is turned on, which function is printed above the key in white:

[ A ] 1/x

[ B ] √x

[ C ] y^x

[ D ] R↓

[ E ] x<>y





Non-Continuous Memory



The memory on the HP 65 is not continuous. When the calculator is turned off, all memory is lost. The only way to save the memory registers and the steps require the use of thin memory cards and the built-in card reader. Each card can hold 100 steps.



I love the classic RPN HP calculators from the early 1970s. I have three of them now, the HP 45 (1973), HP 65 (1974), and HP 67 (1976).








Sources


“HP 65” The Museum of HP Calculators (MoHPC). https://www.hpmuseum.org/hp65.htm Retrieved April 1, 2026.


“HP-65 Programming” The Museum of HP Calculators (MoHPC). https://www.hpmuseum.org/prog/hp65prog.htm Retrieved April 1, 2026.


Hewlett-Packard. HP-65 Owner’s Handbook. Cupertino, CA. July 1974.



Eddie


All original content copyright, © 2011-2026. 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.


Saturday, March 7, 2026

TI-84 Plus CE and Swiss Micros DM32: Blood Alcohol Level

TI-84 Plus CE and Swiss Micros DM32: Blood Alcohol Level


Just in time for the upcoming St. Patrick’s Day in a few weeks…


Introduction


The blood alcohol level is calculated by the following approximation by Walter L. Gregory Jr. using data from the CRC Handbook of Tables for Applied Engineering (1970). The program is based off the HP-97/HP-67 program listed in their Medical Practitioner pac (1979). (see source):


BAC ≈ ((ALC * OZ) ÷ 50 – T) * (3.751 ÷ WT)


ALC: Percentage of alcohol consumed. Enter as a whole number. For example, if the drink has 40% alcohol, ALC = 40. If the alcohol is measured in proof, divide the proof by 2.

OZ: The total amount of ounces consumed within the period of time. For example: six 12-oz beers total 72 ounces.

WT: The weight of the person in pounds.

T: The number of hours drinks are consumed. If T > 1, then T = hours – 1. Otherwise T = 0.


If calculated BAC is below 0, then set BAC = 0.


TI-84 Program CE: ALCOHOL

Type: TI Basic


Disp “BLOOD ALCOHOL (US)”

Input “WEIGHT (LB)? “, W

Input “OUNCES? “, O

Input “PERCENTAGE? “, P

Input “HOURS OF DRINKING? “, H

If H≤1 : Then : 0 → H

Else : H – 1 → H : End

(P * O / 50 – H) * 3.751 / W → A

Disp “BLOOD ALCOHOL: “, A


Swiss Micros DM32 (HP 32SII): ALCOHOL


A01 LBL A

A02 INPUT W

A03 INPUT O

A04 INPUT P

A05 INPUT H

A06 RCL H

A07 1

A08 x≥y?

A09 SF 1

A10 STO- H

A11 FS? 1

A12 Cl x

A13 FS? 1

A14 STO H

A15 CF 1

A16 RCL P

A17 RCL× O

A18 50

A19 ÷

A20 RCL- H

A21 3.751

A22 RCL÷ W

A23 ×

A24 x<0?

A25 Cl x

A26 RTN


Notes:


A07 1, A08 x≥y?, A09 SF 1: If hours > 1, set Flag 1. Using flags can sometimes eliminates the need for additional labels.


A24 x<0?, A25 Cl x: If the number in the display (x stack) negative, change it to zero.


Examples


Example 1:

Inputs:

Weight: W = 150 lbs

Ounces: O = 4 oz

Percentage: P = 20%

Hours: H = 0.5 hours (T = 0)

Output: 0.0400


Example 2:

Inputs:

Weight: W = 180 lbs

Ounces: O = 45 oz

Percentage: P = 50%

Hours: H = 2.5 hours (T = 1.5)

Output: 0.9065

(typo:  Thank you, Pedro Leiva)


Be sure to check your local laws for legal blood alcohol levels. This program is not suited to be evidence in legal matters.


One thing remains: DON’T DRINK AND DRIVE



Source


Hewlett Packard. HP-67/HP-97. User’s Library Solutions: Medical Practitioner. Corvallis, OR. April 1979. pp. 9-12



Eddie


All original content copyright, © 2011-2026. 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.

Friday, October 10, 2025

Retro Review: HP 67

Retro Review: HP 67


I won a HP 67 from the HHC 2025 Conference in Orlando, Florida last September. Be on the lookout for a list of videos by the hpcalc.org's YouTube page soon. It's always a good time.


Bruce Gordon donated the HP 67 to the conference and I'm grateful and appreciative. I love the box, the calculator, the leather cover, and the manuals.









Quick Facts


Company: Hewlett Packard

Years: 1976 - 1984

Type: Scientific, RPN (Reverse Polish Notation)

Memory: 20 memory registers, 224 steps


Batteries: originally Ni-Cad, there are battery packs that can use AAA batteries (Ebay seller: waterhosko, https://www.ebay.com/usr/waterhosko)


DISCLAIMER:  I am not page for referring the website on eBay, nor I do not guarantee that inventory is available.  


Features:


* Trigonometric, logarithmic, exponential functions

* Probability: n! (the factorial function only accepts positive integers)

* Integer part, fractional part, absolute value, round to fix settings

* Polar/Rectangular, Degree/Radian, Hours/Hours-Minutes-Seconds (HMS) conversions

* Percent and percent change


Non-Continuous Memory


The memory on the HP 67 is not continuous. When the calculator is turned off, all memory is lost. The only way to save the memory registers and the steps require the use of thin memory cards and the built-in card reader. Each card has two sides, which can hold 112 steps per side. With decades-old calculators like the HP 67, the card reader has stopped working. It can be repaired and when I get the chance, I will leave it to the repair experts.


Memory Registers


There are 20 memory registers but they are split up: 10 primary registers and 10 secondary registers. The set of registers can be switch by pressing [ f ] (P<>S). This really comes into play when working with statistical data (see next section).


Statistics


The HP 67 has the standard statistics functions including sums, means, and standard deviations. When calculating statistics, the following stored on the secondary registers:


RS9 (19): n

RS8 (18): Σxy

RS7 (17): Σy^2

RS6 (16): Σy

RS5 (15): Σx^2

RS4 (14): Σx


Clearing these registers require this key sequence: [ f ] (CL REG) [ f ] (P<>S). To access the statistics registers after entering the data, start by pressing [ f ] (P<>S).


The mean function, [ f ] (x-bar):

Y: average of y-values

X: average of x-values


The standard sample deviation, [ g ] (s):

Y: sample deviation of y-values

X: sample deviation of x-values


Programming


As mentioned before, the HP 67 can hold programs up to 224 program steps. Steps involving shift keys [ f ], [ g ], and [ h ], along with [ GTO ] and [ LBL ], are merged with the next key press to help save space. However, each press of the digit keys and the decimal point take one step each. For instance, 475.2 takes five steps ([ 4 ], [ 7 ], [ 5 ], [ . ], [ 2 ]) while sequences such as [ GTO ] [ 1 ] and [ f ] (√x) take one step each.


Always available are five user keys that double as ten lettered labels: A, B, C, D, E, a, b, c, d, and e. The lower case labels are shifted of their capital letter counter parts. There are also ten numerical labels, 0-9, available for use.


There are eight comparison tests:


Gold tests (use the [ f ] shift): x=0, x≠0, x<0, x>0

Blue tests (use the [ g ] shift): x=y, x≠0, x≤y, x>y


The registers I and (i) are used for indirect addressing. We have special functions to store to Register I, the ST I and RC I functions. The DSZ and ISZ only work on register 1.


DSZ: Decrease register I by 1 and skip the next instruction if the result is I=0.

ISZ: Increase register I by 1 and skip the next instruction if the result is I=0.


There are four flags. Flags 0, 1, and 2 are user flags. Flag 2 gets cleared automatically when tested. Flag 3 is the entry flag, which is set automatically when a number is entered or a data card is read. Like Flag 2, Flag 3 is cleared automatically when tested.


For more details, here is an excellent article on HP-67 (and the similar HP-97) programming by the MoHPC (Museum of HP Calculators) web page: https://www.hpmuseum.org/prog/hp67prog.htm


As mentioned before, when the calculator is turned off, all memory is reset. When available, save your programs to a data card first.



Program Collection


Download here:

https://drive.google.com/file/d/114H4D0hcOjxDj_MHQNvwDBUJV3chlpdC/view?usp=sharing



List of Programs (all programs on the file are relatively short, less than 35 steps):


Countdown of HP 67 "seconds"

Random Numbers

Snell's Law

Circle: Area and Circumference

Sphere: Surface Area and Volume

Angle Between 2 Lines with Slopes x and y

Sum of Powers

Adding Complex Numbers

Multiplying Complex Numbers

Complex Number to a Real Power

Permutation

Combination (with duplicating X and Y stack values)

Speed of Sound Approximation (in meters per second)

Finance: Present Value Annuity Factor (including setting N and I% with monthly payments)

Distance Between Two Points (x,y) and (z,t)

Horizontal Curve


When the HP 67 is Turned Off


* All memory is cleared

* The display setting is reset to FIX, DSP 2 (display 2 digits)

* The angle setting is reset to Degrees


Notes


* The number format and the number of decimal points displayed are set separately. For format, the HP 67 offers fixed (FIX), scientific notation (SCI), and engineering format (ENG). For this calculator, do not enter a number after FIX, SCI, or ENG. Setting the number of digits require the use of the display (DSP) key. For instance, if I want to set the HP 67 to fixed setting with 4 decimal places, the keystroke sequence required would be [ f ] (FIX) [DSP] [ 4 ].


* It takes getting used to use a shift key [ h ] before swap (x<>y) and roll down (R↓). Usually they are primary key functions.


* The card reader did not operate, but for machines that are now 50 years old, it's understandable because they do break down. If I get it repaired, I'm leaving it to the professionals.


* There are no internal guard digits. The HP 67, as it seems to be the case for the entire Classic series and possibly later series such as the Voyagers, carries out calculations to fit the 10 digit screen and that's it.


Example:


Set FIX, DSP 9.


2 √ 1.41 - 100 ×


Result:

HP 67 (DSP 9): 0.421356200

HP 45 (FIX 9): 0.421356200

HP 15C CE (FIX 9): 0.421356200

HP 42S, original (ALL): 0.421356237



* This is the only calculator I know that stores the six statistical sum results in secondary registers. I'll have to remember to do the P<>S command first. In later models the registers are not split in this fashion, and that I am grateful for.


* The display is nice, clean, and I do get a small thrill from working with red LED displays.


* There is also a learning curve when all of the shifted functions are listed BELOW the primary keys:

[ primary function ]

        h (black)

g (gold) b (blue)



It's a classic for a reason and I love it. The keyboard is clean and the keys are responsive.


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 MU Key on a Four Function Calculator and Programs for the DM42/HP 42S

  The MU Key on a Four Function Calculator and Programs for the DM42/HP 42S Not too long ago, I purchased this very colorful, four funct...