The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Emulators
Message #1 Posted by Mike (Stgt) on 27 Oct 2004, 6:34 a.m.

Well, we have Emu41, V41, Emu71, and Emu48, Emu42, and Emu28, and HP-41X, -42X, -71X, and TI95E. Alas not all ROMs for all calculators are "out". Since 2 days I know about VTI and found quite a bunch of ROMs in the internet, even TI offers one or more O/S of it's calcs for free.

Now my question: are there adequate emulators for Casio and Sharp somewhere? And the ROMs too? TIA!

Ciao.....Mike

      
Re: Emulators
Message #2 Posted by Thomas Okken on 27 Oct 2004, 7:18 a.m.,
in response to message #1 by Mike (Stgt)

This isn't really an answer to your question, but in case the availability of ROM images, or rather the lack thereof, is bugging you, wait a week or two until I finish my HP-42S emulator. It will NOT require a ROM image (I got tired of waiting for HP to release it so I went and rewrote it from scratch).

- Thomas

            
Re: Emulators
Message #3 Posted by Mike (Stgt) on 27 Oct 2004, 8:09 a.m.,
in response to message #2 by Thomas Okken

Thank you for your hint, but do I understand you correctly: you rewrite the ROM of the HP-42S??? Well, a silly question I suppose, as I assume you're writing a simulation of the HP-42S. Nice, but (not to upset you, but you know http://www.hp42s.com?), you do not need to wait for HP releasing the ROM: if you own an HP-42S you may migrate it to your PC (of cause for your personal use only). There is a slight hope that HP might offer at least one version of the ROM for download, just to give "us" one platform to hand out state files that work for everybody (see http://www.hp42s.com/news/romsonline.html).

BTW, in difference to TI you may find only very few ROMs of HP calculators on the internet (5 if I count correctly: HP-41C/CV/CX, -39/40G, -48SX, -GX, and HP-49G). Seems the HP-users respect the intulectual property of an OS.

Ciao.....Mike

Edited: 27 Oct 2004, 8:37 a.m.

                  
Re: Emulators
Message #4 Posted by Thomas Okken on 27 Oct 2004, 8:40 a.m.,
in response to message #3 by Mike (Stgt)

What I would like to see is an HP-42S emulator (simulator, clone, whatever) that can be freely sold or shared without infringing on HP's copyrights. As long as HP doesn't release the 42S ROM under suitable terms, that means the only people who can legally use Emu42 are people who own an actual HP-42S.

My emulator does not contain any HP code, so I can do with it whatever I want. Plus, it's a lot faster than Emu42, and you get IEEE-754 floating point, which is a lot more accurate. So what if it's a lot of work to write. It's fun. :-)

                        
Re: Emulators
Message #5 Posted by Mike (Stgt) on 27 Oct 2004, 9:03 a.m.,
in response to message #4 by Thomas Okken

I absolutely _do_ agree to that: it's fun. My NutEm (Coconut-Emulator) just works for me, but it's great fun. <G>

Ciao.....Mike

                        
Re: Emulators
Message #6 Posted by Nelson M. Sicuro on 27 Oct 2004, 9:42 a.m.,
in response to message #4 by Thomas Okken

You are building a simulator, not an emulator. And the IEEE-754 floating point isn't accurate enought for a lot of things! It doesn't store numbers right, just an approximation. For high precision/accuracy, BCD is better. For IEEE-754 you'll need a lot of care with roundings and "residues".

My 2...

Best regards and good luck!

Nelson

                              
Re: Emulators
Message #7 Posted by Thomas Okken on 27 Oct 2004, 9:56 p.m.,
in response to message #6 by Nelson M. Sicuro

[...] The IEEE-754 floating point isn't accurate enough for a lot of things! It doesn't store numbers right, just an approximation. For high precision/accuracy, BCD is better. For IEEE-754 you'll need a lot of care with roundings and "residues".

I have to disagree with you there. IEEE-754 is a binary format, which means that decimal fractions can't be represented exactly, but it's not true that it is "less accurate". It is, in actual fact, MORE accurate -- with BCD, you are only using 10 out of 16 possible values for each group of 4 bits, but with a binary representation, you are using all 16.

The IEEE-754 double-precision floating point format gets 16 (decimal) digits of precision, plus an exponent of up to +-308 (again, decimal) out of 64 bits. The HP-42S gets 12 digits plus an exponent of up to +-499, out of that same number of bits. The HP only scores better on the exponent part, and even there it beats IEEE-754 by only about 1 bit... So, it has a slightly larger range, but in terms of accuracy, it loses by quite a big margin.

BCD is only better if you need an exact representation of decimal fractions -- which pretty much means "financial applications". For scientific, engineering, or mathematical work, binary is better -- more precision out of your available bits... and faster performance.

- Thomas

                                    
Re: Emulators
Message #8 Posted by Nelson M. Sicuro (Brazil) on 28 Oct 2004, 8:59 a.m.,
in response to message #7 by Thomas Okken

Please try to represent 0.1 in IEEE math. And BCD isn't limited to only 12 digits - you can make routines for any BCD digits you want - mine is about 27 digits.

Binary is more "dense" than BCD, not more precise: 16 representations for binary and 10 representations for BCD, at nibble (4 bits) level. And with the right CPU, BCD is as fast as binary.

There are some extensive discussions on BCD x IEEE number representations at OpenRPN forum, take a look there.

Best regards,

Nelson

Edited: 28 Oct 2004, 9:02 a.m.

                                          
Re: Emulators
Message #9 Posted by . on 28 Oct 2004, 9:25 a.m.,
in response to message #8 by Nelson M. Sicuro (Brazil)

Given 'x' bits to represent a number, you can generally represent it better with binary. Binary is also much faster to calculate with on conventional hardware.

There is a good website comparing binary to BCD at http://www2.hursley.ibm.com/decimal/

"And with the right CPU, BCD is as fast as binary."

On what modern CPUs is this the case? I can't think of any off-hand.

thanks,

.

                                          
Re: Emulators
Message #10 Posted by Thomas Okken on 28 Oct 2004, 7:16 p.m.,
in response to message #8 by Nelson M. Sicuro (Brazil)

Please try to represent 0.1 in IEEE math.

I assume your point is that IEEE is bad because you can't represent 0.1 exactly. This is true, but for which applications is that a problem?

Consider this: try to represent 2 ^ (-20) using HP-style 12-digit BCD. Can't be done, but IEEE-754 does it just fine.

Next, try to represent 1/3 exactly on either system. Can't be done.

With IEEE-754 double precision, you get a 53 bit mantissa, which means a relative error of 2^(-53), or about 1.11 * 10^(-16). On the HP-42S, you get a 12 digit mantissa, which means a relative error of 10^(-12). That's nearly 4 decimal digits less.

If you're writing applications where it is essential that you can represent decimal fractions (that is, numbers of the form Integer * 10^(Integer)) exactly, you want BCD, or things like java.math.BigDecimal. But if you're writing applications where you want the smallest possible relative error, you want binary, because it squeezes the most out of your bits.

                                                
Re: Emulators
Message #11 Posted by Gunnar Degnbol on 6 Nov 2004, 8:47 a.m.,
in response to message #10 by Thomas Okken

The biggest advantage to decimal arithmetic in an interactive calculator is WYSIWYG - the result you see is the result calculated, not the result converted from binary to decimal. If you understand that the calculation does not have infinite precision, it is not too hard to accept that 1 / 3 * 3 is 0.9999..., but 0.1 + 0.1 + 0.1 - 0.3 = 5.551115123E-17 does not make much sense.

This is less of an issue in computers (programs), where you don't see all the intermediate results.

Binary floating point is more dense than BCD, because it stores 16 values in 4 bits instead of only 10. However, BCD is not the only way to store decimal numbers. The IEEE 754R draft standard uses Densely Packed Decimal, a kind of Huffman-compressed BCD. DPD is rather complicated, but can be implemented in fast hardware.

Any decimal system represented in binary will be still slightly less dense than binary, but only by a few bits. With four bits for the mantissa, a binary format can store 4 bits of information, while a decimal format may have 4 (if the value is 8 or 9) or 1 (if the value is 1). But this difference (0-3 bits) is the same if the mantissa is 40 bits.

In Stak, my RPN calculator for mobile phones and PCs, the coefficeint (mantissa) and the exponent are binary numbers, but the exponent counts powers of ten instead of two.

Another advantage of decimal arithmetic is that it does not have to be normalized. Unnormalized arithmetic, as in Mike Cowlishaw's decimal standard, followed by IEE 754R (and my program), preserves trailing zeros which may contain information relevant to the user in the context.

            
Re: Emulators
Message #12 Posted by Namir on 27 Oct 2004, 12:29 p.m.,
in response to message #2 by Thomas Okken

Thomas,

Eagerly looking forward to seeing your emulator. I wrote an a few hp emulators, and like yourself, had the freedom to extend features and make them formidable. You may want to create a base version that is reasonably close to the actual HP42s and another souped up version that provides more features and memory (i.e. a version more geared to be used with a PC).

I hope you have func creating the emulator and I hope we will have fun using it.

Namir

                  
Re: Emulators
Message #13 Posted by Thomas Okken on 28 Oct 2004, 7:28 p.m.,
in response to message #12 by Namir

Eagerly looking forward to seeing your emulator.

Thanks! I love positive feedback. :-)

I'm currently getting close to finishing SOLVE, and after that there's still INTEG and the printer functions to be done. I estimate about a week to finish SOLVE and INTEG, and another two or three days for some regression testing, and then I'll release the first alpha version. (The printer stuff isn't critical, as far as I'm concerned -- I never owned a 82240 so I don't miss it when those features are absent... I just want to do them because the emulator wouldn't be truly "complete" without them.)

Things like having a settings menu, where you can choose to enable unlimited-depth RTN stack, bigger display size, etc., are all planned for version 1.1. Right now the goal is pure HP-42S compatibility and nothing more. (But even now I'm able to create 1000x1000 matrices and invert them faster than you can blink (well, almost :-) ).)

                        
FOCAL engine?
Message #14 Posted by Raymond Del Tondo on 29 Oct 2004, 1:52 a.m.,
in response to message #13 by Thomas Okken

Hi,

one important point:
Do you include a binary compatible FOCAL execution engine?
This is important if you want to import programs from
other platforms, like Emu42, the HP-41, or the 42S,
or the Emu41CV card for the HP-48...

Also the solver & integrator make use of FOCAL programs.

Raymond

                              
Re: FOCAL engine?
Message #15 Posted by Thomas Okken on 31 Oct 2004, 12:19 a.m.,
in response to message #14 by Raymond Del Tondo

I don't know anything about FOCAL. Could you fill me in?

For what it's worth, I have implemented my own versions of SOLVE and INTEG; they work but they're not quite as good as the originals yet (the HP-42S SOLVE has some smart logic for dealing with asymptotic behavior and such; my version is already pretty good at *converging* even in difficult situations, but it does tend to take more iterations to get there. Good thing it's also screamingly fast, so you still won't get old waiting for your results... :-) As for INTEG, I currently have a Simpson's Rule integrator that keeps halving its step size until two successive approximations differ by less than ACC; again, that works pretty well most of the time, but it *can* take forever on poorly behaved functions -- it needs something like the HP-42S's selective refinement, but I've had my hands full just dealing with the issues of calling HP-42S programs from the emulator and such... Hopefully I'll be able to improve that sometime soon.)

                                    
Re: FOCAL engine?
Message #16 Posted by Raymond Del Tondo on 31 Oct 2004, 9:09 a.m.,
in response to message #15 by Thomas Okken

Hi,

I don't want to repeat all that has been written about FOCAL here,
there were several threads in the hpmuseum forum about this topic.
Please take a look into the archives.

Only a short description:
FOCAL stands (amongst other things) for FourtyOne CAlculator Language.

When I write FOCAL, I usually mean this in combination
with the HP-41 programming language.

Did you know that the original HP-41 programs can run in the HP-42S, too?
I mean the binary representation, not only the text form!

As I wrote in a previous mail, HP-41 programs (binary) can
be even used in the HP41CV Emulator card for the HP-48SX.

This is because the execution engine is compatible.
The memory mangagement of the various platforms is different,
but the FOCAL programs work the same.
This has also been discussed here,
and can be found in the archives.

Hmm, to simplify things, you can say FOCAL was kinda portable,
at least to some specific platforms, long before something like JAVA was even invented.

Raymond

                        
Re: Emulators
Message #17 Posted by Namir on 29 Oct 2004, 11:32 a.m.,
in response to message #13 by Thomas Okken

I remember writing a GUI version of the HP41 and added SOLVE and INTEGRATE to it. These features were a bit of a challenge because thei required another set of program execution pointers. I was a wonderful feeling to see it work.

More power to you Thomas!!!!!!!!!

                              
Re: Emulators
Message #18 Posted by Thomas Okken on 31 Oct 2004, 12:27 a.m.,
in response to message #17 by Namir

I know the feeling. :-)

It's quite a thrill once some actual heavy-duty HP-42S programs actually run all the way on the emulator. You know you're on the right track when you keep forgetting it's not a real HP you're working with! And seeing Erik Ehrling's PRM? program figure out that 999,999,999,961 is prime in less than half a second (on a 233 MHz Pentium MMX) is pretty neat too.

Just a few more days before I'm ready for a public release... Gotta write a Windows front-end to add to the ones for Linux and PalmOS I already have (one or two days' work, tops), plus some more regression testing... I wish it were done already, I could use a good night's sleep. :-)

      
Re: Emulators
Message #19 Posted by Aleph Mobius on 27 Oct 2004, 6:07 p.m.,
in response to message #1 by Mike (Stgt)

I could be wrong but hasn't HP released the 49G ROM for free use? I think anyone who pleases may download the file. Some TI ROMs are available from their site but technically you aren't supposed to download them unless you own the origional calculator. I remember seeing at least one emulator for an older Sharp calculator (PC-E500 maybe?) but I am almost positive there are no emulators for their newer models. There is an emulator that runs BASIC programs from the casio CFX line. There is also an emulator for the AFX line (they have x86 compatible CPUs and run DOS) but it only emulates compiled programs and has no math functionality of the actual calculator.

            
Re: Emulators
Message #20 Posted by Thomas Okken on 27 Oct 2004, 10:06 p.m.,
in response to message #19 by Aleph Mobius

I could be wrong but hasn't HP released the 49G ROM for free use?

I think so -- I know you can get ROM images for several of the 48 series models directly from HP.

But what's the point? The 48 series may be a neat toy for college students and hardware hackers, but of you want a calculator you can actually USE, the 42S beats the sh*t out of anything.

(I tried using Power48, with those HP ROM images, on my Palm, but it only reminded me of why I like the 42S better than the 48G.)

OK, I'm going off to look for my asbestos suit now. Flame away... ;-)

- Thomas

                  
Re: Emulators
Message #21 Posted by Mike (Stgt) on 28 Oct 2004, 3:57 a.m.,
in response to message #20 by Thomas Okken

From me no flame about your opinion about HP48 etc. As an HP41-dinosaur I never got comfortable with those machines. Even the HP-42 I only touch with pointedly fingers. <G>

Ciao.....Mike

                        
Re: Emulators
Message #22 Posted by Thomas Okken on 31 Oct 2004, 12:45 a.m.,
in response to message #21 by Mike (Stgt)

I was an HP-41 freak too, for many years (bought my first HP-41C right when it came out, eventually added more memory, card reader, printer, and later upgraded to a 41CX) -- but when I was in college, I started work on a linear algebra system... and then the 42S came out which had all that built right in. So much for that!

                  
Re: Emulators
Message #23 Posted by Mike (Stgt) on 28 Oct 2004, 7:30 a.m.,
in response to message #20 by Thomas Okken

Quote:
I know you can get ROM images for several of the 48 series models directly from HP.

Directly from HP?? Did I miss something??? Where?!?

Ciao.....Mike

                        
Re: Emulators
Message #24 Posted by Thomas Okken on 31 Oct 2004, 12:51 a.m.,
in response to message #23 by Mike (Stgt)

Erm, I may have goofed there -- I don't actually know just where in hp.com you can get those images. I seem to remember reading somewhere that HP released the 48 series ROMs for free download, but I didn't get them from HP myself; I downloaded Power48 (HP-48 emulator for PalmOS) and I think I got my ROM images from the same place where I got the emulator.

I later ditched Power48 because it wasn't stable -- it crashed my Palm pretty badly a few times, making me lose some stuff from my address book and memo pad -- and besides, it mostly reminded me of why I got rid of my *real* HP-48G years ago...

But if you're still looking for those ROMs, give me a holler and I think I can still retrace my steps and figure out where I got them.

      
Re: Emulators
Message #25 Posted by HrastProgrammer on 28 Oct 2004, 1:34 a.m.,
in response to message #1 by Mike (Stgt)

Now my question: are there adequate emulators for Casio and Sharp somewhere?

Sure ... There are ROMs for a few Sharp calculators on http://pockemul.free.fr/gallery/. Some time ago, emulators could be downloaded from this place as well, but currently download doesn't seem to work :-(

Another Sharp emulators pages:

http://perso.club-internet.fr/r_rouvin/
http://pocket.free.fr/html/soft/emul_pc-1450_e.html
http://pocket.free.fr/html/soft/emul_pc-1500a_e.html

            
Re: Emulators
Message #26 Posted by Mike (Stgt) on 28 Oct 2004, 3:50 a.m.,
in response to message #25 by HrastProgrammer

Hello HrastProgrammer!

Thank you very much for the links. At least after the subject drift s.o. comes back to my question <G>

What I am looking for are emulators of _actual_ calculators that are robust enough for teacher's educational use like those offered by HP. Of cause, for my personal joy as collector I appreciate other gems too with the grade A quality like Emu42, V41, and of cause yours.

BTW: do you have the chance to join this years Allschwil meeting? The chance is 99% that I am with the party.

Ciao.....Mike

                  
Re: Emulators
Message #27 Posted by HrastProgrammer on 28 Oct 2004, 5:32 a.m.,
in response to message #26 by Mike (Stgt)

BTW: do you have the chance to join this years Allschwil meeting?

Well, I don't know. Right now, I am not too much into calculators and emulators because (after a long time) I finally completed my electronic music studio (BTW, some german hardware is included, like Access and Waldorf synthesizers ...), currently working hard in my free time at producing a few purely electronic tunes, perhaps even on a full album.

But I will see ... It would be very nice to meet HP fans from Europe and the world, this is for sure ...

                        
Re: Emulators and Allschwil
Message #28 Posted by Mike (Stgt) on 28 Oct 2004, 6:39 a.m.,
in response to message #27 by HrastProgrammer

Just to give you an impression of the surroundings. Well, Allschwil is on the other side of Basel. (Matthias, do you have an other point of view?)

Ciao.....Mike

            
Re: Emulators
Message #29 Posted by Aleph Mobius on 28 Oct 2004, 10:04 a.m.,
in response to message #25 by HrastProgrammer

I forgot to add that Casio has released an emulator for their newest calculator the ClassPad. I don't know if they have changed it but when I downloaded it several months ago, several areas of the program were unavailable and it stopped working after 180 days. I don't know if these two restrictions are still in place or if there is any way to unlock them. IIRC, ClassPad users get a version of the emulator on a CD when they buy their ClassPad.

                  
Re: Emulators
Message #30 Posted by Mike (Stgt) on 3 Nov 2004, 8:36 a.m.,
in response to message #29 by Aleph Mobius

From a jp Casio site

Note: The part in the software which operates equivalent to the actual ClassPad 300 operations expires after 180 days. However, the communications part for communication between the ClassPad 300 and the PC can be used continuously.

Nice, anything more durable out there?


[ Return to Index | Top of Index ]

Go back to the main exhibit hall