history of the 4-level stack
|
09-05-2014, 09:11 PM
Post: #1
|
|||
|
|||
history of the 4-level stack
Hello,
I'm trying to find out what lead HP to evolve to a 4-stack layout. The 9100 [1] started with X (keyboard), Y (accu). Browsing the 9100B manual (p. 10) tells me Z is a kind of "temporary" storage (used for 'temporary' storage; the number is stored in the Z register while arithmetic operations are performed on two other numbers in the X and Y registers, then the number in Z can be returned to Y and included once again in the calculation . Use of the Z register saves using the program and data storage registers.), not very convincing. [2] reads "Experienced HP calculator users have determined that by starting every problem at its innermost number or parentheses and working outward, just as you would with paper and pencil, you maximize the efficiency and power of your HP calculator." Which is not a lie, but does not admit that not all expressions will be solvable with 4 levels... The solution is registers (Section 4). Likewise, [3] reads "Automatic storage of intermediate results is the reason that the HP-41 C makes solution of even the most complex equations simple." Again, not very honest, seems to me. Why not more, or less? (Especially when expressions exist that cannot be evaluated with 4 levels.) Why did they evolve from 3 to 4 levels? I can't believe it is only to be able to provide the T trick (endless provision of a constant for non-commutative ops, [4]). One hypothesis of mine was that this is somehow related to the three types of operations: sums, products, powers. Someone hinted that maybe "Architecturally, addressing a fourth thing is pretty cheap, and costs only a few transistors. Adding a FIFTH register, on the other hand, would be a massive change, adding an extra wire to the bus, an extra bit to the microcode field, ...". I can't recall exactly where someone wrote that T was related to trig calculations. I started bundling related articles at [5]. rgds, -alex- ps - having a 48SX and a swiss micro 15C clone (horrible keys), browsing the 9100 user manual does not give me confidence I would be able to correctly operate a 9100... [1] http://www.hpmuseum.org/rpnvers.htm#3level [2] HP-67 Owners Handbook, p. 66 (Automatic stack) [3] HP-41 C/CV Owner's hb, Section 3 (Automatic stakc) [4] HP-41 CX owners manual vol 2, p177 [5] https://delicious.com/axd/HP,stack Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-06-2014, 06:08 AM
(This post was last modified: 09-06-2014 06:18 AM by walter b.)
Post: #2
|
|||
|
|||
RE: history of the 4-level stack | |||
09-06-2014, 06:57 AM
Post: #3
|
|||
|
|||
RE: history of the 4-level stack
(09-05-2014 09:11 PM)axd1967 Wrote: I can't recall exactly where someone wrote that T was related to trig calculations. BTW, the explanation is also found in one of the threads you collected in [5] (guess which?). You see, collecting's not sufficient, one should still be able to oversee one's collection. d;-) |
|||
09-06-2014, 07:33 AM
(This post was last modified: 09-06-2014 07:34 AM by jebem.)
Post: #4
|
|||
|
|||
RE: history of the 4-level stack
Hi Alex, welcome to our MoHPC forums.
Nice thread and question, but I guess the answer will vary depending on your view point. My 2 cents: Like any other technology, calculators evolved depending not only on science reasoning but also on other factors constraining the final design (budget, time to delivery, marketing, available technology,...). So 4 levels seems to be a good number of registers to allow most of math real number operations while allowing humans to remember its contents. Handling more than that means you are above average memorizing stack contents, or you are using a modern multi line display calculator. Most of the machines in that era were also programmed, or should I say macro coded, in machine key coding using very basic low level control structures. This was the beginning of portable computing after all. It is not a coincidence that when multi line displays arrived to market, new programming paradigms also emerged, like RPL for instance, capable of structured thinking in order to get rid of the machine code spaghetti progamming used before. Jose Mesquita RadioMuseum.org member |
|||
09-06-2014, 04:03 PM
(This post was last modified: 09-06-2014 04:05 PM by Jeff_Kearns.)
Post: #5
|
|||
|
|||
RE: history of the 4-level stack
(09-05-2014 09:11 PM)axd1967 Wrote: [1] http://www.hpmuseum.org/rpnvers.htm#3level Hi Alex, Your main questions seem to be, why did HP evolve from a 3-level stack in the 9100 (circa 1968) to a 4-level stack in the HP-35 (circa 1972), and why are there not less or more than 4-level stacks in classic RPN? First off, the 'true' history of RPN seems rather muddled, and I suggest you read the evolution of RPN and numeric entry on the museum site as a starting point. The highly recommended reference book: "Algorithms for RPN Calculators", by John A. Ball, 1978, has a section on the history of RPN, wherein he claims the RPN calculator "owes about as much to the venerable mechanical calculator, and to a number of anonymous designers, some of whom worked at Friden, as it does to Jan Lukasiewicz". 'The Definitive Guide to How Computers Do Math", by Clive Maxfield and Alvin Brown, 2005, states that Charles Leonard Hamlin (1822-1985), one of Australia's first computer programmers, pioneered the placement of operators after the operands, and that his method is what became known as reverse Polish notation (RPN). Even though the Friden EC-130, circa 1964, and the Monroe Epic Calculator, circa 1966, do not mention "RPN" or Lukasiewicz (roughly pronounced woo-ka-shea-vich), they clearly operated according to a postfix, parentheses-free, 'RPN'-like fashion - and they each had a 4-level push-down stack. Undoubtedly, HP improved on this with the repeating T register and seems to be the first company to use the term RPN (which they patented). I think if you search the archives you will many discussions about RPN stack levels and I would say Jose Mesquita provided a good summary in his response - that it is all about compromise. Less than 4 levels is undesirable (a 2 level stack would be the absolute minimum to even qualify as a calculator) and more than 4 level stacks would make memorization of stack contents difficult for most people. Jeff K |
|||
09-06-2014, 05:15 PM
(This post was last modified: 09-06-2014 05:25 PM by axd1967.)
Post: #6
|
|||
|
|||
RE: history of the 4-level stack
(09-06-2014 06:08 AM)walter b Wrote:(09-05-2014 09:11 PM)axd1967 Wrote: I can't recall exactly where someone wrote that T was related to trig calculations. Thx; so what could be the nature of the interaction between trig ops and T? Maybe trig ops involve polynomials, for which the T-drop down is handy? But wouldn't 3 levels also accomplish this? Edit added: Classic Series Technology says "The final register did double duty as the topmost register in the stack (T) and as a working register for trigonometric functions. Thus when a trig function was used, the topmost value in the stack was lost.". Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-06-2014, 05:27 PM
Post: #7
|
|||
|
|||
RE: history of the 4-level stack
Quote:My 2 cents:It feels like this is the main reason for 4 levels, plus the CPU architecture had room for it (and no more!). Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-06-2014, 06:06 PM
Post: #8
|
|||
|
|||
RE: history of the 4-level stack
Quote:Even though the Friden EC-130, circa 1964, and the Monroe Epic Calculator, circa 1966, do not mention "RPN" or Lukasiewicz (roughly pronounced woo-ka-shea-vich), they clearly operated according to a postfix, parentheses-free, 'RPN'-like fashion - and they each had a 4-level push-down stack. Undoubtedly, HP improved on this with the repeating T register and seems to be the first company to use the term RPN (which they patented).Interesting, this suggests that '4' is an interesting value. Quote:I think if you search the archives you will many discussions about RPN stack levels and I would say Jose Mesquita provided a good summary in his response - that it is all about compromise. Less than 4 levels is undesirable (a 2 level stack would be the absolute minimum to even qualify as a calculator) and more than 4 level stacks would make memorization of stack contents difficult for most people.Machine searched all archives (1,2,3,4) for "Jose Mesquita" but found nothing, sorry. Can you provide links to the relevant article(s)? BTW, not sure '4' is an optimal value, see The Magical Number Seven, Plus or Minus Two (although '4' also pops up in the article), which dates from 1956, so HP might have been aware of it. Meanwhile, I had already found this thread most interesting. Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-06-2014, 08:28 PM
(This post was last modified: 09-06-2014 08:30 PM by walter b.)
Post: #9
|
|||
|
|||
RE: history of the 4-level stack
(09-06-2014 06:06 PM)axd1967 Wrote:Quote:I think if you search the archives you will many discussions about RPN stack levels and I would say Jose Mesquita provided a good summary in his response - that it is all about compromise. Less than 4 levels is undesirable (a 2 level stack would be the absolute minimum to even qualify as a calculator) and more than 4 level stacks would make memorization of stack contents difficult for most people. Good things are sometimes closer than you expect. The user "jebem" is the one you are looking for (post #4). And about the statement more than 4 level stacks would make memorization of stack contents difficult for most people (read that far more than once here): True for sure but actually nobody needs memorizing all stack contents unless doing high level stack gymnastics. You just have to know how the stack works and that you can trust your intermediate results pop up again just at the right time - that's all. I never had the ambition to memorize all stack contents - nonetheless RPN works for me as well, be it with 4 or 8 levels. d:-) |
|||
09-07-2014, 01:33 AM
(This post was last modified: 09-07-2014 01:35 AM by Jeff_Kearns.)
Post: #10
|
|||
|
|||
RE: history of the 4-level stack | |||
09-07-2014, 10:04 AM
Post: #11
|
|||
|
|||
RE: history of the 4-level stack
(09-07-2014 01:33 AM)Jeff_Kearns Wrote:(09-06-2014 06:06 PM)axd1967 Wrote: Machine searched all archives :-) Already found that one! It's the most interesting thread yet. Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-07-2014, 10:19 AM
(This post was last modified: 09-10-2014 03:01 PM by axd1967.)
Post: #12
|
|||
|
|||
RE: history of the 4-level stack
Quote:Good things are sometimes closer than you expect. The user "jebem" is the one you are looking for (post #4).OK - finally got it - we are referring to this thread's post #4. Thx. For the moment, I still believe 4-stack is the result of CPU architecture. Questions that remain:
Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-07-2014, 10:43 AM
Post: #13
|
|||
|
|||
RE: history of the 4-level stack
Hello RPN fans,
Quote:walter b wrote: (post #9) Your argument doesn't hold, if you work out a program with such a stack. I often had to draw a sketch where I could see which value is in which stack place . It is a kind of sadism to program stack manipulation over lets say six stack places (with my preferred HP 50g). Greetings peaceglue |
|||
09-07-2014, 02:17 PM
Post: #14
|
|||
|
|||
RE: history of the 4-level stack
(09-07-2014 10:19 AM)axd1967 Wrote: Why did trig operations impact T in the 35? Why not 'log', for example? In short: the pseudo-multiplication used to calculate tangens involves 2 coordinates to keep track of. Thus the list of pseudo-quotients is saved to the stack (c -> stack) and later recalled again (stack -> a): Code: tan18: shift right b[wp] In case of logarithms it's just one constant that has to be multiplied by the pseudo-quotient and added to a total. I recommend to have a look at: HP35 trigonometric algorithm HP 35 Logarithm Algorithm Quote:Note that the stack is used (at 01374) destroying thus its top. Cheers Thomas |
|||
09-07-2014, 02:21 PM
Post: #15
|
|||
|
|||
OT: deep stack issues
Quote:It is a kind of sadism to program stack manipulation over lets say six stack places (with my preferred HP 50g). As Walter writes, it doesn't really matter how much is on the stack; all that matters is the few arguments that the current subroutine needs, and what arguments it is expected to put on the stack before quitting. Because routines can call each other (even recursively), they will add their layers of temporary objects on the stack, but if well written, they will only leave data behind that the caller needs. A casual user might indeed get lost when interrupting an app that is running deep in calls, but that doesn't matter from the perspective of each routine. So a well written app should end with no garbage left on the stack, only with the expected output. Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-07-2014, 03:13 PM
Post: #16
|
|||
|
|||
RE: history of the 4-level stack
Quote:Note that the stack is used (at 01374) destroying thus its top. Great! (for 01374, see also here.) Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
09-07-2014, 03:27 PM
Post: #17
|
|||
|
|||
RE: history of the 4-level stack
(09-07-2014 02:21 PM)axd1967 Wrote:peacecalc Wrote:It is a kind of sadism to program stack manipulation over lets say six stack places (with my preferred HP 50g). @axd1967: you're right though actually I was thinking of calculations instead of subroutines. @peacecalc: definitly. Who does such horrible things? d:-) |
|||
09-07-2014, 05:02 PM
Post: #18
|
|||
|
|||
RE: history of the 4-level stack
Quote:walter b asks: I'm good in doing such things! I've tried it two or three times, then I compared the performance of the calculator with values hold on the stack (and with necessery manipulations commands) and on the other side code with local variables. I was really disappointed: The stack version isn't faster then the version with locals, and the code with the locals is much more better for reading and debugging. Greetings peacecalc |
|||
09-10-2014, 12:45 AM
(This post was last modified: 09-10-2014 12:51 AM by Jeff_Kearns.)
Post: #19
|
|||
|
|||
RE: history of the 4-level stack
(09-05-2014 09:11 PM)axd1967 Wrote: Hello, Here is a copy/paste from HP Solve Issue 14, 2009-08: The “RPN” Stack - Future & Past (Part 2) Quote:The “RPN” Stack - Future & Past (Part 2)[/code] |
|||
09-10-2014, 09:35 AM
Post: #20
|
|||
|
|||
RE: history of the 4-level stack
Great info, thx!
Free42; 48SX; 42S; 15C; DM-15; DM-41 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)