Post Reply 
HP16C behavior on overflow when entering numbers?
07-29-2023, 02:01 AM
Post: #1
HP16C behavior on overflow when entering numbers?
Hi all,

I have a question about numeric entry on an HP16C, for an enhancement to my 16C simulator (https://jrpn.jovial.com/). Could someone with an actual 16C try out these examples for me, please? The enhancement is described at https://github.com/zathras/jrpn/issues/53

My guess is that behavior in 8 bit decimal signed 2's complement mode when pressing digits without pressing enter would be:
255777777 gives -1
254777777 gives -2
256777777 gives 25
256477777 gives -2 (the 6 is ignored, but the 4 isn't)

and in 10 bit decimal signed 2's complement mode:
5127777777 gives -512
1023777777 gives gives -1
1024777777 gives 102
1024177777 gives -3

Right now, my simulator isn't stopping before overflow, so e.g. pressing the 7 key continues to change the display - not altogether unreasonable, but it seems that's not what the real 16C does. My simulator is cleanroom, and I don't own a 16C, so the example on page 37 of the owner's handbook was all the specification I had. It doesn't say what happens if you overflow, rather than just having bits propagate into the sign bit.

So: Now my theory is that, during digit entry, it's OK if bits propagate to the sign bit, but keystrokes that result in actual overflow are ignored. I think my four examples above are sufficient to tell me if this is right!

Cheers,

Bill
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP16C behavior on overflow when entering numbers? - billf - 07-29-2023 02:01 AM



User(s) browsing this thread: 1 Guest(s)