The Museum of HP Calculators

HP Forum Archive 18

[ Return to Index | Top of Index ]

HP67/97 RND Function
Message #1 Posted by Mike T. on 25 Feb 2008, 10:25 a.m.

Are STO RND and RCL RND valid instructions on the HP67C/97C?

Thanks.

Mike T.

      
Re: HP67/97 RND Function
Message #2 Posted by Valentin Albillo on 25 Feb 2008, 11:04 a.m.,
in response to message #1 by Mike T.

No. And, by the way, they are "HP-67/HP-97", no "C" as they lack Continuous Memory which is what the "C" stands for.

Best regards from V.

Edited: 25 Feb 2008, 11:05 a.m.

            
Re: HP67/97 RND Function
Message #3 Posted by Mike T. on 25 Feb 2008, 5:50 p.m.,
in response to message #2 by Valentin Albillo

Thank you Valentin, your comments are very helpful as ever.

In particular thanks for remindimg me that the memory on the machines IS NOT continious...

Mike T.

                  
Re: HP67/97 RND Function
Message #4 Posted by Valentin Albillo on 25 Feb 2008, 7:09 p.m.,
in response to message #3 by Mike T.

Hi, Mike:

Mike posted:

    "Thank you Valentin, your comments are very helpful as ever. In particular thanks for remindimg me that the memory on the machines IS NOT continious..."

      You're welcome. May I remind you as well that the RND function in the HP-67 has nothing to do with "RaNDom number generation" but with "RouNDing a number" to match what appears in the display.

      Because your asking for "STO RND" and "RCL RND" a la HP-15C makes me think you're confusing both. :-)

Best regards from V.
                        
Re: HP67/97 RND Function
Message #5 Posted by Mike T. on 26 Feb 2008, 11:28 a.m.,
in response to message #4 by Valentin Albillo

Very perceptive of you and as usual you are correct - except that I was assuming that the HP67 RND function matched the HP11C!

Thanks

Mike T.

                              
Re: HP67/97 RND Function
Message #6 Posted by Valentin Albillo on 26 Feb 2008, 6:54 p.m.,
in response to message #5 by Mike T.

Hi again, Mike:

    "[...] except that I was assuming that the HP67 RND function matched the HP11C! "

      But you asked about STO RAN and RCL RAN and only the HP-15C has both, the HP-11C can do the STO RAN part but is missing the RCL RAN (and of course, the HP-67 has neither).

      Thus, it was only logical to assume you were referring to the HP-15C full implementation as you mentioned both functions, not one.

      Also, if you plan to implement them in some simulator/emulator of yours not ROM based, be aware that in the HP-15C, STO RAN will accept any numeric argument but RCL RAN will 'normalize it' so that it's always recalled as a positive value between 0 (included) and 1 (not included), with possible truncation for small arguments. For instance:

                   0.5, STO RAN, RCL RAN ->  0.5          (intact)
                    PI, STO RAN, RCL RAN ->  0.3141592654 (scaled)
          -314.1592654, STO RAN, RCL RAN ->  0.3141592654 (scaled, sign changed to positive)
        3.141592654E-3, STO RAN, RCL RAN ->  0.0031415926 (truncated, 2 last places missing) 
      

      You must take that complicated behavior into account if you want your implementation to be able to run HP-15C programs like a physical unit would for compatibility purposes.

Best regards from V.

Edited: 26 Feb 2008, 7:05 p.m.

                                    
Re: HP67/97 RND Function
Message #7 Posted by Mike T. on 27 Feb 2008, 4:12 a.m.,
in response to message #6 by Valentin Albillo

Exactly what I expected of the RND function (I'd spotted an earlier post on the same subject).

I sorted out the RouNDing function last night - had to resort to string manipulation (as usual) to get the answer I wanted. Many thanks for pointing out the differences in behaviour, unfortunatly I don't think I'm ever going to get round to implementing an HP15C simulator but an HP11C is definatly on the cards...

Mike T.

      
Re: HP67/97 RND Function
Message #8 Posted by Namir on 25 Feb 2008, 12:14 p.m.,
in response to message #1 by Mike T.

Mike,

Seems like you are also working on HP97 simulator (as well as one for the HP67)?

Namir

            
Re: HP67/97 RND Function
Message #9 Posted by Mike T. on 25 Feb 2008, 5:42 p.m.,
in response to message #8 by Namir

Well not at the moment ... but it shouldn't be too difficult as when I originally decided to rewrite my HP33C simulator a couple of years ago the intention was to restructure the code to allow me to use the same code to simulate a number of different models.

As a result about 20% of the code I use in each of my simulators now is now exactly the same, but can't be shared except by cut and paste, and about 65% is in shared modules, leaving at the most only about 15% specific to each model - the percentages are guesstimates but you get the idea..

As regards the HP67 simulator, now that I don't have to worry about sto rnd and rcl rnd 'all' I've got left to do is work out how to handle w/data, merge, prt reg, prt x sensibly, then add something to allow programs to change the 'user defined' labels when they are loaded, before trying to test every thing (again).

I think the next thing I'll do after the HP67 is finish off the HP11C simulation - it just looks so cool on my screen (and I liked the HP11C enough to buy one so I have the real thing to check the simulation against. Though I think that the HP33C is still my favourite even if a bit short on memory)...

Mike T.

Edited: 26 Feb 2008, 6:03 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall