RPN 50g — rebuilding a calculator, chip by chip

Portfolio

PA
∇⋅E = ρ/ε₀
E = mc²
S = k log W
F = ma
All posts

Shipping

A model of the HP 49g+/50g hardware written from the reference manuals, faithful enough for HP's original firmware to run on it without noticing.

Platforms
iPhone, iPad, Mac, Windows
Emulated hardware
ARM920T, Samsung S3C2410, flash, keyboard, display, SD card
Built with
C and Swift

The problem

The HP 50g is one of the last calculators engineers learned by heart: reverse Polish notation, the RPL language, symbolic algebra, physical units checked at every operation. It is no longer made. Partial rewrites give you a calculator that looks like the original without behaving like it — and on a machine of this kind, one rounding that differs makes everything else suspect.

What I built

Rather than rewriting the behaviour, I rebuilt the machine: the ARM920T processor, the Samsung S3C2410 controller and its peripherals, the flash memory, the keyboard matrix, the display, the SD card. The model is written from the manufacturer's reference manuals, without ever reading anyone's code. On top of it, HP's original firmware runs untouched: the full computer algebra system, RPN and RPL, units, matrices, two- and three-dimensional plots. The SD card, meanwhile, is a real folder, visible in Files and in the Finder.

What was hard

An emulator is either right or useless; there is no middle ground. Mistakes do not show up where they are made — a condition bit set wrongly in a rare instruction surfaces three thousand instructions later as a frozen screen. The machine had to be made observable step by step, then held against what the real one does, until the two could no longer be told apart.

Where it stands

Shipping on the App Store for iPhone, iPad and Mac, and in the Microsoft Store for Windows. It is the first of the eight calculators in the RPN family.