[Oberon] Wrong results of selected REAL multiplications

Chris Burrows cfbsoftware at gmail.com
Wed Oct 11 01:53:02 CEST 2023

On Mon, Oct 9, 2023 at 6:48 AM Hans Klaver <hklaver at dds.nl> wrote:

> Hi all,
> Recently when looking into seemingly wrong output of my code for
> Texts.WriteReal and Texts.WriteRealFix I discovered that Project Oberon
> RISC5 floating point multiplication gives wrong results for certain
> selected values.
> Specifically when multiplying a number containing the digits of a whole
> power of 2 by a whole power of 10 sometimes results in *half* the value of
> the right result; this only occurs when the result is (the REAL
> representation of) an exact whole power of 2; but puzzlingly in some of
> these cases the error is not produced.
> I compiled and ran the procedure below to test this on Peter de Wachter's
> RISC emulator.

> Could someone compile and run this test module on a hardware RISC5 FPGA
> board to verify the results?
> Is this a known issue? Does anyone have an explanation?
> Hans Klaver


I can confirm that I can reproduce the problem on currently available
Project Oberon FPGA RISC5 Workstation hardware using Wirth's latest
official Project Oberon sources:


A simpler test which helps to eliminate some of the possible causes of the
problem from further investigation is:

  Texts.WriteReal(W, SYSTEM.VAL(REAL, 3F8637BDH), 16)

this displays the incorrect result: 5.242880E+00. It should show:

The problem does not occur on a April 2016 verison of Peter's emulator.
This leads me to suspect that the problem may have been introduced during
the changes to the Floating Point-related Verilog files that were made
between 8 Aug 2016 and 3 Oct 2016 as summarised here:



Chris Burrows
CFB Software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20231011/ec688ebd/attachment.html>

More information about the Oberon mailing list