HP-16C sim update (I've implemented the most-requested functions)


I lied. I haven't implemented the 1.2m wide bitmap for VPN. ;-)

BUT wait; there's more...

I have implemented the ON button and two of its functions: CM reset and digit group/radix point swap. Aside from billboard-sized bitmaps, these were the most-requested options.

It's come a long way in the last two months so if you haven't been to my site for a while, drop by and grab yourself a copy. I welcome all feedback--both positive and negative.

As of today, the only functions that I'm not simulating are:

[f] MEM - memory usage
ON [D] - unknown function.
ON [A] - unknown function.
ON [x] - self test
ON [/] - keyboard display test
ON [+] - continuous self test

Future directions:

In the cosmetics department, I'm looking into using Luiz's fine Voyager character set.

As for the simulation engine, I will "partition" program and register storage and clamp the upper limit at 203 bytes. I'll then implement the last (useful) function: [f]MEM. The memory clamp will be a removable option.

Next will be two-digit labels and user flags 6-9. These too will be disabled via the options panel.

Beyond that, depending on my mood, I may continue work on the 56-bit BCD simulation. On that score, does anyone know the SQRT algorithm used in the Voyagers?

Also, does anyone know what ON/A and ON/D actually do? I can fake them by "randomly" re-ordering the bits in X but I'm interested to know if there's anything there worth simulating.

Thanks for all your kind words and support. Apologies to readers who don't like blatant self-publicity. In my defense I can only say that I'm proud of my work and I believe it has been greatly enhanced by the input of those who visit this forum.


16C site


Beyond that, depending on my mood, I may continue work on the 56-bit BCD simulation. On that score, does anyone know the SQRT algorithm used in the Voyagers?

The general algorithm for the square root uses Newton's method. To find the square root x of a number N:

1. x2 = N / 2
2. loop
2.1 x1 = x2
2.2 x2 = (x1 + N / x1) / 2
2.3 until abs(x1-x2) < tolerance_level
3. return x2



Thanks Namir. I tapped it into my (real) 16C and I get results that differ from the "native" SQRT function. On the sim, which currently uses 64-bit IEEE 754 binary floating point, I get the same result as the "native" SQRT (for every sample I've tried). Can you, or anyone else, give me a clue as to what's happening here?

Here's the program I'm using:

1. x2 = N / 2
2. loop
2.1 x1 = x2
2.2 x2 = (x1 + N / x1) / 2
2.3 until abs(x1-x2) < tolerance_level
3. return x2

+02 ENTER ; N # # #
+03 ENTER ; N N # #
+04 [2] ; 2 N N #
+05 ENTER ; 2 2 N N
+06 Rv ; 2 N N #
+07 [/] ; x=N/2 N 2 #
+08 R^ ; # x N 2


+10 Rv ; x N 2 #
+11 X-Y ; N x 2 #
+12 ENTER ; N N x 2
+13 Rv ; N x 2 N
+14 X-Y ; x N 2 N
+15 [/] ; N/x 2 N N
+16 LSTx ; x N/x 2 N
+17 [+] ; x+N/x 2 N N
+18 LSTx ; x x+N/x 2 N
+19 Rv ; x+N/x 2 N x
+20 X-Y ; 2 x+N/x N x
+21 [/] ; x+N/x/2 N x x
+22 LSTx ; 2 x+N/x/2 N x
+23 Rv ; x+N/x/2 N x 2
+24 Rv ; N x 2 x+N/x/2
+25 X-Y ; x N 2 x+N/x/2
+26 R^ ; x+N/x/2 x N 2
+27 [-] ; lim N 2 2
+28 LSTx ; x+N/x/2 lim N 2
+29 X-Y ; lim x+N/x/2 N 2
+30 ABS ; |lim| x+N/x/2 N 2
+31 X!=0?

+33 Rv ; x+N/x/2 N 2 r
+34 RTN

My "tolerance level" is epsilon. The octothorpe in the stack diagrams means "don't care".




Hi Cameron, please keep up the great work and complete your simulator. The f MEM function seems the next best thing to do and I agree that if you are going to limit or clamp memory to 203 bytes for authenticity, then an option to go way beyond 203 would still be very nice to have.

Extending labels and flags is a great idea.
The test functions would be a neat way to complete the simulation of the real calc, but then how about some useful extensions beyond the real thing.

How about being able to bring up an extra window showing the dynamic contenets of the stack, memory registers and program by pressing the hp 16C badge?



How about using the sequence of clicking the [f] key, the [g] key, and then any other key to support additional operations. You can also support even more additional operations reference the sequence and click the [g] and then the [f] and then another key.



I have just found that pressing the badge shows the back. This is a lovely touch which you shouldn't change, so we need a different way to open a stack and memry content window, so I suggest a menu option, but then also an instant on-off toggle button by clicking on the display?

Possibly Related Threads...
Thread Author Replies Views Last Post
  Bought a 16C to compensate a little Eelco Rouw 23 3,317 12-07-2013, 01:26 PM
Last Post: Eelco Rouw
  I can't update HP Prime JavierLopez 7 1,468 12-06-2013, 10:37 AM
Last Post: JavierLopez
  HP Prime - CAS functions in Spreadsheet App CR Haeger 6 1,157 11-11-2013, 12:37 AM
Last Post: Michael de Estrada
  [41CL] New Extra Functions version Monte Dalrymple 0 513 11-08-2013, 04:32 PM
Last Post: Monte Dalrymple
  HP Prime: in need of help with defining functions Alberto Candel 14 1,908 10-27-2013, 10:48 AM
Last Post: Alberto Candel
  Shiny new 16C! Keith Midson 7 1,144 10-27-2013, 02:22 AM
Last Post: Keith Midson
  HP Prime spreadsheet functions SanS 0 1,049 10-04-2013, 04:23 AM
Last Post: SanS
  Stats functions on the HP34S Nicholas van Stigt 5 895 09-24-2013, 02:45 AM
Last Post: Nick_S
  Joys of eBay: HP-32S, HP-32SII, HP-42S, HP-16C, ... Sasu Mattila 7 1,099 09-23-2013, 04:39 PM
Last Post: Julián Miranda (Spain)
  Trig Functions Howard Owen 11 1,559 09-16-2013, 02:53 PM
Last Post: Fred Lusk

Forum Jump: