The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[WP34S] LocRm allocation function missing?
Message #1 Posted by Chris Tvergard on 13 May 2012, 12:48 p.m.

Would it be possible for the WP34S project to include a well documented LocRm function which brings the calculator into it's max. local data register configuration? It seems cumbersome for me to guess which settings to change in order to get which max. allocation for LocR use. I would like to get quick access to my standard min. 200 data regs. wish requirement.

Chris

Edited: 13 May 2012, 2:02 p.m.

      
Re: [WP34S] LocRm allocation function missing?
Message #2 Posted by Walter B on 13 May 2012, 3:40 p.m.,
in response to message #1 by Chris Tvergard

Hmmh, this max depends on the number of global registers you allocated (assume you took the startup default 100), the need for summation registers (assume you don't need them?), and the size of program memory you require. If you start with the startup default of 100 global numbered registers and no statistics, write a little program containing LocR 100 and you've got your 200 registers you want - even 12 more due to the stack and lettered registers. So I hope I understood you correctly.

Edited: 13 May 2012, 3:55 p.m.

            
Re: [WP34S] LocRm allocation function missing?
Message #3 Posted by Chris Tvergard on 13 May 2012, 6:20 p.m.,
in response to message #2 by Walter B

Walter,

You understand me correctly, of course, and I appreciate your input. What you say is exactly what I want.

The catch is the input from Marcus that even a simple XEQ kills the local data, so unless I can do my calculations truly internally, which I may, or will desparately try to do, then I am back to the R00-R99 plus the lettered A-D etc. regs.

Briefly, I have 90 source data in R00-R89, the next ten for internal calculation result storage. Then I have 90 exponential weights summed to unity and based upon analysis of the source data placed in my imaginary upper say R155-R255, in which the last ten would be for very local short time storage and end up in A-D say.

The rest are then statistical calculations but I can do that without using XEQ, maybe. Ultimately the new 90 data sequence would be stored in R00-R89. Let's face it, pushing Monte Carlo probability runs into a neural network with a volatility lognormal 2 days-into-the-future prediction value is a stretch even on a WP34S. But I think I can do it. Of course, I can always go back to my HP Folio Ultrabook and do it all in Excel, but that somehow does not present the same thrill factor. There is something very alluring about doing neural networks on a handheld calculator. And I'm almost there thanks to the WP34S that you guys are inventing as we speak!

Thanks again,

Chris

                  
Re: [WP34S] LocRm allocation function missing?
Message #4 Posted by Paul Dale on 13 May 2012, 6:37 p.m.,
in response to message #3 by Chris Tvergard

Quote:
The catch is the input from Marcus that even a simple XEQ kills the local data, so unless I can do my calculations truly internally, which I may, or will desparately try to do, then I am back to the R00-R99 plus the lettered A-D etc. regs.

XEQ from the keyboard kills the local data. XEQ in a program does not and the local data is available in the called routine until it does a LocR command.

If you want to run code from the keyboard without losing local data, Use GTO and R/S and I think it will be okay.

Otherwise, it seems like your problem is simply too large for this device.

- Pauli

                        
Re: [WP34S] LocRm allocation function missing?
Message #5 Posted by Chris Tvergard on 13 May 2012, 8:38 p.m.,
in response to message #4 by Paul Dale

Paul,

Thanks. I just noticed your post on my messed up thread sequence. Sorry.

Now, that is entirely different then. A local XEQ does not kill the data. I'll have to do some testing routines and logically make a 34S behavior matrix. That may change everything back. Many thanks for that additional information.

It could be that my idea is a bit too big. However, I want to point out that in order to do Monte Carlo one does not need to generate an array. By definition neural networks need array "memory" as I am sure you know.

I still see a lot of potential in the WP34S, and as you guys introduce printing and who knows even a memory card option some day - that's good.

It's too bad we had to wait 35 years for a group of great thinkers like you and your fellow WP34S team to show up and work together across continents - and for free.

Thanks.

Chris

      
Re: [WP34S] LocRm allocation function missing?
Message #6 Posted by Marcus von Cube, Germany on 13 May 2012, 3:53 p.m.,
in response to message #1 by Chris Tvergard

There is such a configuration but it's not utterly useful: REGS 00, CL[SIGMA] and CLPALL makes all memory available to the subroutine return stack which is also used for local data. But this makes a simple STO 00 impossible and it is only feasible if you have the programs you are using moved to flash memory.

Instead, you should just allocate (via LocR) as much memory as you need and if this fails with a memory error make room with one of the above mentioned commands. Local data is really only useful inside a program. You can only address 16 local registers directly (.00 to .15). More is possible but only indirectly addressable.

The real beauty of local registers in subroutines is that they are independent of the caller's memory and therefore cannot clobber its data. For bulk data, the global registers are better suited but your mileage may vary. Global registers are more stable in the sense that they are not easily lost by doing a manual XEQ (or hot key) which resets the return stack and thus clears all local data.

(Reposted because I had answered the wrong post.)

            
Re: [WP34S] LocRm allocation function missing?
Message #7 Posted by Chris Tvergard on 13 May 2012, 5:51 p.m.,
in response to message #6 by Marcus von Cube, Germany

Marcus,

I just noticed upon fine reading that you said one simple XEQ will kill local data. That is local allright and volatile. I really needed two 90 data sets, but I may now from what you say go via the Sigma functionality combined with the R00-R99. I can then do the simulation part without leaving the routine in any way. It is still doable but more complicated. What helps me is that I know N, i.e. the number of sample data, up front, as well as the distribution mean and variance.

Thanks Marcus, (and good bye to my LocRm idea)

Chris

PS: Is there any way one can store data (arrays) in the flash even though that may "wear out" the chip?

Edited: 13 May 2012, 5:53 p.m.

                  
Re: [WP34S] LocRm allocation function missing?
Message #8 Posted by Walter B on 13 May 2012, 11:55 p.m.,
in response to message #7 by Chris Tvergard

Quote:
Is there any way one can store data (arrays) in the flash even though that may "wear out" the chip?


FYI, we had that in discussion several weeks ago but dropped it for exactly the reason you mentioned.
                        
Re: [WP34S] LocRm allocation function missing?
Message #9 Posted by Paul Dale on 14 May 2012, 12:00 a.m.,
in response to message #8 by Walter B

We used to have commands to read & use the registers in the flash backup -- no write just read. Deemed too large to keep in the image.

- Pauli

                  
Re: [WP34S] LocRm allocation function missing?
Message #10 Posted by Marcus von Cube, Germany on 14 May 2012, 2:34 a.m.,
in response to message #7 by Chris Tvergard

As Pauli stated, clearing local registers only happens if you manually XEQ a routine. Inside a program this wouldn't be of much help. ;-)

                        
Re: [WP34S] LocRm allocation function missing?
Message #11 Posted by Chris Tvergard on 14 May 2012, 10:14 a.m.,
in response to message #10 by Marcus von Cube, Germany

Marcus, Walter, & Paul,

Thanks for your overnight world wide additional comments. I'm from Arctic Alaska so I'm beginning to suffer from WP34S induced jet lag ....

This is a great way to learn directly from the masters, however.

Chris


[ Return to Index | Top of Index ]

Go back to the main exhibit hall