HP-25 Calculator Simulation
This is a faithful simulation of an HP-25 calculator.
|
⇐ Click button to open calculator window.
|
If pop-ups are blocked and window doesn't open,
follow this link to the calculator page.
Background
Hewlett-Packard made the HP-25 from 1975 to 1978.
I bought one in 1975,
the first geek in my school to carry a calculator on his belt. I still have it.
The calculator has RPN (reverse Polish notation), scientific functions and
short programs. Much more information about it is provided at
The Museum of HP Calculators.
In 1997, I wrote the core of the simulation in C with a keyboard interface,
for testing. I added the photographic user interface to form a Java applet. In 2025,
I converted it to Javascript.
Capabilities
- To work the calculator, press the keys using your mouse. There are also
two small slide switches below the LED display and above the keys. These
move left and right by dragging them with your mouse.
- The slide switches and keys are animated. The slide switches should seem
to move realistically. The keys are unusual and should seem to pivot along
their lower edges, moving toward the top.
- If you leave the mouse over a slide switch or key for one second, a hint
should appear in square brackets on the title bar of the window. The hint
is the function or prefix that will happen if the key is pressed. In many
cases, prefix keys change the function associated with a key.
- The display should look like a real LED display and the calculations should
work. If you don't know how HP calculators work, press
7, ENTER, 4, +, for example, to add 7 + 4 and get 11. To see more digits,
press f, FIX, 9. (f is the yellow key and FIX is the SST key.)
- The slide switches are initially toward the right. Moving the left slide
switch toward the left turns the calculator off. The right slide switch
can put you in "program" mode.
- On touchscreen devices, the slide switches simply toggle when touched.
- The calculator should behave exactly like a real HP-25 except for computational
accuracy.
- Overflow occurs above 9.9999999e99, underflow below 1.0e-99, as in the
real calculator.
- Trig functions for exact 1/4 circle angles in degrees and grads modes should
give results exactly like the real calcuator.
- Conditional branch instructions (which require a test for equality) are
approximated near ten digits of accuracy, within an order of magnitude
of the real calculator.
Limitations
- Computational accuracy isn't duplicated: This simulation computes to about
17 digits. The real calculator is accurate to about 10 digits. For example,
the same calculation might produce 32169908.78 on the real calculator and
32169908.77 in the simulation.
- Trig functions for very large angles are always taken as zero in the simulation.
- When a program is running, the LED segments of the display of the real
calculator flicker in complex ways, and often looks like a blur of almost
all segments. The simulation displays "-88888888888".
- Instructions require a non-trivial period of time on the real calculator,
depending on the complexity of the instruction. The simulation is probably
faster but adds a 1/10 second delay per instruction when a program is running
and adds 1 second for PAUSE.
- When battery power is low on the real calculator, the first 8 decimal points
are lit (excluding the first digit, reserved for the minus sign), and not
the proper decimal point if among the 8, when displaying a number but not
while a number is being entered.
- Your mouse buttons don't do justice to the action of real HP-25 keys ;-)
Files
Javascript source
Magic numbers of the graphics
Graphics image of the calculator face
Graphics images of the LED's
Graphics images of the slide switches
Graphics images of the keys
Graphics image of the run/stop key
Don't forget the calculator page!
Although the simulation can be run entirely off-line,
due to file reading restrictions in javascript, a
minimal http server is needed.
Additional Java Applet Files
Applet class interprettable: hp25b
Applet class interprettable: hp25bw
Applet source
Applet page
The applet per se is public domain, but the code is ugly. I had a peculiar
combination of design goals, none of which were making the code instructive,
maintainable, expandable, elegant or sexy.
Images are Copyright David G. Hicks, 1995, 1996, and 1997. You may use
them for non-commercial purposes as long as they are properly attributed.
(Regrettably, portions of the images are my own doing.)
On display at the Museum:
Larry
Leinweber, Proprietor
Return to Larry's Cerebral Snack Bar