HP Forums
first post . how to find program - Modulus div - 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: first post . how to find program - Modulus div (/thread-15953.html)



first post . how to find program - Modulus div - asterysk - 11-25-2020 02:18 PM

Hi

This is my first post on the forum. I am trying to work out how to modulus division (in mod 10 and mod 2) as a program

although I would like to know the answer ! I am more interested in how I can best use the forum resources to find the programming sequence so that when I have similar queries down the line I can find the program myself.

Any pointers gratefully received


RE: first post . how to find program - Modulus div - Allen - 11-25-2020 03:25 PM

Welcome!

Which calculator are you using?

If you want to get started programming, the HP manuals are a pretty good first start, I'd suggest starting with your manual. Some of the more recent models have PDF files available for download from HP's website.

If you are looking for how to program modular division in general, using the internet ( e.g. Kahn Academy or geeksforgeeks ) would be faster and more useful than posting something in a forum.


RE: first post . how to find program - Modulus div - Maximilian Hohmann - 11-25-2020 03:28 PM

Hello!

(11-25-2020 02:18 PM)asterysk Wrote:  ... I am more interested in how I can best use the forum resources to find the programming sequence so that when I have similar queries down the line I can find the program myself.

This will depend very much on the calculator for which you want to write the program. This forum is (mostly) about calculators from Hewlett-Packard, old an modern. Even among these there must be a dozen (or so) programming "paradigms" by which such a task can be programmed. Many HP calculators, again old and new, do already come with a pre-programmed modulus function so nothing needs to be done at all if one of these is used...

So which calculator do you have in mind for writing your program?

Regards
Max


RE: first post . how to find program - Modulus div - Artur - Brasil - 11-25-2020 05:51 PM

(11-25-2020 02:18 PM)asterysk Wrote:  Hi

This is my first post on the forum. I am trying to work out how to modulus division (in mod 10 and mod 2) as a program

although I would like to know the answer ! I am more interested in how I can best use the forum resources to find the programming sequence so that when I have similar queries down the line I can find the program myself.

Any pointers gratefully received

Hi, have you seen in the HP Forum page you have other links for programs?
General Software Library, HP 41 Software library, HP Prime are some of them.
I had not found a simple way to search for specific problems, as the forum is not classified - it is a big general list of programs - as I understand.

For these specific programs you're looking for a solution, as others stated, you need to say the calculator model.

Best wishes,
Artur


RE: first post . how to find program - Modulus div - asterysk - 12-01-2020 04:33 AM

Thankyou for the useful tips.

I have an HP97S (I/O) in working order but no manuals. Have just ordered the USB from MoHPC so should have the documentation in a while to work through.

My aim is to use the HP97 to de-encipher One Time Cipher messages (and also perhaps cypher them).

I am going to use the Mod 10 method (https://www.amrron.com/wp-content/uploads/2015/05/one_time_pad.pdf) .

This will be my first time programming an HP calculator and the One Time Cipher seems straightforward enough once I work out the Mod 10 division

What I want to do is this : (de-cipher)
1) Store the One Time Cipher on a programmable card (it will be sets of 5 digits 0-9 , 10 sets )
2) Type in the ciphered message (it will be 50 digits 0-9)
3) decipher the message using the programmable card (this is the mod 10 part) , the message will still be a sequence of digits 0-9
4) convert these de-ciphered digits into Alpha Numeric text using a lookup table

The ciphering would just be the reverse

I think this will give me a good intro to the basics before I try something a bit more advanced.

My ultimate aim is to hook the 97S into my autopilot on my boat (as a backup system) and also to use it as a training device for my sextant, both of these are big projects and way down the line when I get some free time !!


RE: first post . how to find program - Modulus div - Maximilian Hohmann - 12-01-2020 02:49 PM

Hello!

(12-01-2020 04:33 AM)asterysk Wrote:  My ultimate aim is to hook the 97S into my autopilot on my boat (as a backup system) and also to use it as a training device for my sextant, both of these are big projects and way down the line when I get some free time !!

Interesting project, but you know that the HP-97 only has 224 (not expandable in any way!) program steps? That will be quite a challenge!

Here is a small program to compute the Modulo function on that calculator (not mine, I found it here: https://www.hpmuseum.net/pdf/KeyNotes_1979_Feb_Vol3No1_13pages_OCR.pdf)
It does however only work properly when both arguments have the same sign. Extra program steps will be required to get that right.

Y mod X (with y and x in the proper registers)

Lbl A
/
Lst X
X<>Y
Frac
*
RTN

Good luck with your project!

Regards
Max

NB: You write: "1) Store the One Time Cipher on a programmable card (it will be sets of 5 digits 0-9 , 10 sets )" but the paper you quote tells you at least ten times NOT to do that ;-)


RE: first post . how to find program - Modulus div - asterysk - 12-01-2020 04:30 PM

(12-01-2020 02:49 PM)Maximilian Hohmann Wrote:  Here is a small program to compute the Modulo function on that calculator (not mine, I found it here: https://www.hpmuseum.net/pdf/KeyNotes_1979_Feb_Vol3No1_13pages_OCR.pdf)
Thats very useful, thankyou. The PDF is also very interesting reading


RE: first post . how to find program - Modulus div - asterysk - 12-01-2020 04:33 PM

(12-01-2020 02:49 PM)Maximilian Hohmann Wrote:  NB: You write: "1) Store the One Time Cipher on a programmable card (it will be sets of 5 digits 0-9 , 10 sets )" but the paper you quote tells you at least ten times NOT to do that ;-)

It is definitely most secure if the cipher is not entered into the calculator but for testing purposes I don't want to be typing it ! If it all works okay then I will be doing some forensics to see if the cipher is still accessible after turn off and if so what can be done to wipe it.