<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Following feedback from Prof Wirth I have managed to improve the performance of the numeric CASE statement  in RISC5 Oberon by implementing a variant of the Branch Conditional instruction in the RISC5 processor.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The standard branch via register instruction is <o:p></o:p></p><p class=MsoNormal>    BR,cond [Rn]<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The new variant of this instruction is <o:p></o:p></p><p class=MsoNormal>    BR,cond  PC,[Rn] <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>i.e. the target of the branch is computed by adding the contents of register n to the current program counter.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Consequently, the average overhead of any selection in a CASE statement, including range checking, is now a constant 6 instructions. The average overhead of any selection in an IF THEN ELSE statement is (N + 1) * 2 instructions. Hence, in situations where there is an equal probability of each selection occurring CASE is faster than IF whenever there are more than 2 selections.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This latest (v6.4) release of Embedded Project Oberon is based on the current Project Oberon and Verilog sources from Prof Wirth’s site. It’s available for no charge for Saanlima Electronics’ Pepino LX9 (Spartan-6)  as well as Digilent’s Arty-S7 (Spartan-7), Arty and Cmod-A7 (Artix-7) development boards:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   <a href="http://www.astrobe.com/RISC5">http://www.astrobe.com/RISC5</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal>Chris Burrows<o:p></o:p></p><p class=MsoNormal>CFB Software<o:p></o:p></p><p class=MsoNormal><a href="http://www.astrobe.com">http://www.astrobe.com</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>