Sunday, April 13, 2025

Spotlight: Commodore P50

Spotlight: Commodore P50


Quick Facts



Model: P50

Company: Commodore

Timeline: 1978

Type: Scientific, Programming

Memory: 24 Steps

Order of Operations? No

Battery: 1 x 9-volt battery

Memory Registers: 1

Screen: 8 digits, red LED lights










Manual: www.wass.net/manuals/Commodore%20P50.pdf

From Kate Wasserman, Ph. D.’s website: https://www.wass.net/


This is my first Commodore calculator. The purchase included the calculator a manual, which is available from Kate Wasserman’s website above.



Calculating With the P50


Even though the P50 is a larger sized calculator, the calculator feels light weight. The keys are a pleasure to press.


The set of the P50’s functions is a set of basic of scientific calculators:


* Arithmetic functions

* 1/x, x^2, √x. The power function is missing.

* Logarithmic and exponential functions: log, 10^x, ln, e^x

* Trigonometric Functions: sin, cos, tan, arcsin, arccos, arctan, π key.

* Factorial of positive integer: [ n! ]

* Integer part: [ INT ]

* Memory keys: store, recall, product, sum, exchange. We only get one memory register on the P50.


Every function is a primary key except the inverse the inverse trigonometric functions, which are accessed by the [ arc ] key first.


The P50 operates in Chain mode. That is, operations happen in the order of the keys pressed, without regard to the order of operations.


Example:

9 [ × ] 7 [ + ] 8 [ = ] returns 71.

8 [ + ] 9 [ × ] 7 [ = ] returns 119.


There are no parenthesis keys, hence for more complex calculations, the use of the memory key is needed.



Powers and Roots


The P50 is missing the power function. The manual suggests that powers are calculated by the following keystroke sequence:


y^x: y [ ln ] [ × ] x [ = ] [ e^x ]

y^(1/x): y [ ln ] [ × ] x [ 1/x ] [ = ] [ e^x ]


Alternatively:

y^x: y [ log ] [ × ] x [ = ] [ 10^x ]

y^(1/x): y [ log ] [ × ] x [ 1/x ] [ = ] [ 10^x ]


Example:

5^8: 5 [ ln ] [ × ] 8 [ = ] [ e^x ]; returns 390,625

5^(1/8): 5 [ ln ] [ × ] 8 [ 1/x ] [ = ] [ e^x ] returns 1.2228445.


Other function sequences:


Absolute Value, abs(x): [ x^2 ] [ √x ]

4th Power, x^4: [ x^2 ] [ x^2 ]

Cube, x^3: [ STO ] [ x^2 ] [ x^2 ] [ ÷ ] [ RCL ] [ = ] (memory is used)

Sign Function, x ≠ 0, sgn(x): [ STO ] [ x^2 ] [ √x ] [ ÷ ] [ RCL [ = ] (memory is used)

Fraction Part, frac(x): [ STO ] [ - ] [ RCL ] [ INT ] [ = ] (memory is used)


Programming


The P50 has a 24-step capacity. There are no merged keystrokes with exceptions:


* The arcsin, arccos, and arctan key sequences ( [ arc ] [ sin ], [ arc ] [ cos ], [ arc ] [ tan ]) are merged.

* The [ GOTO ] key is followed by a two digit address. In this case any steps 0 through 9 are preceded by a zero (00 -09).


The low amount of programming steps and the one memory register to work with, the P50 programming module is good for short, quick repeated calculations. The programming keys available are:


[ lrn ]: Learn/(Run) Mode Toggle. In run mode you are only shown the step number and nothing else.


[ R/S ]: Run/Stop

[ SSTP ]: Single Step key. However, it only works in run mode, executing program steps one step at a time. This is the most annoying quirk of the P50, almost making it programming in the blind calculator. There are no key codes with each step, and they really should be.

[ GOTO ] ##: Directs the P50 to go to step 00-23. The two digit number after a GOTO counts as one step.


There are three skip functions. If the test is true, the program either:

* Skips the next step or

* Skips the next two steps if the step that follows the test is a GOTO.


[ SKZ ]: Skip if the number in the display is zero. (skip if x = 0)

[ SKN ]: Skip if the number in the display is negative. (skip if x < 0)

[ SKP ]: Skip if the number in the display is positive or zero. (skip if x ≥ 0)


In order for the program to stop and display results and reset for the next calculation, we need the following sequence of steps:

R/S

GTO 00


Otherwise, the program could run unintentionally forever.


There is no clear program button, but programs are not kept when the P50 is turned off.  


P50: Sample Programs


Round to the nearest hundredths (2 decimal places)


×

1

0

0

+

.

5

INT

÷

1

0

0

=

R/S

GTO

00



Examples:

36.728 → 36.73

54.616 → 54.62

40.303 → 40.30 (display shows 40.3)


Permutation


nPr = n! / (n – r)!


STO

-

R/S

n!

1/x

×

RCL

n!

=

R/S

GTO

00


To Run: (GTO 00): n R/S r R/S nPr


Examples:


n = 20, p = 8: 5.0791104 E09 (5,079,110,400)

n = 12, p = 6: 665,280

n = 13, p = 7: 8,648,640


Volume of a Sphere


V = 4 * π * r^3 / 3


STO

x^2

x^2

÷

RCL

×

π

×

4

÷

3

=

R/S

GTO

00


Examples:

r = 11.1: 5,728.7193

r = 6: 904.77868

r = 10: 4,188.7902


Pseudo Random Number Generator


#_i = frac( (π + #_i) ^ 5) = M – int (M) (where M = e^( 5 * ln (#_i + π))


+

π

=

ln

×

5

=

e^x

-

INT

=

R/S

GTO

00


To run: seed R/S, R/S, R/S, ….


Examples:

0.552 → 0.4561281 → 0.7501096 → 0.6846062

0.838 → 0.1437699 → 0.7511575 → 0.8871519



Modulus of Positive Numbers


a > 0, b > 0, a mod b = a – int(a / b) * b


÷

R/S

STO

=

-

INT

×

RCL

=

R/S

GTO

00


To run: a R/S b R/S result


Examples:

19 mod 7 = 5

288 mod 17 = 16


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. 



Saturday, April 12, 2025

RPN with HP 15C & DM32: Stack Register Arithmetic

RPN with HP 15C & DM32: Stack Register Arithmetic


Got a treat for today folks. First...


14 YEARS!!


On the 16th, it will be 14 years since my blog started!!!! Thank you so much for your support – the blog is one of my joys of life.


Today is another installment of RPN with HP 15C & DM32, I hope you are enjoying this new monthly series, currently every second Saturday of the month.



Stack Register Arithmetic


As we know, nearly all Hewlett Packard (HP) and I think all Swiss Micros (SM) calculators that operate on Reverse Polish Notation (RPN) or Reverse Polish Lisp (RPL, think HP 48 and 50g), a feature that we can calculate an arithmetic operation (+, -, ÷, ×) directly on any number stored in any memory register. It’s a very handy feature indeed.


On the HP 41C, DM41, HP 42S, and DM42 series of calculators, that ability extend to the stack registers themselves (X, Y, Z, T, L (LastX)). To do this, press [ STO ], the required arithmetic operation, the decimal point [ . ], and the appropriate key.


Example:


The current stack is set as:


T: 11

Z: 16

Y: 10

X: 5


Note the 5 in the X stack. We can use the contents of the X stack to do operations on the other levels without “disturbing” the other levels.


Add 5 to stack Z without having to disturb the stack. ST+ Z (41), STO+ ST Z (42) returns:


T: 11

Z: 21

Y: 10

X: 5


Note that the entire stack except Z remains the same.


Multiply stack T by 5. 5 is in the X stack already. ST* T (41), STO× ST T (42) returns:


T: 55

Z: 21

Y: 10

X: 5


Pretty neat, right?


In summary:


STO+ SL: new SLV= old SLV + X

STO- SL: new SLV = old SLV – X

STO× SL: new SLV = old SLV × X

STO÷ SL: new SLV = old SLV ÷ X


where:

X = value in stack level X (display on one-line calculators)

SLV = stack value level (X, Y, Z, T, L)


The 15C and 32S series do not have a native way to do this, but today I will present a way to mimic these powerful stack storage arithmetic on levels X, Y, Z, and T. Most of them will not require the use of an outside memory register (i.e. R0 or R1 for the 15C series, or A or Z for the 32S series).


These techniques were tested on a Hewlett Packard HP 15C and Swiss Micros DM32. They probably would work on the HP 12C (or equivalent) as well, just substitute the roll up (R↑) with three roll down (R↓ R↓ R↓) commands when encountered.


FYI, the 42 series also has recall arithmetic on stack levels, which returns on stack X.



The Algorithms


For the following algorithms, let {OP} stand for the arithmetic operation (+, -, ×, ÷). Let the hash symbol, {#}, stack for a register of your choice (i.e. R0 for 15 or A for 32).


Storage Arithmetic on Stack X


R↑

STO {#}

R↓

ENTER

{OP}

RCL {#}

R↓




Stack Illustration with STO+ X (it will be similar with the rest of the arithmetic operations)


t

z

z

t

z

z

z

t

z

y

y

z

y

z

y

z

y

x

x

y

x

y

x + x

y

x

t

t

x

x

x + x

t

x + x

START

R↑

STO {#}

R↓

ENTER

+

RCL {#}

R↓


Shortcuts:

STO- X: Clx

STO× X: x^2 (specifically, the square function)


The next set will not require a separate memory register.


Example:


40

30

30

40

30

30

30

40

30

20

20

30

20

30

20

30

20

10

10

20

10

20

20

20

10

40

40

10

10

10 + 10 = 20

40

20

START

R↑

STO {#}

R↓

ENTER

+

RCL {#}

R↓





Storage Arithmetic on Stack Y


This is by far the easiest.


{OP}

LAST X


Stack Illustration with STO+ Y (it will be similar with the rest of the arithmetic operations)


t

t

t

z

t

z

y

z

y + x

x

y + x

x

START

+

LAST X



Example:


40

40

40

30

40

30

20

30

30

10

20 + 10 = 30

10

START

+

LAST X




Storage Arithmetic on Stack Z


x<>y

R↓

{OP}

LAST X

R↑

x<>y


Stack Illustration with STO+ Z (it will be similar with the rest of the arithmetic operations)


t

t

y

y

y

t

t

z

z

t

y

t

z +x

z + x

y

x

z

t

z + x

x

y

x

y

x

z + x

x

y

x

START

x<>y

R↓

+

LAST X

R↑

x<>y



Example:


40

40

20

20

20

40

40

30

30

40

20

40

40

40

20

10

30

40

40

10

20

10

20

10

30 + 10 = 40

10

20

10

START

x<>y

R↓

+

LAST X

R↑

x<>y




Storage Arithmetic on Stack T


R↑

x<>y

{OP}

LAST X

x<>y

R↓



Stack Illustration with STO+ T (it will be similar with the rest of the arithmetic operations)


t

z

z

z

z

z

t + x

z

y

y

z

y

y

z

y

x

t

y

t + x

x

y

x

t

x

t + x

x

t + x

x

START

R↑

x<>y

+

LAST X

x<>y

R↓


Example:


40

30

30

30

30

30

50

30

20

20

30

20

20

30

20

10

40

20

50

10

20

10

40

10

40 + 10 = 50

10

50

10

START

R↑

x<>y

+

LAST X

x<>y

R↓



Until next time,


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.


Spotlight: Commodore P50

Spotlight: Commodore P50 Quick Facts Model: P50 Company: Commodore Timeline: 1978 Type: Scientific, Programming Memo...