User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - HP16C Version 2.0 Beta feedback »
Welcome, Guest. Please Login or Register.
Sep 24th, 2018, 10:44pm


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   HP16C Emulator
   HP16C Questions and Discussion
(Moderator: Jamie OConnell)
   HP16C Version 2.0 Beta feedback
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: HP16C Version 2.0 Beta feedback  (Read 4209 times)
RickN
Member
**



HP Calculator Enthusiast

   


Gender: male
Posts: 45
HP16C Version 2.0 Beta feedback
« on: Mar 11th, 2008, 10:43am »
Quote Quote Modify Modify

Hi Jamie,
 
Thanks for putting more time into the emulator.  It was unclear where you wanted feedback so I started this topic.  I haven't tried new features but did some regression testing by running all my existing programs on the Beta.  They all worked, including "approximate e to 7800 digits".  So far the biggest difference I see is in execution time.  Working at full speed, with the calculator and stack windows open while watching a program execute, I measured 9% faster execution time than the purchased version (good).  But with only the calculator window open and iconified, for the fastest operation possible, I measured 82% slower execution time -- almost twice as long to execute the program.  I realize this isn't that important to most users, but it surprised me.  (I compared version 1.4.0.22 to version 2.0.0.29 on the same PC.)
 
I will try to put more time into this, specifically looking more at the new features, before the end of March.
 
Thanks again,
Rick
 
« Last Edit: Mar 11th, 2008, 10:36pm by RickN » IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 1982
Re: HP16C Version 2.0 Beta feedback
« Reply #1 on: Mar 15th, 2008, 4:08pm »
Quote Quote Modify Modify

Thanks.  It turns out that this is an expected result of operation because of the way the Windows scheduler operates: minimized Windows are naturally set to a lower priority than foreground Windows.  Running a program in the emulator is done on a separate thread from the UI anyway, so you wouldn't likely see an improvement just by hiding the UI.
 
« Last Edit: Mar 15th, 2008, 6:49pm by Jamie OConnell » IP Logged

--Jamie
Music is its own reward.

RickN
Member
**



HP Calculator Enthusiast

   


Gender: male
Posts: 45
Re: HP16C Version 2.0 Beta feedback
« Reply #2 on: Mar 30th, 2008, 2:38am »
Quote Quote Modify Modify

Starting in full-resolution floating point mode ("f FLOAT ."), enter "1.234567890 EEX".  The real calculator displays "1.234567 00" and is ready for exponent digits.  The emulator displays "1.234567890" and ignores further digit entries.
IP Logged
RickN
Member
**



HP Calculator Enthusiast

   


Gender: male
Posts: 45
Re: HP16C Version 2.0 Beta feedback
« Reply #3 on: Mar 30th, 2008, 5:43pm »
Quote Quote Modify Modify

I see the online Help says "Known Differences, Index Register: In the hardware calculator, the Index register has 68 bits of width.  The Emulator uses an Index register of 64 bits width.   However; empirical tests show that the hardware calculator index register appears to roll over after 64 bits of counting, so the fact that the original register is 68 bits seems to be only an artifact of the hardware chip used to implement the device."
 
I posted the following 10/16/05 that disagrees with the above, and just verified it is still a visible difference between the emulator and real calculator: "What follows is contrived, but gives an easy way to see the difference between the HP-16C's 68-bit I register and the emulator's 64-bit.  Program to increment RegI and return 0|1 if it is 0|non-0: LBL A, 0, ISZ, 1, RTN.  Do these keystrokes: HEX, 0, WSIZE, UNSGN, 40, MASKL, STO I, GSB A.  The calculator gives 1 because its RegI has value 1<then 64 0 bits> and the emulator gives 0 because its RegI has value 0."
IP Logged
RickN
Member
**



HP Calculator Enthusiast

   


Gender: male
Posts: 45
Re: HP16C Version 2.0 Beta feedback
« Reply #4 on: Mar 30th, 2008, 5:58pm »
Quote Quote Modify Modify

on Mar 15th, 2008, 4:08pm, Jamie OConnell wrote:
Thanks.  It turns out that this is an expected result of operation because of the way the Windows scheduler operates: minimized Windows are naturally set to a lower priority than foreground Windows.  Running a program in the emulator is done on a separate thread from the UI anyway, so you wouldn't likely see an improvement just by hiding the UI.

I think you misunderstood my post.  I am comparing the behavior of 2 versions of the emulator under exactly the same Windows PC and runtime conditions, and the new version is way slower than the old.
 
Also (a separate subject) both old and new versions of the emulator do run significantly faster for a many-minute long program when all windows are iconified.  I use my "approximate e to 400 decimal places" program to see this.  Even if calculation and UI are different threads, there must be pacing and fixed buffer size between them such that for a long program, calculation can't go faster than the UI can respond.
« Last Edit: Mar 30th, 2008, 6:03pm by RickN » IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 1982
Re: HP16C Version 2.0 Beta feedback
« Reply #5 on: Apr 3rd, 2008, 6:16pm »
Quote Quote Modify Modify

I do not think I misunderstood at all.  Run the Windows Task Manager and sort by CPU%.  Look at the performance graph. Start a program running on the emulator and then minimize (iconify) it.  Regardless of whether you have performance set for services or for programs, you should see the performance graph slow significantly right after you minimize (iconify) the emulator.  This issue is completely controlled by the Windows OS -- Any program run minimized (iconified) is going to run quite a bit slower, although it also depends on what other OS services are running as well as other variables.
 
Differences between the two versions of the emulator likely have much to do with the fact I am using a newer version of the MSVC++ compiler.    
IP Logged

--Jamie
Music is its own reward.

Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 1982
Re: HP16C Version 2.0 Beta feedback
« Reply #6 on: Apr 3rd, 2008, 9:08pm »
Quote Quote Modify Modify

on Mar 30th, 2008, 5:43pm, RickN wrote:
I see the online Help says "Known Differences, Index Register: In the hardware calculator, the Index register has 68 bits of width.  The Emulator uses an Index register of 64 bits width.   However; empirical tests show that the hardware calculator index register appears to roll over after 64 bits of counting, so the fact that the original register is 68 bits seems to be only an artifact of the hardware chip used to implement the device."
 
I posted the following 10/16/05 that disagrees with the above, and just verified it is still a visible difference between the emulator and real calculator: "What follows is contrived, but gives an easy way to see the difference between the HP-16C's 68-bit I register and the emulator's 64-bit.  Program to increment RegI and return 0|1 if it is 0|non-0: LBL A, 0, ISZ, 1, RTN.  Do these keystrokes: HEX, 0, WSIZE, UNSGN, 40, MASKL, STO I, GSB A.  The calculator gives 1 because its RegI has value 1<then 64 0 bits> and the emulator gives 0 because its RegI has value 0."

 
Fair enough.  I can see your example -- can you think up any practical uses for that?  For what it's worth, the data I was citing was from a different discussion:
 
Quote:
> Do you suggest that those extra 4 bits would hold a multiplier to be applied
> to the "normal" value of the address register? The manual is
> surprisingly ambiguous as far as the formatting of the index register is
> concerned, so that this might be possible.
 
My guess is that it is not a multiplier but an additional four bits of
space to compute physical nybble addresses (when the word size is
greater than four bits) without throwing away the most significant
bits of the 64-bit integer.  To quote the manual:
 
  "A number stored in RI will be represented in a 68-bit format,
  numerically equivalent to the number in the X-register."  
  (Section 6,  p.68)
 
But the HP-16C index register hides even more puzzles:-
 
If you examine the behaviour of the index register with different word
size settings, using ISZ to find out where it rolls over to zero.
This invariably happens at 2^64, not 2^68.
 
Perhaps more interesting is to try this out in different complement
modes.  You will find that ISZ never skips in unsigned mode, skips at
FFF...FFFF in one's complement mode and at 000...0000 in two's
complement mode.  I guess this is correct behaviour.
 
Now see what happens if you change the complement mode after loading
the index register.  If you experiment with a little program like:  
 
    LBL A
    ISZ  
    GTO A
    R/S
 
setting up the complement mode, loading a suitable value into RI
(FFF...FFFE or less), changing the complement mode and seeing where
the routine stops, you will notice even stranger behaviour:-
 
* If you load RI in unsigned mode or two's complement mode and then
change mode before running the little routine above, the machine will
honour the mode that was in force _when_the_register_was_loaded_.
 
* If you try the same trick loading the register in one's complement
mode and then switching to unsigned mode, the machine will execute the
ISZ instruction as though it was in two's complement mode.
 
... This is probably a bug...
« Last Edit: Apr 3rd, 2008, 9:12pm by Jamie OConnell » IP Logged

--Jamie
Music is its own reward.

Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 1982
Re: HP16C Version 2.0 Beta feedback
« Reply #7 on: Apr 3rd, 2008, 9:10pm »
Quote Quote Modify Modify

on Mar 30th, 2008, 2:38am, RickN wrote:
Starting in full-resolution floating point mode ("f FLOAT ."), enter "1.234567890 EEX".  The real calculator displays "1.234567 00" and is ready for exponent digits.  The emulator displays "1.234567890" and ignores further digit entries.

 
Thanks!  I know this was working at one time, and I just got it working again -- although I see it was also broken in the shipped version.
IP Logged

--Jamie
Music is its own reward.

RickN
Member
**



HP Calculator Enthusiast

   


Gender: male
Posts: 45
Re: HP16C Version 2.0 Beta feedback
« Reply #8 on: Apr 4th, 2008, 2:54am »
Quote Quote Modify Modify

on Apr 3rd, 2008, 6:16pm, Jamie OConnell wrote:
I do not think I misunderstood at all.  Run the Windows Task Manager and sort by CPU%.  Look at the performance graph. Start a program running on the emulator and then minimize (iconify) it.  Regardless of whether you have performance set for services or for programs, you should see the performance graph slow significantly right after you minimize (iconify) the emulator.  This issue is completely controlled by the Windows OS -- Any program run minimized (iconified) is going to run quite a bit slower, although it also depends on what other OS services are running as well as other variables.

I think there is misunderstanding...  I am talking about execution time measured with a stopwatch, not CPU cycles per time period.  The emulator runs (completes its user program) over twice as fast when iconified as compared to being displayed.  For example, with calculator, stack, register, and program windows visible, run my "e to 400 decimal places program and watch LastX decrement from 211 to 1.  On my PC it takes about 520 ms/value.  Make the same measurement with all windows iconified.  (I start the stopwatch and iconify all 4 windows when LastX is 200, wait about 30 seconds, uniconify, note the value of LastX, and stop the stopwatch.)  208 ms/value, or over twice as fast, because all the user interface graphics updates are bypassed.  The emulator has much less of a job to do (no graphics updates), so completes its user program much faster.
IP Logged
RickN
Member
**



HP Calculator Enthusiast

   


Gender: male
Posts: 45
Re: HP16C Version 2.0 Beta feedback
« Reply #9 on: Apr 4th, 2008, 3:13am »
Quote Quote Modify Modify

on Apr 3rd, 2008, 9:08pm, Jamie OConnell wrote:
Fair enough.  I can see your example -- can you think up any practical uses for that?

The probability anyone would encounter a problem with a 64-bit index register instead of a 68-bit one is small, but I don't think that is the most important question.  Would you rather say "I believe the emulator gives the same results as all or most actual HP-16C programs"?  All it takes is one counter example to cast doubt on its performance.  I think it is more your burden to prove/believe that there is no practical use for a 68-bit register, and that a 64-bit substitute wouldn't cause anyone any problems.
IP Logged
RickN
Member
**



HP Calculator Enthusiast

   


Gender: male
Posts: 45
Re: HP16C Version 2.0 Beta feedback
« Reply #10 on: Apr 4th, 2008, 3:29am »
Quote Quote Modify Modify

on Mar 11th, 2008, 10:43am, RickN wrote:
...with only the calculator window open and iconified, for the fastest operation possible, I measured 82% slower execution time -- almost twice as long to execute the program.  I realize this isn't that important to most users, but it surprised me.  (I compared version 1.4.0.22 to version 2.0.0.29 on the same PC.)
on Apr 3rd, 2008, 6:16pm, Jamie OConnell wrote:
...Differences between the two versions of the emulator likely have much to do with the fact I am using a newer version of the MSVC++ compiler.

That is a big execution speed difference for just a compiler change, but maybe...  I thought it might be related to other changes like register bound management or floating point BCD arithmetic (although the program being measured doesn't do floating point operations).  Regardless, if speed is important, like "e to 7800 decimal places", the older version is way faster.  Like anyone other than me would notice...  Roll Eyes
« Last Edit: Apr 5th, 2008, 3:43pm by RickN » IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 1982
Re: HP16C Version 2.0 Beta feedback
« Reply #11 on: Apr 5th, 2008, 5:15pm »
Quote Quote Modify Modify

on Apr 4th, 2008, 3:13am, RickN wrote:

The probability anyone would encounter a problem with a 64-bit index register instead of a 68-bit one is small, but I don't think that is the most important question.  Would you rather say "I believe the emulator gives the same results as all or most actual HP-16C programs"?  All it takes is one counter example to cast doubt on its performance.  I think it is more your burden to prove/believe that there is no practical use for a 68-bit register, and that a 64-bit substitute wouldn't cause anyone any problems.

 
Ultimately, I would have to agree with that.  However; at this point I choose to document it as a non-conforming difference, albeit with different wording than that which caused you to point it out.
IP Logged

--Jamie
Music is its own reward.

Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.