saturnus docs
Open the app

The CPU

The Saturn is HP's own 4-bit processor. It works on nibbles, half a byte each, but its main registers hold 64 bits, so that one register holds a whole floating-point number. The same core runs the HP 48SX, the 48G series, the 49G and the 38G, 39G and 40G.

At a glance

Data path4 bits: one nibble per memory access
Addresses20 bits, counting nibbles: 1 M nibbles, 512 KB
Working registersA, B, C and D, 64 bits (16 nibbles) each
Scratch registersR0 to R4, 64 bits each
Data pointersD0 and D1, 20 bits each
Return stack8 levels of 20 bits, in the CPU
Arithmetichexadecimal or decimal (BCD), switched by an instruction
Clockabout 2 MHz on the 48SX, about 4 MHz on the G series and the 49G
Chipthe 1LT8 core, inside HP's Clarke (48SX) or Yorke (48G, 38G, 39G, 40G, 49G)

A processor built for a calculator

The Saturn first appeared in the HP 71B of 1984, as the 1LF2 chip. A later version, the 1LK7, ran the 71B, the 18C and the 28C, and the 1LT8 core went into the 48SX, the 48G series and the 38G. In the 48SX the CPU sits inside the Clarke chip, together with the display controller, the timers, the serial port and the memory controllers; in the 48G series it sits inside the Yorke. The Pioneer calculators (17B, 27S, 42S) and the 28S use the Lewis, a chip of the same family with its own memory interface.

HP designed it around its decimal floating-point format. A number takes 16 nibbles: a sign nibble, 12 nibbles of mantissa and three nibbles of exponent with its sign. That is exactly one 64-bit register, and most instructions can work on a part of it (a field, below). In decimal mode the adder works in BCD, so the mantissa needs no conversion.

Registers

The four working registers A, B, C and D do the arithmetic. They cannot all be combined freely: D pairs only with C, B with A or C, and only A and C exchange with the scratch registers, the data pointers and memory. The five scratch registers R0 to R4 can only be copied to and from A and C, or exchanged with them.

D0 and D1 hold addresses. Every memory read or write goes through one of them, and both can be moved forward or back by 1 to 16 nibbles in one instruction.

The other registers:

RegisterWidthWhat it does
PC20 bitsthe program counter
P4 bitspoints at one nibble of a working register, for the P and WP fields
RSTK8 × 20 bitsthe return stack for subroutine calls
ST16 bitsprogram status flags; programs use the low 12, the operating system the top 4
HST4 bitshardware status: module missing, sticky bit, service request, module pulled
CARRY1 bitset by an arithmetic overflow, and by a test that is true
IN16 bitsan input port, read only: the keyboard's columns
OUT12 bitsan output port, write only: the keyboard's rows and the beeper

The return stack holds eight return addresses. A ninth call drops the oldest one, and a return from an empty stack reads zero, which sends the program to address 0. The interrupt system needs one or two levels of it, so a program that calls subroutines seven or eight deep while interrupts are on loses its oldest return address. Six levels deep is safe.

OUT cannot be read back. Software that changes it keeps a copy in RAM, so that the interrupt handler can put it back afterwards.

Fields

An instruction that works on a working register names a field: the nibbles it touches. The fields follow the layout of a floating-point number.

FieldNibblesMeaning
W15 to 0the whole register
S15the mantissa's sign
M14 to 3the mantissa
X2 to 0the exponent with its sign
XS2the exponent's sign
B1 to 0one byte
A4 to 020 bits: an address
PPthe nibble P points at
WPP to 0from nibble P down to nibble 0

So A=A+B M adds the mantissas of A and B and leaves the sign and the exponent alone. The A field is used so often for addresses that many instructions have a shorter form for it.

Values in memory are little-endian: the nibble at the lowest address goes into nibble 0 of the register. The same holds for constants inside instructions.

The instruction set

Instructions are two or more nibbles long; one that loads a 16-nibble constant carries all 16 nibbles in the instruction. They fall into a few groups:

SETHEX and SETDEC switch the adder between hexadecimal and decimal. The mode applies only to register arithmetic. There is no instruction to read the mode back, and some instructions always count in hexadecimal whatever the mode: moving D0 or D1, changing P, and adding or subtracting a small constant.

The 49g+, 50g and later models run an emulated Saturn on an ARM processor. Their "Saturn+" adds multiply, divide and other instructions, which the real Saturn does not have.

Speed

The 48SX's clock is about 2 MHz, the 48G series and the 49G run at about 4 MHz, from a 32 kHz crystal multiplied up. The clock does not tell the whole story:

A benchmark on the HP Museum forum times the same sum of 1,000 terms on real calculators: 95.5 s on a 48SX, about 55 s on a 48GX and about 48 to 51 s on a 49G, whose ROM was tuned for speed.

ModelClockChip
HP 48SXabout 2 MHzClarke
HP 48G, 48G+, 48GXabout 4 MHzYorke
HP 38Gabout 4 MHzYorke
HP 39G, 40Gabout 4 MHzYorke
HP 49Gabout 4 MHzYorke
HP 42S, 27S, 17B, 17BIIabout 1 MHzLewis

saturnus times every instruction with the published cycle counts and the display's stalls, then scales the 48SX, 48GX and 49G by factors measured against that benchmark, so that programs take as long as on those calculators. The 38G takes the 48GX's factor and the 39G and 40G the 49G's, and the other models run at an assumed speed: none of them was timed against a real calculator. See the HP 48GX page for how that looks in the app.

Sources