Re: HP-15C Quiz: My Solutions Message #11 Posted by Valentin Albillo on 25 Feb 2004, 6:09 a.m., in response to message #9 by Eric Smith
Hi, Eric:
Eric posted:
"I believe you are mistaken. My investigations found that there are 240 one-byte instructions, and 16 possible two-byte prefixes."
Well, the HP-15C Owner's Handbook includes a list with
all operations requiring two-bytes, and they certainly
belong to 27 distinct prefixes listed (LBL, GTO, SF, STO+,
MATRIX, etc, for certain ranges of arguments) plus 1 additional unlisted prefix (GSB). So, they make 28 in
total, unless that whole section of the Handbook is
completely wrong, which I don't believe as I've tried all
instructions and ranges there and they certainly use up
two bytes of RAM ...
... unless there's some internal mechanism to map said 28 prefixes into only 16 internal two-byte prefixes, which
is a definite possibility, as none of those prefixes has
as many as 256 possible arguments. Some clever internal
programming could use one of them for several separate
instructions, being interpreted as one or the other
depending on the argument (following byte). It might be ...
"But even if you were correct, your math would be wrong. If there were 28 two-byte prefixes, and an arbitrary byte could be used for the
suffix, the total possible combinations would be 228 + 28 * 256, which is 7396, requiring 14564 bytes to store all combinations."
Yes, you're right. I had the concept absolutely clear, but
the similarity of 28 and 228 made me incur in that stupid typo. The correct calculation is indeed 28*256+228, not +28.
"I still don't have my 15C handy, but I think I can get it down to four "operations": 9, 1/x, ON-D, ON-D
I think three "operations" would be the theoretical minimum, but I haven't yet found a sequence that short."
The theoretical minimum would be two: place some suitable number in the display with a single operation, then perform an ON-D operation, for a total of two operations. Assuming entering individual digits is considered one operation per digit, decimal point, change sign, or exponent entered, it seems fairly difficult to do it in only two operations.
However, starting from a master-cleared machine as stated in the original quiz, there's a solution in just *three* operations. And there's an equally short solution to generate a similar display, only with a lonesome lowercase "y" at the left end of the display instead :-)
Thanks for your clever considerations and for your interest in my little quiz and
Best regards from V.
|