HP-15C Silver Anniversary! (Op-codes, synthetic matrices)



#10

tHP-15C fans --

After preparing this lengthy post over the past few days, I checked Craig Finseth's site, which states that 1 July, 1982 was the date of introduction for the HP-15C. Therefore, today is its 25th anniversary of its public availability for purchase!

http://www.finseth.com/hpdata/hp15c.html

At the upcoming HHC conference in San Diego, we enthusiasts ought to hold an HP-15C silver anniversary observance as an "undercard" to the HP-35 35th anniversary theme.



The HP-15C offers exactly 700 programmable instructions stemming from well over 100 functions, all without benefit of bona fide alphanumerics. It is instructive to examine the fine engineering work that was done, more a quarter-century ago, to make this possible.

A complete instruction stored in program memory is identified by a unique operation code, or "op-code". These are not to be confused with key codes on 7-segment displays, which show the sequence of keystrokes for a programmed instruction using key identifiers that are usually numeric, but are sometimes a individual letter.

Relation and arrangement of op-codes to functionality is an important design consideration for a programmable calculator. Logically-selected codes facilitate testing and processing. Moreover, an insufficiency of available op-codes will restrict the amount of programmable functionality provided for the user.

First, some background: There are 28 = 256 unique one-byte op-codes. The "starting point" for the HP-15C -- namely, the HP-34C and HP-11C -- each use 255 codes for programmable instructions, with one spare code presumably by design, and a few possibilities omitted by necessity. For example, the HP-34C's sophisticated functions SOLVE and INTEG can be invoked with user-defined programs starting with labels A, B, 0, 1, 2, or 3, but not labels 4 through 9. This restriction due to insufficient op-codes caused William Kahan to make a selective statement in his fine article "Handheld Calculator Evaluates Integrals," in Hewlett-Packard Journal , 31:8, August 1980:

Quote:

Some constraints ... are nuisances, such as 'Begin the f-program with a special label such as A'. The (INTEG) key is encumbered with no such nuisances. The f-program may begin with any of several labels...

Left unsaid was, "but not all the labels..."

The HP-11C has only flags 0 and 1, omitting flags 2 and 3 that its predecessor HP-34C had. This saved six operations, to get the HP-11C under 256 programmable instructions.
A concise list of differences between HP-34C and the HP-11C programmable instructions is found in the following post within a long thread containing technical insights from Eric Smith:


http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv016.cgi?read=98494#98494

Which brings us back to the HP-15C: With all the functionality of the HP-11C, plus SOLVE and INTEG from the HP-34C, pioneering matrix-based and complex-number functionality, as well as extensions of traditional functions, clearly the uniform single-byte op-code would not be sufficient. If the byte were to remain the standard unit of size, some op-codes would require two bytes -- similar to what was done for the HP-41C. Given the limited RAM of the HP-15C (a maximum of 448 bytes programming space), the two-byte codes would need to be intelligently selected, such that the most commonly-used instructions would have one-byte codes.

The complete set of one- and two-byte HP-15C op-codes was revealed in an excellent article published not long after the HP-15C's introduction in mid-1982: "Synthetic Methods on the HP-15C" by Allyn F. Tennant. PPC Calculator Journal, Volume 10, No. 1, January/February 1983, pages 49-53.
An easily-created synthetic matrix pointing to base of the pool of allocatable memory (and not simply the storage of the matrix itself) allowed direct viewing of the operating codes of entered programming instructions. Here's an example:

  1. Clear all program memory [CLEAR PRGM], clear matrix data [MATRIX 0], and exit complex mode [CF 8]

  2. Set R19 as the highest-numbered register [19 DIM (i)]

    (NOTE: A master clear -- turning on while holding down the "-" key -- would accomplish all of the above.)

  3. Type 1.000000044, turn calculator off, then turn it back on while holding down the yx key

  4. Store the (non-letter) descriptor of the resulting matrix to the indirect register [STO I]

  5. Dimension matrix A as 1x23 [1, ENTER, 23, DIM A]

  6. Set the matrix pointer to 1,23: [1, STO 0, 23, STO 1]

  7. Enter program mode and key in the following instructions: DIM I, GTO 0, x2, DSE 0, RCL*I, LBL 3

  8. Exit program mode and display the register containing the programmed instructions using [RCL (i)]. In default display mode (FIX 4), the display reads
    "4.4536   99"
  9. View the mantissa by holding down [CLEAR PREFIX]. The display reads
    "3PEo 82-r1"

The complete hexadecimal contents of the register are "03DECF82BA1099". Here is a complete breakdown:

display    hex value     representing
(N/A) 0 Left nibble of "LBL 3" (1-byte code "03")
"3" 3 Right nibble of "LBL 3" (1-byte code "03")
"PE" DE 2nd byte of "RCL*I"
"o " CF 1st byte of "RCL*I"
"82" 82 "DSE 0" (1-byte code)
"-r" BA x2 (1-byte code)
"1" 1 Left nibble of "GTO 0" (1-byte code "10")
(N/A) 0 Right nibble of "GTO 0" (1-byte code "10")

"99" 99 "DIM I" (displayed in exponent field)

The "DIM I" instruction is displayable as the exponent of the full floating-point number. As stated, the left nibble of the "LBL 3" and the right nibble of the "GTO 0" instructions are not directly displayable. For numbers, these nibbles contain signs for the mantissa and exponent (among other information, such as matrix identifiers and LU decompostion status).

Here's the principle of the synthetic matrix: The ON/yx processor-reset operation rotates the 56-bit content of the x-register 22 bits to the right. So,

1.000000044 (float) = 

0000 0001 0000 0000 0000 0000 0000 0000 0000 0100 0100 0000 0000 0000 (DCB)

becomes

0001 0001 0000 0000 0000 0000 0100 0000 0000 0000 0000 0000 0000 0000 (DCB)

after rotation. The first "1" indicates a matrix descriptor; the second "1" is the matrix identifier, which is not among the standard set of A through E that are encoded correspondingly in hexadecimal. (The value "1" in the mantissa is included to prevent automatic normalization to an exponentiated value, which would change the bit pattern.)


The selection and arrangement of the complete set of HP-15C 1-byte and 2-byte op-codes found respectively in Figures 3 and 4 of the PPC article exhibit the thoughtful planning, logical grouping, and overall attention to detail also found in the arrangement of the HP-15C keyboard. Here are some observations:

One-byte codes:

  • If the right nibble is hex F, then the byte is the first of a two-byte instruction. This enables BST to find instructions quickly (an improvement over the HP-41), but eliminates 16 possible 1-byte op-codes, leaving 240 such codes still available.

  • Instructions whose value, register, or label is 0-9 have the corresponding hex value 0-9 as the right nibble. This holds for LBL, GTO, GSB, RCL, STO, TEST, and the numbers 0-9.

  • RCL and STO using registers .0-.9 have the corresponding hex value 0-9 as the right nibble.

  • Instructions whose value or input argument is A-E have the corresponding hex value A-E as the right nibble. This holds for LBL, GTO, GSB, RCL, STO, RCL g, STO g, RCL MAT, RES, DIM, and RCL DIM.

  • RCL MAT A-E uses five 1-byte codes because these instructions would be used routinely for matrix-based calculations. (STO MAT A-E would be used only for copying entire matrices, and are 2-byte codes.)

  • x< >, DSE, and ISG using register number 0, 1, I, or (i) as an argument are included as 1-byte instructions, whereas the same functions using a different argument are 2-byte instructions. The R0, R1, and I registers, which are non-allocatable and don't store statistical summation values, are always available for these functions.

  • Most transcedental-function commands are grouped in the op-code table in the same way that they are located on the keyboard.


Two-byte codes:

  • There are a total of 460 2-byte op-codes, which exceeds the 256 codes that a second table would provide. Thus, the second byte of some 2-byte codes matches a 1-byte code, making the left nibble of the 1st byte necessary for uniqueness. With the right nibble of the 1st byte being hex F, the 2-byte op-codes are essentially 3-nibble codes, most of which are unused.

  • All eight register-arithmetic commands can be used with 0-9, .0-.9, A-E, (i), and I. Because this creates a set of 216 unique instructions, the instructions are 2-byte -- which is justified anyhow, given that STO and RCL arithmetic functions encompass two or more simple instructions. (RCL arithmetic is unavailable on the HP-41 as well as the HP-34C and HP-11C, which offer only 44 register-arithmetic instructions: STO #0-9 and STO #(i), where # is an arithmetic operation).

  • LBL, GSB, and GTO with arguments .0-.9 are basically extensions of the corresponding one-byte codes for the arguments 0-9, the only difference being the pre-pended 1st byte: hex FF.

  • RCL and STO of matrix elements in user mode are 2-byte. The codes were selected so that the 2nd byte matches the single byte of the corresponding instructions outside user mode, the only difference being the pre-pended 1st byte: hex BF.

  • Indirect matrix access using stack pointers -- RCL g (i), STO g (i) -- is encoded to correspond with "RCL g D" and "STO g D", the only difference being the pre-pended 1st byte: hex AF: i.e., AF5D and AF6D versus 5D and 6D.

  • All SOLVE and INTEG commands are 2-byte. These are infrequent in programs, but account for 50 unique instructions, as they are usable with all 25 labels (not just a few, as with the HP-34C).

  • Flag operations and display-mode settings are 2-byte, as these account for 66 unique instructions. (The HP-15C has 10 flags, with access through the indirect register I as well.)

NOTE: There is a list of two-byte instructions on page 218 of the HP-15C Owner's Handbook. This list, however, omits [GSB][.] label , x< > {A-E}, DSE {A-E}, and ISG {A-E} -- the only mistakes I've ever found in that manual.


Of course, a picture is worth a thousand words; the preceding discussion is much easier to follow with the PPC Journal article and its tables at hand. The article is well worth perusing, and there's much more in it than I have discussed -- including a demonstration synthetic program that displays "HEllo PPC" in the display!

The article, included within the PPC archives, is available as the 10154-kB file "v10n1.pdf" on CD #1 from Jake Schwartz at http://www.pahhc.org/ppccdrom.htm, or on the Extended Archive DVD available from another site.

Tables of op-codes for the HP-11C, HP-34C, and two-byte op-codes for the HP-15C are available at Eric Smith's web pages:

http://www.brouhaha.com/~eric/hpcalc/

http://www.brouhaha.com/~eric/hpcalc/hp15c/two_byte_instructions.html

-- KS

Edited: 4 July 2007, 1:58 a.m. after one or more responses were posted


#11

Well, sum up and gather up all the information about the 15C such this, and make an article of it: it's too much interesting, and I'd want a pdf copy to carry with me.

You're great. Simply.

-- Antonio

Edited: 3 July 2007, 4:22 a.m.


#12

Hi, Antonio --

I was planning to respond to your reply from yesterday, which you apparently deleted and replaced with a new one. Thank you for the praise, which is admittedly difficult for me or anyone to truly fulfill...

:-)

In fact, it has been my intent to package the two "short essays" into a full-fledged MoHPC article with tabs. I'd like a little more feedback from others on the latest contribution.

One topic I'd like to be able to illuminate for readers concerns the engineering methods employed for the development of the HP-15C. I'm continually astounded how perfection in product development was nearly achieved -- no detail was overlooked, no feasible function that was necessary or useful was omitted, only one page of the manual contains errors, and only one minor RPN bug
crept in -- a carryover from certain predecessor models, at that.

This excellence is more astounding, considering the pioneering functionality and fairly-short time of development. Obviously, it didn't happen by chance; some systematic, methodical engineering methods were employed, and I'd like to know what they were. I do have an idea how to find out more about them, but will discuss that when the time comes...

Best regards,

-- KS

#13

Quote:
The article, included within the PPC archives, is available on DVD from Jake Schwartz at http://www.pahhc.org/ppccdrom.htm, or (ahem) "TOS".

Karl,

Would you please tell me where to find the article in the DVD? (Mine is the "TOS" HP-41 Extended Archive DVD).

Thanks!

Gerson.


#14

Hi, Gerson --

Quote:
Karl,

Would you please tell me where to find the article in the DVD? (Mine is the "TOS" HP-41 Extended Archive DVD).

Thanks!


"Synthetic Methods on the HP-15C" by Allyn F. Tennant. PPC Calculator Journal, Volume 10, No. 1, January/February 1983, pages 49-53 is found in the file "v10n1.pdf", probably installed under

\Users Groups\PPC1\Volume10

Best regards,

-- KS


#15

Thanks again, Karl!

So far I haven't read all through the article, only enough to be able to run the "HEllo PPC" program. It does work!

Best regards,

Gerson.

#16

The referenced article "HP-15C Synthetics" by Allyn Tennant, from PPC Calculator Journal V10N1, has been converted to HTML and is available here.

Any errors in the HTML conversion are undoubtedly mine.


#17

Eric --

Many thanks for posting the link to some diligent work you perfomed in 2004. Your HTML conversion of the 1983 PPC Journal article is much more accessible to people (and easier to read) than the small-print scanned Journal article puchased from Jake Schwartz or "TOS".

I couldn't help but notice, though, that the link to the HTML file is a "deep link" that does not appear under http://www.brouhaha.com/~eric/hpcalc/. The user is prohibited from viewing the contents of http://www.brouhaha.com/~eric/hpcalc/hp15c/, where your HP-15C "two byte instructions" spreadsheet is kept.

Is this by intent?

-- KS


#18

I just haven't yet updated the "upper" page with links to it yet.

Eric


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime Matrices curiosity bluesun08 0 437 12-09-2013, 06:44 PM
Last Post: bluesun08
  [HP-Prime CAS] "Warning, ^ (Command) Is ambiguous on non square matrices"?? CompSystems 1 650 12-07-2013, 07:15 PM
Last Post: CompSystems
  HP Prime: matrices in programs, in need of help Alberto Candel 9 978 11-26-2013, 01:33 AM
Last Post: cyrille de Brébisson
  HP 50g - question about matrices arrays vectors etc. Sean Freeman 6 790 11-14-2013, 01:44 PM
Last Post: peacecalc
  Non-Prime question alert: Hp-41 and synthetic instructions Marcel Samek 11 1,256 11-04-2013, 09:31 PM
Last Post: sjthomas
  HP-42S celebrates its 25th anniversary today!!! Yriarte 7 798 10-31-2013, 05:56 PM
Last Post: Massimo Gnerucci (Italy)
  HP Prime SIZE and OBJ-> with matrices/vectors/lists Helge Gabert 8 866 09-27-2013, 05:44 PM
Last Post: Helge Gabert
  Programming with Matrices Han 10 923 09-25-2013, 03:59 PM
Last Post: Han
  [HP-prime] Parallel Processing, vectors, matrices as a only data type =( CompSystems 1 377 08-08-2013, 04:48 PM
Last Post: peacecalc
  QR Codes jerome ibanes 4 473 07-27-2013, 09:40 PM
Last Post: Egan Ford

Forum Jump: