<div dir="ltr"><div dir="ltr">On Mon, Oct 9, 2023 at 6:48 AM Hans Klaver <<a href="mailto:hklaver@dds.nl">hklaver@dds.nl</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
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. <br>
<br>
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.<br>I compiled and ran the procedure below to test this on Peter de Wachter's RISC emulator.<br></blockquote><div>...</div><div>... </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Could someone compile and run this test module on a hardware RISC5 FPGA board to verify the results?<br>
<br>
Is this a known issue? Does anyone have an explanation?<br>
<br>
<br>
Hans Klaver<br></blockquote><div><br></div><div>Hans,<br><br>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:<br> <br>   <a href="https://www.astrobe.com/RISC5/Workstation.htm">https://www.astrobe.com/RISC5/Workstation.htm</a><br><br>A simpler test which helps to eliminate some of the possible causes of the problem from further investigation is:<br><br>  Texts.WriteReal(W, SYSTEM.VAL(REAL, 3F8637BDH), 16)<br><br>this displays the incorrect result: 5.242880E+00. It should show: 1.048576E+00<br><br>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:<br> <br>  <a href="https://people.inf.ethz.ch/wirth/news.txt">https://people.inf.ethz.ch/wirth/news.txt</a><br> <br>Regards,<br>Chris<br><br>Chris Burrows<br>CFB Software<br><a href="https://www.astrobe.com/RISC5">https://www.astrobe.com/RISC5</a><br></div><div><br></div></div></div>