![]() |
Displaying numbers greater than 9.99E499? - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Displaying numbers greater than 9.99E499? (/thread-130405.html) |
Displaying numbers greater than 9.99E499? - Jean-Michel - 01-04-2008 Hi all, I've heard about a puzzle (Eternity II) made of 256 square colored pieces, to be put into a square frame (16x16), by making the patterns figuring on the sides of the squares corresponding to each other, with only one solution (as for all the puzzles !) The one who would find this solution should win US $ 2,000,000…but the probability seems very near to zero. Correct me if I'm wrong:
There are :
This is just a preamble and not the main subject of my post, which is the following : For instance, MS Excel maximum number is « only » 9.999…E307. Kind regards.
Jean-Michel.
Use LOG domain for calculations -> Big bang - Allen - 01-04-2008 I am not sure I follow your puzzle solution, nevertheless, numbers of that size (ABS(MANTISSA)>499) have very little meaning, especially when you can just do all of your calculations in LOG domain, and convert them back at the end. It will work in excel (except for the last LOG-> DEC conversion). Why not try that? I did this once at a conference where the presenter showed the audience a picture of a "1000 db Gain Antenna". ( clearly presenter error!!!)
I became quite nervous, after a quick LOG calculation of the expansion of the universe from the time the universe was the size of an electron, until present day. (Using some estimates e.g. the average mass of a star, number of stars in a galaxy, number of galaxies, some extra DARK matter ingredients etc.... So with the assumptions made the BIG BANG was only about 850 db. That number could be displayed on my 48G or even a 10s, but the corresponding decimal number would be inaccessible. Edited: 4 Jan 2008, 8:23 a.m.
Re: Displaying numbers greater than 9.99E499? - Ken Shaw - 01-04-2008 Assuming I understand your question, I think the simple answer is that the hardware inside a computer or calculator is basically a counter. It counts in units of 1 and has a fixed memory size for a single number (let's say N bits), which limits the range of countable numbers to 2^N. To include negative numbers, zero is placed in the middle of the range, so the actual range is approximately -2^(N-1) to 2^(N-1). What I think you are complaining about is that when the numbers are sufficiently large, why doesn't the machine simply shift the least significant digits out of range and work within a higher range of numbers?
I think the answer is that only you can decide how much precision you need and what range of numbers you would like to work in. Simply make that decision and then make the adjustment yourself. You can work with numbers larger than 9.99E499 simply adjusting the problem before and after you use the machine. I think that's the same answer as "work within the log domain", but I thought it needed a bit more explaining.
Re: Displaying numbers greater than 9.99E499? - Don Shepherd - 01-04-2008 Jean-Michel, relating this to another thread, "programming programmable calculators," wouldn't it be great if one of us on this forum solved the Eternity II problem on an HP programmable! Not only would that clever individual win 2 million dollars, just think of the terrific publicity for HP that would surely result. Who knows, maybe HP would re-issue the 15c or 42s in celebration!
Valentin, how about a "maxi" challenge here?
Re: Displaying numbers greater than 9.99E499? - Karl Schneider - 01-04-2008 Quote: Jean-Michel -- The basis of the HP-35s limit of exponents -- between -499 and +499 inclusive, with the number in scientific notation -- is the format of the binary-coded decimal (BCD) data word used by the late-1980's Pioneer-series units to represent numbers. (The HP-35s evolved from the HP-32SII.) The word is 64 bits, or 16 4-bit nibbles. Each digit of the 12-digit mantissa requires one nibble. The sign of the mantissa also uses one nibble. This leaves only three nibbles for the BCD 3-digit signed exponent.
Presumably, the unused code for the exponent could represent something else (1E+500?), and any extra bits of the mantissa sign might also be utilized for other purposes. 1E+500 is the result of an overflow. It can be displayed and used for calculations, but cannot be entered by the user.
The above is what I believe to be true. If I'm mistaken, anyone should feel free to correct me. I can't specifically recall having seen a detailed specification of the Saturn-processor 64-bit word, but page 27 of the Hewlett-Packard Journal article from May 1983 about the HP-15C ("Scientific Calculator Extends Range of Built-in Functions") describes the 56-bit (14-nibble) word used by HP calc's having pre-Saturn microprocessors. This file (83MAY15.PDF) is found on the MoHPC CD/DVD set. The IEEE double-precision 64-bit floating-point word does provide more range and precision, because it's a more "efficient" format than BCD: http://en.wikipedia.org/wiki/IEEE_754 -- KS (Edited to refine content, based on comments.)
Edited: 14 Jan 2008, 2:42 a.m. after one or more responses were posted
Re: Displaying numbers greater than 9.99E499? - Don Shepherd - 01-06-2008 Quote:
Karl, excellent explanation. I have seen many references to how BCD representation works in calculators, but none explained as clearly as yours.
Re: Displaying numbers greater than 9.99E499? - Jean-Michel - 01-06-2008 Guten Tag, Karl! Vielen Dank für deine Erklärung. (Thank your for your explanation, for non-German speaking people :) ).
If I well understand, the only way to handle number greater than 9.999...E499 would be do decrease the number of significant digits of the mantissa, and to use the resultent free digits for the exponent. Auf wiedersehen.
Jean-Michel.
Re: Displaying numbers greater than 9.99E499? - Karl Schneider - 01-06-2008 Don and Jean-Michel -- Thanks for the kudos. Also please note some new information in my first post.
-- KS
Re: Use LOG domain for calculations -> Big bang - Nick - 01-07-2008 Allen, I must disagree completely on the "meaning" of any number "too large". After Peano and as long as induction is taken for correct, it is simply too easy to state that a number ceases to have a meaning after some given exponent, be it 499 or 2^499. It might have no physical correspondance to any big number in this universe, but after all: Mathematics is the science that you can still do when you wake up in the morning and find out that the universe is... gone! ;-)
Nick
Numeric objects in RPL models (long) - James M. Prange (Michigan) - 01-07-2008 For the RPL models, which use the Saturn processor or an emulated
Note that some objects are built into ROM, in which case they may
Everything is stored in memory in little-endian order
For a "real" number object, the prologue address is 02933, and the
The first three nibbles of the body represent the exponent from
The next twelve nibbles are the mantissa, with an implied decimal
The last nibble is used for the sign, with 0 representing
But when loaded into the processor's register, the nibbles of the
Some examples:
pointers. When loaded into a register, the body of the object pointed to is loaded.
For a complex number object, the prologue address is 02977, and
For an extended real number object (SysRPL only), the prologue
For an extended complex number object (SysRPL only), the prologue
For a "hex string" object (used for user binary integers), the
For a system binary integer object (bint) (SysRPL only), the
In the 49 series, we can have an "exact integer" (zint), which has
Note that the zints -9 through 9 are compiled as ROM object
An array object (used for a real or complex vector or matrix in
A linked array (SysRPL only) has a prologue address of 02A0A, and
All of the above are "atomic" objects; that is, they can't contain
In the 49 series, we can also have a "symbolic matrix", which is a
Of course the various "numeric" objects can also be embedded
Of course, the size of everything is limited by available memory.
Regards,
Edited: 7 Jan 2008, 3:06 p.m.
Re: Use LOG domain for calculations -> Big bang - Allen - 01-07-2008 you're right, I should not say " meaningless", rather it has no practical use. ( e.g. the significant figures etc...)
Re: Displaying numbers greater than 9.99E499? - Paul Brogger - 01-08-2008 Quote: I think it goes without saying: if we make a mistake on this board, we get corrected! ;-)
Re: Numeric objects in RPL models - Karl Schneider - 01-08-2008 Paul Brogger said,
Quote: That's the truth! I've been on both ends of that one... Thanks again, James, for yet another detailed and informative post. It's got me wondering whether I stated correctly the storage format of the exponents on non-RPL Saturn-processor calc's, as I wasn't using any definitive reference. I did convey the important point in that the maximum magnitude of the exponent is 499 instead of 999, so that the exponent can fit within three BCD nibbles. Here's something interesting: Craig Finseth's site states that the maximum magntitude of the internal extended-precision exponent of numbers in the Saturn-processor models is 49999 -- i.e., two extra nibbles for the exponent as well as three for the mantissa. Is that true? The site also states that the HP-15C's range of internal and external representations of numbers is the same, but that is incorrect. The HP-15C and others have three guard digits for the mantissa, but I'm not sure about the exponent. http://www.finseth.com/~fin/hpdata/ and click on your model of choice. Thanks!
-- KS
Re: Numeric objects in RPL models - James M. Prange (Michigan) - 01-12-2008 Hi Karl, Quote:I wondered the same, but I don't know.
For what it's worth, even RPLMAN.DOC (the document describing RPL Quote:Of course it's only the negative exponents that are in ten's complement form, very much like the usual convention for representing binary "signed integers" using the two's complement form for negative values. I did understand what was intended though, as using the ten's complement form for all values would seem rather pointless.
Note that if the most significant nibble of the encoded number is
Notably, 500 (encoded), which presumably would represent -500,
You made a good point that the mantissa sign nibble could've been
Alternatively, they could've used a 13-nibble mantissa with
Oh well, I suppose that the developers had their reasons for their
To verify that I had things right (and to check the new object Quote:Yes, and that's indeed the most important point. The design that you described would work, including using the most significant nibble as both a numeric value and a sign nibble (except that 0-4 would represent a negative exponent, and 5-9 would represent a non-negative exponent). Perhaps the ten's complement form for negative exponents was chosen to simplify subtraction of them? Quote:Yes.
Extending the range of the exponent makes sense because they're
For example, the extended real number -123456789012345E-49999 is
For the extended real numbers, the (mantissa) sign nibble and
The Saturn Processor's 4 working registers (A-D) and 5 scratch | 15| 14| 13| 12| 11| 10| 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |Most of the opcodes for these registers work on only a particular field, without using any other nibbles in the register.
With the ARM-based models' emulated processor (Saturnator, also
In additional to the new opcodes for user-defined fields, the
Of course there are several other Saturn registers. Quoting from Quote:In assembly language programming, as long as you're careful, most of these resources can be used for things that the designers perhaps never intended.
Regards, BCD encoding of exponents and signs - Karl Schneider - 01-13-2008 James -- Thank you for the informative reponse. I have only one comment:
Quote: According to "Scientific Calculator Extends Range of Built-in Functions", in Hewlett-Packard Journal, May 1983:
I'm not quite sure what was the reason for the +9 encoded value of a negative sign -- perhaps enhanced reliability of data offered by lack of adjacency (two-bit difference between 0000 and 1001). Another possibile use is to determine whether the sum of encoded exponents represented an overflow condition, as the two-nibble exponents were not uniquely coded. Regards, -- KS
Edited: 13 Jan 2008, 2:38 a.m.
Re: BCD encoding of exponents and signs - Giancarlo (Italy) - 01-14-2008 Hi Karl and James. Re: BCD encoding of exponents and signs - Karl Schneider - 01-16-2008 Hi, Giancarlo -- Thanks for the kind words. I have to admit that James did most of the work; I just answered the OP's basic question and dug up some references... -- KS
Re: BCD encoding of exponents and signs - Eric Smith - 01-16-2008 The reason for the 9 for both mantissa and exponent sign dates back to the HP-35. The processor used in the Classic series could only do BCD arithmetic, and had no bit (logical) operations, which meant that a full digit had to be used for a sign. Packing would have required a lot of instructions, and the entire firmware for the 35 had to fit in 768 words of ROM. (An amazing feat!) For the mantissa sign, if 0 is positive, the most obvious choices for negative would be 1 or 9, since those can be obtained from 0 by an increment or decrement. However, it is even more efficient on the Classic processor to use a C=0-C-1 instruction when necessary to change the sign. That wouldn't work if negative was represented using 1. Using 9 for negative also has advantages in distinguishing overflow and underflow conditions. The exponent, with a range of -99 to +99, is stored as a three digit ten's complement number, from 901 to 099. By doing this, the addition and subtraction of exponents can be done using simple three-digit BCD addition and subtraction, with no special care for dealing with positive or negative exponents other than on entry and display. This also potentially allows internal intermediate results to have a greater exponent range, as long as the final result is in the -99 to +99 range. While the earlier calculators could have used the three-digit exponent field for a larger range for the user, it would have needed more code, which was not justified on the 35 and other early calculators. By the time of the 41C, they could have expanded the exponent range if they'd felt there was a compelling need, but instead they kept the math routines almost unchanged from the 30 series, and used them again with minimal changes in the Voyagers.
The 71B was the first product to use the Saturn processor, and the math routines saw a major update to support the IEEE 854 standard for radix-independent floating point. They chose to expand the exponent range at that point, presumably because the engineering effort was relatively small compared to the overall scope of the updates to the math routines.
Re: BCD encoding of exponents and signs - Karl Schneider - 01-17-2008 Thanks, Eric -- that's some real historical insight! Of course, in addition to math modifications, display space would have required expansion to provide three-digit exponents for the HP-41. -- KS
Edited: 17 Jan 2008, 2:23 a.m.
Re: Use LOG domain for calculations -> Big bang - Mad Dog ebaycalcnut - 01-26-2008 I disagree. There are practical uses to very large numbers, though not for everyday use.
|