[Oberon] FP

Jan Verhoeven jan at verhoeven272.nl
Tue Apr 15 10:33:08 CEST 2014

Hi all,

Back in 1982 when trying to understand the ZX81 (Z80 based personal 
computer) I ran into the Floating point routines. At first it was a bit 
difficult to understand, but after a few hours it became clear:

An FPnum consisted of three machine words for the mantissa and one 
machine word for the exponent. It nicely fitted inside a Z80 QuadWord.

Our latest 2014 FPGA processor (and hence the emulator) uses 1/4 
machineword for the exponent and 3/4 machineword for the mantissa.

Why don't we use one 32-bit integer for the exponent and one 32 bit word 
for the mantissa?
It would make things so much more easier. And faster. Now each FPnum 
must be shifted, masked, shifted back, remasked, etc. All of it is 
unnecessary. It is a tribute to the ZX81 Basic.

We could even go one step beyond! Define an FPnum as 32 bits exponent 
and 64 bit mantissa. This results in a 1 billion digit exponent 
(10^10^9) and an 18 digit mantissa.


Jan Verhoeven

More information about the Oberon mailing list