Est. 1982 Intermediate

HP-16C

Hewlett-Packard's 1982 "Computer Scientist" pocket calculator, a keystroke-programmable RPN machine whose integer mode could imitate any word size from 1 to 64 bits in unsigned, one's or two's complement arithmetic.

Created by Hewlett-Packard, Corvallis, Oregon (software: Eric Evett, John VanBoxtel, Rich Carone)

Paradigm Stack-based (RPN keystroke programming, fully merged key codes)
Typing Untyped words: integers in a user-selected 1 to 64-bit word size (unsigned, one’s or two’s complement) or decimal floating point
First Appeared 1982
Latest Version Original HP-16C (1982-1989); HP-16C Collector’s Edition re-release by licensee Moravia (2026)

The HP-16C Computer Scientist is a programmable pocket calculator that Hewlett-Packard sold from 1982 to 1989. It was built for people who work with bits. Switched into integer mode, it shows numbers in hexadecimal, decimal, octal or binary, and it can be set to match the arithmetic of a particular computer: any word size from 1 to 64 bits, treated as unsigned, one’s complement or two’s complement. It then sets carry and overflow flags the way that computer would. Its programming language is HP’s keystroke programming: a program is a recorded sequence of key presses operating on a four-level RPN stack, with labels, subroutines, flags and conditional tests. The Museum of HP Calculators calls it HP’s “first (and so far only)” programmer’s calculator.

History and Origins

By the early 1980s HP’s Corvallis, Oregon division was building the Voyager series, a family of landscape-format pocket calculators with low-power LCDs and continuous memory, which keeps programs and data while the calculator is off. The HP-16C was the Voyager for programmers and logic designers. HP’s May 1983 Journal described the problem it was meant to solve:

“A large amount of tedious paper work is often required to convert among number bases, perform logic operations, shift and rotate bits in a word, or check processor instruction flow.”

The same article credits the software team. Eric Evett, who also wrote parts of the HP-11C and HP-15C microcode, wrote the article; John VanBoxtel “developed many of the fundamental design concepts”; Rich Carone worked on the software design and wrote the display formatting routines; Stan Blascow did much of the testing; and Diana Roy wrote the owner’s handbook.

The 16C was introduced in 1982 at $150 and discontinued in 1989, according to the Museum of HP Calculators. Wikipedia’s infobox gives a price of $120 by 1989. The 16C shares the keystroke-programming system of its Voyager siblings, the HP-11C and HP-15C. Like them, it runs on HP’s “Nut” processor architecture; the modern SwissMicros replica describes its own firmware as an ARM microcontroller “emulating the NUT processor”.

Design Philosophy

The museum sums up HP’s approach: rather than doing generic binary arithmetic, the 16C was designed to be “configurable to match the computer the user was currently working with”. Three settings define that machine:

  • Number base: HEX, DEC, OCT or BIN, for display and entry. Hex digits appear as A b C d E F, with lower-case b and d so they cannot be confused with 8 and 0 on a seven-segment display.
  • Word size: WSIZE takes any value from 1 to 64 bits. In unsigned mode with 64-bit words, the largest number is 2^64 − 1 (18,446,744,073,709,551,615).
  • Complement mode: 1'S, 2'S or UNSGN.

Once set, ordinary keys behave like that machine’s ALU. Addition sets the carry flag on a carry out of the most significant bit, a left shift sets it when a 1 falls off the left end, and the overflow flag is set whenever the true result cannot be represented in the chosen word size and complement mode. The display normally shows the eight least significant digits, and it can be scrolled a digit or a window at a time to see the rest of a long binary number.

The calculator also has a decimal floating-point mode, entered with FLOAT, but outside the programmer functions its mathematics is deliberately thin: the four arithmetic operations, square root and reciprocal.

Key Features

Bit manipulation

GroupOperations
LogicAND, OR, XOR, NOT
Shiftslogical left/right (SL, SR) and arithmetic right (ASR)
Rotatesone position or n positions, left or right, with or without the carry (RL, RR, RLC, RRC, RLn, RRn, RLCn, RRCn)
Masks and bitsMASKL, MASKR (masks of n bits), SB/CB/B? (set, clear and test a bit), #B (count set bits), LJ (left-justify)
Double-word arithmeticDBLx (single × single → double result), DBL÷ and DBLR (double-length dividend)

Integer and floating point together

Switching modes is itself a conversion tool. When you press FLOAT, the integers y and x in the Y and X registers are combined into the floating-point value y × 2^x. Pressing a base key turns the X value back into a pair of integers: y is a 32-bit mantissa and x an exponent. HP used this to write routines that pack and unpack other machines’ binary floating-point formats.

The programming model

The 16C uses keystroke programming in its “fully merged” form, where a shifted key and its argument take a single step. Programs work on the RPN stack (X, Y, Z, T, plus LSTx). According to the 1983 Journal, the language provides:

  • 16 labels: 0–9 and A–F, called with GSB and jumped to with GTO.
  • Subroutines nested up to four levels deep.
  • Conditional tests that skip the next step when false, such as x≠0 and F? (flag test).
  • Six flags. Flags 0–2 are general-purpose. Flag 3 shows leading zeros, flag 4 is the carry (the C annunciator), and flag 5 is overflow (the G annunciator).
  • Editing and debugging: insert, delete, back-step, single-step and go-to-line.
  • An index register, I, used for loop counters (DSZ, ISZ) and indirect addressing.

Memory: 203 bytes, shared

There are 203 bytes of user memory, and each program step takes one byte. Storage registers are carved from the same space and their size follows the word size, so with 8-bit words and no program there are 203 registers, while 16-bit words leave 101. The museum notes that register size is rounded up to the nibble, so a 15-bit word size also yields 101 registers. Each program step added takes away from the register pool.

An example from HP

This routine is reproduced from Evett’s 1983 article. It simulates a CPU add-with-carry instruction (Y + X + carry → X), using flag 4 as the carry flag and flag 0 as scratch:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
001  LBL A     label the subroutine
002  0
003  RLC       rotate 0 left through carry: gives 0 or 1
004  +         add the carry to the second operand
005  CF 0      copy carry flag 4 into flag 0 ...
006  F? 4
007  SF 0
008  +         add the first operand to the total
009  F? 0      if the first add carried,
010  SF 4      set the carry flag
011  RTN

With 2'S, HEX, an 8-bit word size and the carry cleared (CF 4), keying FE ENTER 72 GSB A displays 70 with the C annunciator lit, because FE + 72 = 170 hex overflows 8 bits.

The binary-to-Gray-code conversion from the same article shows how compact the bit operations make such work:

1
2
3
4
5
001  LBL C
002  ENTER     copy the binary number into Y
003  SR        shift X right one bit
004  XOR       Gray code = B XOR (B >> 1)
005  RTN

Evolution

The HP-16C itself never changed in production; it was a single model from 1982 to 1989. Its ideas moved on in three ways:

  • Into later HP calculators. According to Wikipedia, HP incorporated many of the 16C’s functions into later scientific and graphing models; the HP-42S (1988), for example, has number-base conversion and bitwise logic in its BASE menu. HP never built another dedicated programmer’s calculator.
  • Into re-creations. SwissMicros sells the DM16L, a titanium-cased replica in the original’s size and layout, which runs the original code on an emulated Nut processor using a 32-bit ARM Cortex-M0 microcontroller. In 2023, HP’s licensee shipped the HP-15C Collector’s Edition with an undocumented 16C emulation mode reached through the test menu. In 2026, Moravia released an official HP-16C Collector’s Edition, reportedly limited to 10,000 units. Retailers describe it as adding program save and restore and as faster than the original; some coverage repeats an “up to 100× faster” figure, but no benchmark or test program has been published, so treat that number as marketing. It is reportedly built on the same kind of ARM-based platform as the 15C Collector’s Edition.
  • Into software. Many simulators exist. Bill Foote’s JRPN, started in 2021, is a clean-room 16C (and 15C) simulator still releasing in 2026, and Wikipedia describes the public-domain, open-source WRPN as one of the oldest HP-16C simulators still in development.

Current Relevance

The 16C is a collector’s item. The Museum of HP Calculators notes how much mail it receives praising the model, even though HP never followed it up, which the museum takes to mean sales were poor. For anyone who wants to use the language today, there are three options: an original calculator, which keeps its program in continuous memory on three button cells; the 2026 Collector’s Edition; or a simulator such as JRPN. No Docker image exists, and none would make sense, because the “runtime” is a calculator.

The problem the 16C solved has not gone away. Embedded programmers, reverse engineers and people who write device drivers still check two’s-complement overflow, build masks and convert between hex and binary. The programmer modes of many modern software calculators cover much of the same ground.

Why It Matters

The HP-16C was an early, and unusually thorough, attempt to put a configurable model of a computer’s arithmetic in a shirt pocket. Many programmer’s calculators could convert between bases; the 16C let you declare that your machine had 12-bit one’s-complement words and then calculate exactly as that machine would, flags included. Its keystroke language was small: 203 bytes, 16 labels and four subroutine levels. Combined with that instruction set, though, it was enough to simulate missing CPU instructions or unpack a minicomputer’s floating-point format, as HP’s own engineers showed in 1983. More than forty years later, it was still in enough demand for HP’s licensee to put it back into production.

Timeline

1982
Hewlett-Packard introduces the HP-16C Computer Scientist, a member of its Voyager series of pocket calculators, at a US price of $150. It is the first calculator HP designed specifically for programmers
1983
The May 1983 Hewlett-Packard Journal publishes Eric Evett's article "A Pocket Calculator for Computer Science Professionals", which documents the integer mode, the 203-byte memory and sample programs for add-with-carry, bit-field extraction, Gray code and HP 3000 floating-point conversion
1988
HP introduces the HP-42S, a general scientific calculator whose BASE functions include number-base conversion and bitwise logic, one of the later models into which HP carried 16C-style functions. HP never makes a second dedicated programmer's calculator
1989
HP discontinues the HP-16C
2021
Bill Foote creates the GitHub repository for JRPN, a clean-room simulator inspired by the HP-16C (and later the HP-15C), still receiving releases in 2026
2023
HP's licensee releases the HP-15C Collector's Edition. An undocumented test-menu option switches it into a mode that emulates the HP-16C. According to Wikipedia, a display bug inherited from the original firmware, affecting numbers whose hexadecimal form ends in E or F, was fixed by a community effort in October 2023
2026
Moravia, HP's calculator licensee, releases an HP-16C Collector's Edition, reportedly limited to 10,000 units, with program save and restore added. Pre-orders opened around May 2026, with US shipping expected from mid-August

Notable Uses & Legacy

Simulating processor instructions

HP's own 1983 article shows the 16C programmed to behave like a CPU instruction it lacks: an 11-step add-with-carry routine that adds X, Y and the carry flag and sets the carry on overflow out of the top bit, run in 8-bit two's complement hexadecimal.

HP 3000 floating-point conversion

The same article lists a pair of subroutines that convert between the HP 3000 minicomputer's 32-bit FORTRAN real format and decimal, using the 16C's FLOAT mode change and 16-to-32-bit word-size switching. The routines also have to reverse bit numbering, because the HP 3000 calls its most significant bit bit 0.

IEEE floating-point format work

According to the Museum of HP Calculators, HP supplied two programs to convert between the 16C's floating-point format and the IEEE binary format, which was still only a proposed standard when the calculator shipped.

Logic design and code conversion

Evett's article presents the 16C as a tool for digital electronics as well as programming, with five- and ten-step routines for converting between binary and Gray code and a routine for extracting an arbitrary bit field from a word.

Language Influence

Influenced By

HP-11C (Voyager keystroke programming)

Influenced

HP-42S

Running Today

Run examples using the official Docker image:

docker pull
Last updated: