HP Forums
HP35s RPN Series # 3 [ENTER] - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: HP35s RPN Series # 3 [ENTER] (/thread-3142.html)



HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-18-2015 08:24 PM

The classic HP style [ENTER] key is an RPN conundrum; an inconsistent and illogical relic dating back to the earliest of RPN calculators, yet 'beloved' by all HP classic RPN users. What is the [ENTER] key, what is it for, how does it work? First a bold proclamation: the HP35s calculator (in fact all RPN calculators) may be used effectively for all purposes without the user ever touching the [ENTER] key-! (We have already seen this at work in the ten-key emulation method cf. #2 Entry)

As stated earlier the stack is the heart and sole of the RPN methodology; broadly stated, the [ENTER] key is the RPN primary stack manipulation key among others: [x↔y] , [R↓] , [←] , [R↑] & [CLSTK].
Contrary to its name, its purpose is not 'entry,' nor 'input,' rather its primary purpose is stack (register) manipulation, something more than mere 'entry' and nuanced by the subtleties of how and when it affects stack 'lift'; however, as is the case for unary and binary operators the [ENTER] key also shares the property of terminating numeric keying into the X stack register.

Before we get to the [ENTER] key, per se, let's perform a multiplication and let us NOT touch the [ENTER] button; to demonstrate the idea that [ENTER] is not required for 'entry,' which is important for this discussion. In order for us to find the product of two multiplicands using a 'postfix' methodology like classic RPN, we first must get the multiplicands into memory (into the X and Y registers) so that the [X] binary operator may do its job. It is important to note that it does not matter in the slightest 'how' the multiplicands get into their respective registers, only that they get there-! Consider the following key sequence: [3] [x↔y] [←] [4] [X]

The [x↔y] key terminates the [3] keying and swaps the X register with the Y register. The [←] key clears X but primarily is used to cancel automatic stack 'lift' (discussed later) in preparation for [4] keying. The [X] key terminates [4] keying and operates (multiplication) on the operands in the X and Y registers (initiating automatic stack 'drop') and leaving our product in the X register. Voilà! Notice that the [ENTER] key was not touched with this method. How many ways are there to manipulate the stack registers to accomplish the same purpose? Remember it is not important how the operands get into X and Y necessarily, only that they get there. Try this one:

[4] [R↓] [←] [3] [R↑] [X] (or) [4] [R↑] [←] [3] [X] (or) [CLSTK] [4] [+] [3] [X]

The above key stroke sequences work to multiply (4 X 3) and no one would actually do this in practice; however, this example illustrates the point that 'entry' is about controlling the stack by the use of stack manipulators (not necessarily by use of the [ENTER] key)!
Let us now return to our conundrum. The [ENTER] key is primarily a stack|register manipulator. Its purposes might be listed (below) in no particular order:
1) Initiate manual stack 'lift' replicating X into Y
2) Terminate X register keying (also initiates 'lift' and replicate, nuance #1)
3) Push a value into Y (nuance on #1)
4) Prepare X for entry (nuance on #3, and #1)

What makes [ENTER] a conundrum?

[ENTER] causes confusion because its called 'ENTER' and because it really doesn't enter anything. Primarily the [ENTER] key forces stack 'lift' and replicates X into Y; also canceling automatic 'lift' for the 'next' keying operation! (which may be leveraged in a number of interesting ways). Secondarily, [ENTER] terminates X register keying, as do most unary and binary operators; however, [ENTER] does not use an input buffer in classic style, and [ENTER] does not 'enter' X (it only terminates numeric keying of a value 'already' in the X register. Of course, [ENTER] doesn't 'equal' anything either. The [=] key does not exist on 'real' classic RPN calculators; [ENTER] has nothing to do with [=]. Well, there you have it, a conundrum; well beloved and highly useful! (if not logical, nor consistent)

Sidebar: I can't prove the following conjecture (but I believe it non the less). The [ENTER] key and its quirky behavior are an oversight, or bug, left over from the early design and test of the HP35. The [ENTER] key IMHO was not designed (it evolved) and when the dust settled the engineering team left it alone because they found uses for the accident. What makes me believe this to be true are three observations (and I go back to the era personally): 1) other programmable calculators of the era (Wang 700, others) had register manipulators, but no [ENTER] key (certainly nothing like the HP RPN [ENTER]), and 2) the [ENTER] key is not necessary using consistent entry methods [+] with other register manipulators, and 3) in a modern sense users typically often want 'entry' RPN; a style whereby [ENTER] enters a value from an input buffer into the X register-- actually 'enters' something. Neither here nor there... just historical speculation (not a theological challenge) Smile

Conclusion: Regardless how the [ENTER] key came into existence, and regardless being a conundrum, the [ENTER] is here to stay; important for register manipulation certainly. But also important as an icon of cultural expression worthy of preservation and appreciation – just for the beauty of it. Voilà !

Cheers,
marcus
Smile


RE: HP35s RPN Series # 3 [ENTER] - Don Shepherd - 02-18-2015 08:36 PM

Mark, that's quite a writeup on the ENTER key!

What seems to be lost in all of this, however, is the basic purpose of the ENTER key on an RPN calculator: it separates the two numbers in any arithmetic operation. If you don't have an equal key to deliver an answer, you need an alternative. All a casual (or new) RPN user needs to remember to operate his/her calculator successfully is that you separate your two numbers with the ENTER key, and press the desired operation key last.

Of course, RPN calculator programmers realize what the ENTER key does, but your average Joe is not a programmer and doesn't care about all that. There is just something "elegant" (shall I say) about separating your two numbers with the ENTER key and then specifying what you want to do with them.

Don


RE: HP35s RPN Series # 3 [ENTER] - Thomas Klemm - 02-18-2015 10:04 PM

(02-18-2015 08:24 PM)MarkHaysHarris777 Wrote:  1) other programmable calculators of the era (Wang 700, others) had register manipulators, but no [ENTER] key (certainly nothing like the HP RPN [ENTER])

Using the Wang 700 Programmable Calculator Simulator I have the impression that the [↑] key pretty much does what the [ENTER↑] key does: copy the number from the x register to the y register. I assume that's similar to how the 3-level stack of the HP-9100 worked:
Quote:Keying numbers into the stack did not cause the automatic stack lift that occurred on later calculators. For example, to calculate sqrt(25)+5, the user would press 2 5 [sqrt] [Enter] 5 +. The Enter wouldn't be needed on later RPN calculators. (Since calculator displayed the entire stack, the user always knew exactly where each number was and whether it needed to be copied up with Enter.)

When later calculators used a one line display, leaving results in an invisible stack register would have been a nuisance so RPN was altered. This later form of RPN popped the result down to the only visible register and then automatically pushed it back into Y when the user continued to enter data. When later HP models again used larger displays, the stack lift behavior was altered again.

Stack manipulation keys included an enter key (labeled only with an upward arrow), a drop key (labeled with a downward arrow) as well as ROLL keys for both directions and an X and Y exchange key. (X<->Y.)

With the one line display of the HP-35 the result of a calculation (i.e. what was the accumulator in register y) had to be displayed. But then this result shouldn't be overwritten with the next entry. Thus the number in display is moved to register y when a new number is entered. This is fine except immediately after the [ENTER↑] key. In this case what we call now stack-lift is disabled.

The HP-engineers came up with a clever solution for this problem.

Quote:2) the [ENTER] key is not necessary using consistent entry methods [+] with other register manipulators

Sooner or later you want to duplicate a number. You may call it what ever you like: [↑], [ENTER↑] or [DUP]. But the [+] key doesn't help here.

Cheers
Thomas


RE: HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-18-2015 10:54 PM

(02-18-2015 08:36 PM)Don Shepherd Wrote:  There is just something "elegant" (shall I say) about separating your two numbers with the ENTER key and then specifying what you want to do with them.

Yes, I agree. I've explained it that way in the past, as well. The problem comes up though that 'infix' calculators do that too: 4 + 3 = 7 ... the (+) separates the two numbers just fine. What's the difference (I'm speaking tongue in cheek, devil's advocate). Well, obviously, the stack is the difference. Its not that 'postfix' is better; its that RPN uses a stack, and stack manipulators (like the [ENTER] key) make for more efficient control of arithmetic in a hand-held calculator.

Most of our students today frankly don't know enough about what's going on in their calculator to appreciate the RPN stack (usually). The TI and Casio systems with 'pretty print' and AOS, CAS, etc, are making that worse. <sigh>

Cheers,
marcus
Smile


RE: HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-18-2015 11:07 PM

(02-18-2015 10:04 PM)Thomas Klemm Wrote:  
(02-18-2015 08:24 PM)MarkHaysHarris777 Wrote:  1) other programmable calculators of the era (Wang 700, others) had register manipulators, but no [ENTER] key (certainly nothing like the HP RPN [ENTER])

Using the Wang 700 Programmable Calculator Simulator I have the impression that the [↑] key pretty much does what the [ENTER↑] key does: copy the number from the x register to the y register.

Yes; but without all of the [ENTER] key baggage. The Wang did not have a stack. It had a rich set of register manipulators, and again, if you could figure out a way to get your numbers into the X and Y registers you could do some maths on them!

(02-18-2015 10:04 PM)Thomas Klemm Wrote:  I assume that's similar to how the 3-level stack of the HP-9100 worked:

I never got the pleasure of using the HP-9100; I believe it had a three level stack, but I cannot offer any clue how it worked, sadly.

(02-18-2015 10:04 PM)Thomas Klemm Wrote:  The HP-engineers came up with a clever solution for this problem.

Oh, no doubt; very clever (as they say, the rest is history)

(02-18-2015 10:04 PM)Thomas Klemm Wrote:  Sooner or later you want to duplicate a number. You may call it what ever you like: [↑], [ENTER↑] or [DUP]. But the [+] key doesn't help here.

I disagree. The truth is, if you'll be honest about it with yourself, you 'want' to duplicate a number with the [ENTER] key because you 'can,' not because its necessary. Well, on the surface, if you want to duplicate a number:
[2] (auto stack lift) [X] (auto stack drop) {problem solved}

I agree with you that the [ENTER] key (and its quirks) may be leveraged in many interesting ways (as I stated in my article), but its not necessary. In other words, there are alternate ways of manipulating the stack and registers without using the [ENTER] key.

Having said that, the only reason I point out the [ENTER] conundrum is to help new users (and new programmers) to understand what is really happening behind the RPN stack and [ENTER] methodology.

PS Thanks for pointing me into the Wang emulator again... brings back many fond memories (almost chokes me up to see it again).

Cheers,
marcus
Smile


RE: HP35s RPN Series # 3 [ENTER] - Don Shepherd - 02-18-2015 11:25 PM

(02-18-2015 10:54 PM)MarkHaysHarris777 Wrote:  Most of our students today frankly don't know enough about what's going on in their calculator

I'm sure that's true. My math students don't use calculators (middle school). I want them to learn how to add, subtract, multiply, and divide the way I learned it 50 years ago. Call me old-fashioned, I wear that badge proudly.


RE: HP35s RPN Series # 3 [ENTER] - Sanjeev Visvanatha - 02-18-2015 11:37 PM

(02-18-2015 08:24 PM)MarkHaysHarris777 Wrote:  What makes [ENTER] a conundrum?

[ENTER] causes confusion because its called 'ENTER' and because it really doesn't enter anything.

It enters the X register value into the Y register. I have always thought of it as "STO Y". This is what it does in its simplest sense. The named function of STOring to a stack register did not exist at the time the earliest HP RPN machines came out.


RE: HP35s RPN Series # 3 [ENTER] - Thomas Klemm - 02-19-2015 12:02 AM

(02-18-2015 11:07 PM)MarkHaysHarris777 Wrote:  The truth is, if you'll be honest about it with yourself, you 'want' to duplicate a number with the [ENTER] key because you 'can,' not because its necessary.

Evaluating a polynomial \(p(x)\) comes to my mind. Sure, I'm just lazy and don't want to key in \(x\) multiple times.


RE: HP35s RPN Series # 3 [ENTER] - Thomas Klemm - 02-19-2015 12:16 AM

(02-18-2015 11:07 PM)MarkHaysHarris777 Wrote:  I never got the pleasure of using the HP-9100; I believe it had a three level stack, but I cannot offer any clue how it worked, sadly.

No problem: Dave has already given a description in the link HP-9100 I provided.


RE: HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-19-2015 06:30 AM

(02-18-2015 11:37 PM)Sanjeev Visvanatha Wrote:  
(02-18-2015 08:24 PM)MarkHaysHarris777 Wrote:  What makes [ENTER] a conundrum?

[ENTER] causes confusion because its called 'ENTER' and because it really doesn't enter anything.

It enters the X register value into the Y register. I have always thought of it as "STO Y". This is what it does in its simplest sense. The named function of STOring to a stack register did not exist at the time the earliest HP RPN machines came out.

Yes, many think of it that way (which is kinda my point)... that is NOT what it does. The [ENTER] key initiates 'stack lift' (which is way more baggage than STO Y. The T reg is lost, Z is copied into T, Y is copied into Z, and X is replicated (copied) into Y; automated stack lift is canceled (for the next keying) and the X keying is terminated. whew. Goes a lot further than, STO Y. Of course moderns want an input buffer, and they want the [ENTER] key to STO X basically (leaving the stack alone). I am not in favor of this, actually. I configure my Droid virtual RPN calc (RealCalc) to use a traditional [ENTER] and XYZT four level stack.

Cheers,
marcus
Smile


RE: HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-19-2015 06:37 AM

Greetings, as I was fixing my overlay and button stickers on my latest WP34s (20b unit) tonight I noticed the [ENTER] key-- has a little vertical white arrow along with the word ENTER. This is an improvement, actually. If I had designed the HP I would have called the [ENTER] key the [STACK] key, and I would have put a little vertical arrow on it. See pic:

[Image: wp34s_20b_2015.jpg]


Eric, if you're listening out there in Texas, I received the caps, crystals, and overlays tonight (frozen solid of course). I had dinner while they thawed out and got to work (for dessert!).
The 20b came out nicely; it is quickly becoming my favorite WP34s (of the five units I've successfully repurposed. Thanks much bubba!

Cheers,
marcus
Smile


RE: HP35s RPN Series # 3 [ENTER] - Tugdual - 02-19-2015 08:37 AM

(02-19-2015 06:37 AM)MarkHaysHarris777 Wrote:  Greetings, as I was fixing my overlay and button stickers on my latest WP34s (20b unit) tonight I noticed the [ENTER] key-- has a little vertical white arrow along with the word ENTER. This is an improvement, actually. If I had designed the HP I would have called the [ENTER] key the [STACK] key, and I would have put a little vertical arrow on it. See pic:

[Image: wp34s_20b_2015.jpg]


Eric, if you're listening out there in Texas, I received the caps, crystals, and overlays tonight (frozen solid of course). I had dinner while they thawed out and got to work (for dessert!).
The 20b came out nicely; it is quickly becoming my favorite WP34s (of the five units I've successfully repurposed. Thanks much bubba!

Cheers,
marcus
Smile
Oh wow brand new 34s is looking good.
Mine is really in poor condition now, mainly because of stickers, to the point I moved to a 35s which is far less powerfull but good enough on a daily base and far better casing.


RE: HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-19-2015 09:13 AM

(02-19-2015 08:37 AM)Tugdual Wrote:  Oh wow brand new 34s is looking good.
Mine is really in poor condition now, mainly because of stickers, to the point I moved to a 35s which is far less powerfull but good enough on a daily base and far better casing.

The WP34s is soooo needing to be commercially marketed; photo spreads, posters, chick appeal, the whole nine yards... it needs a real case (actually, the case is fine, very solid, just needs real buttons). I love the 35s, really, but its case (well made as it is) is just a 'tad' too big... with a case that big it should have had a four line display, IMHO.

The WP43s will hopefully have a real case, real buttons, four line display (all points addressable) and be the same size as the WP34s... I hope.

Cheers,
marcus
Smile


RE: HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-19-2015 08:53 PM

(02-18-2015 11:37 PM)Sanjeev Visvanatha Wrote:  
(02-18-2015 08:24 PM)MarkHaysHarris777 Wrote:  What makes [ENTER] a conundrum?

[ENTER] causes confusion because its called 'ENTER' and because it really doesn't enter anything.

It enters the X register value into the Y register. I have always thought of it as "STO Y". This is what it does in its simplest sense. The named function of STOring to a stack register did not exist at the time the earliest HP RPN machines came out.


I've been thinking about your comment today, also in light of the discussion going on in the WP34s forum regarding allowing 'entry' RPN as a configurable alternative. Of course, I don't have any idea how the engineers of the HP35s implemented [ENTER] precisely, because it is not an open platform. The WP34s, on the other hand, is an open platform and we can take a look at some of its code:

Code:


/* Decode and process the specials.  These are niladic functions and
 * commands with non-standard stack operation.
 */
static void specials(const opcode op) {
    int opm = argKIND(op);

    switch (opm) {
    case OP_0:    case OP_1:    case OP_2:
    case OP_3:    case OP_4:    case OP_5:
    case OP_6:    case OP_7:    case OP_8:
    case OP_9:    case OP_A:    case OP_B:
    case OP_C:    case OP_D:    case OP_E:
    case OP_F:
        digit(opm - OP_0);
        break;

    case OP_DOT:
        if (is_intmode())
            break;

     . . .  {code snipped here for clarity}


    case OP_ENTER:             <======== this is what we're interested in
        process_cmdline();
        lift();
        clr_lift();
        break;

You will notice that OP_ENTER does the three things I noted in my article: 1) process the command line {parsing, error checking, terminates keyboard numeric entry}, 2) initiate stack lift {this is the hefty work of [ENTER]}, and 3) clear the 'lift' state {cancels lift for the next keyboard command line activity}

This switch-case statement is handling (partially) commands that have non standard stack operations (and there are quite a few which I have snipped away to simplify things here). This is what makes [ENTER] a conundrum for RPN methodology. It really doesn't DO what its name implies, and it DOES do things that the user does not understand... even if they can observe them and describe them... each person comes away with their own interpretation of what [ENTER] means (for them, and for the system!)


Cheers,
marcus
Smile


RE: HP35s RPN Series # 3 [ENTER] - Sanjeev Visvanatha - 02-20-2015 02:19 AM

If you look at the older manuals, there was an entire chapter devoted to stack mechanics and the Enter key. Something so complex requires a simple designation on the keypad, IMO. The user has to read the manual, experiment, and gain confidence in what the machine is doing. It doesn't take long for a technically minded person to master it.

You had mentioned the "=" key earlier. Well, "=" is also in the same boat by your logic. It doesn't equal anything unless the user understands OOP and the use of parenthesis.


RE: HP35s RPN Series # 3 [ENTER] - MarkHaysHarris777 - 02-20-2015 05:34 AM

(02-20-2015 02:19 AM)Sanjeev Visvanatha Wrote:  You had mentioned the "=" key earlier. Well, "=" is also in the same boat by your logic. It doesn't equal anything unless the user understands OOP and the use of parenthesis.

hi Sanjeev, sorry to be argumentative (because I enjoy dialoguing with you) but I must disagree again; and here is why... and it's important! The primary difference between the calculation methodology of classic HP RPN, and algebraic systems like TI's AOS, for instance, and others, is that RPN stacks ONLY the data. Algebraic systems necessarily stack BOTH the data AND the operators (and in fact, must stack the operators in some fashion with nested levels of parenthesis according to a complex set of 'algebraic hierarchy' or order of precedence of operations). This 'requires' necessarily and absolutely an 'equals' key. Now, for semantics, you may call the key [=], [Solve], [Resolve], [Approximate], or [GO], but hey, it necessarily must be there; equals actually and really means 'equals'. Something must tell the system to unstack the data (and the 'infix' operators) according to algebraic usage; the stack must be 'unwound' if you will. This is entirely different from the RPN methodology of [ENTER], and its semantics|baggage, whereby only the data are stacked and the user handles all of the policy of precedence and execution dynamics-- what 'postfix' calculation strategy of RPN is all about!

By the way, I do not really believe that the HP engineers in the beginning were really all fired up about Jan Łukasiewicz' PN, nor the elegance of 'postfix' methodology from some kind of intellectual pedestal (or anything like that, no one will ever convince me). That is just HP revisionist history to justify the paradigm. The real issue in 1972 was memory and speed. Why use valuable onboard memory (or complicated policy, programming) within the calculator when the user is better suited for the purpose of precedence and policy... when the calculator requires EVERY 'bit' (pun intended) of memory for the actual algorithms? Postfix methodology works well with a stack, and that's what Hewlett needed! The method may have come from Jan Łukasiewicz (at some level) but the mother-of-invention (primarily) involved the idea that logic of that era was 'slow' and memory was difficult and expensive.


Thanks for the dialogue.

Cheers,
marcus
Smile