The Museum of HP Calculators


The Evolution of RPN & Numeric Entry

Contents

Prehistory

RPN is formally traced to prefix and postfix mathematical systems proposed by Jan Lukasiewicz in 1951. However, many mechanical calculators both before and after 1951 had a certain postfix flavor. Storing numbers in some kind of registers and then performing an operation on them is a natural implementation.

Adding Machines and Mechanical Calculators

The earliest mechanical calculators operated in a postfix manner. Rather than entering 4 + 5 =, the user cleared the accumulator, keyed (or levered) in the first number, performed some action to add this number to the accumulator, then keyed the second number and performed the same adding action as before. So, to add 4 to 5, the user essentially performed:

CLEAR
4 +
5 +

and read the result of 9. To subtract 3 from 4, the user would perform:

CLEAR
4 +
3 -

and read the result of 1. Many early calculators did not have actual + and − buttons. On some machines, you turned a crank in one direction to add and the other direction to subtract. Machines like this had a single accumulator and a keyboard register instead of a stack and were limited in their ability to deal with long expressions. (Many modern "adding machine-style calculators" also multiply and divide but these functions are usually implemented in an infix/algebraic notation while the addition and subtraction is still postfix. The HP-10 implemented this form of logic.)

Reverse Polish but Not Quite "RPN" (Friden ECs) (ca. 1964)

Friden was the second company to produce electronic calculators. The EC-130 implemented the basic four functions and the EC-132 added square root. The Friden ECs had a stack of four registers named "register #1" through "register #4" and the ENTER key served to complete the keyboard entry into register #1.

The Friden logic system had a lot in common with the RPN logic system that HP would later develop but there were some interesting differences including:

"Polish Notation" is really a style of writing expressions on paper rather than keying them on a calculator so determining precisely which calculators were or were not "RPN" is difficult. Since HP first applied the acronym "RPN" to its calculators, and because most users mean HP's specific implementations when they refer to "RPN", the museum doesn't classify the Friden ECs as true RPN calculators.

RPN

It's not clear where HP began in the development of the Reverse Polish Notation (RPN). HP considers it a direct derivation from the mathematical works of Jan Lukasiewicz, but it's likely that experience with mechanical calculators and/or the logic system of the Friden ECs influenced them as well.

3 Level RPN (ca. 1968)

Used on the HP 9100 and HP 9810.

4 Level RPN (ca. 1972)

Introduced on the HP-35. Like 3 Level RPN except:

The HP-35 allowed the user to press the CHS sign before or during number entry. If a number was in the display as a result of something other than digit entry, pressing CHS negated it, but if the CHS key was then followed by a digit, the calculator assumed the CHS was actually meant for the following entry. Thus, the previous number displayed was pushed onto the stack without the (already displayed) sign change. This feature could be confusing and later models required the CHS key to be pressed after the first digit of a number.

(User) RPL (ca. 1987)

Introduced on the HP-28C/S. Like 4 Level RPN except:

User RPL also implies other changes beyond the stack such as:

Numeric Entry Styles

Non RPL machines enter numbers directly into the stack. On RPL machines numbers are typed into an input buffer and copied to the stack via [Enter] The high-end desktop machines (made in Colorado) were somewhat more interactive in their input of numbers:

Enter, Rolls and Drops

On the HP 9100 and HP 9810, the enter key was labeled only with an arrow pointing up (↑). Drop was indicated by an arrow pointing down (↓). The calculators also had keys with arrows in each direction and the word ROLL to allow rolling either way. Finally, an X⇄Y (exchange) function was included.

On the HP-35, the word Enter was added to the upward arrow. The small calculator didn't have room for as many stack positioning keys so the only two besides ENTER were the X⇔Y (which had the same meaning as X⇄Y on the HP 9100 and 9810) and a roll down key indicated by R↓. This was not a great loss since rolling down, acted much like drop in that the value in X was moved to the top of the stack where it would soon be lost.)

On the HP-80, ENTER was relabeled SAVE. (This was the only calculator so labeled.)

When the HP-28C introduced the unlimited stack, using a roll down function to delete unwanted data in X no longer made sense since any rolled data would live forever at the top of the stack. Thus, the HP-9100's ↓ key returned but this time with the label DROP. This model also relabeled the X⇔Y key to SWAP since the stack levels were no longer named.

Go to What is RPN?
Go back to the main exhibit hall