number base conversion for hp17b/17bii
|
06-18-2014, 06:53 PM
Post: #1
|
|||
|
|||
number base conversion for hp17b/17bii
OK, you've got your old 17b or 17bii you use for all your financial needs, but now you need something to do number base conversions. There is no need to go to a scientific model, the solver is your friend.
B1 = old base (2-10) B2 = new base (2-10) N = number to convert ANS = solve for this Either B1 or B2 must be 10. BC:ANS=\(\Sigma\)(I:0:LOG(N)\(\div\)LOG(B2):1:MOD(N:B2)\(\times\)B1I+0\(\times\)L(N:IDIV(N:B2))) |
|||
06-19-2014, 01:59 AM
(This post was last modified: 06-19-2014 08:55 AM by Thomas Klemm.)
Post: #2
|
|||
|
|||
RE: number base conversion for hp17b/17bii
(06-18-2014 06:53 PM)Don Shepherd Wrote: BC:ANS=\(\Sigma\)(I:0:LOG(N)\(\div\)LOG(B2):1:MOD(N:B2)\(\times\)B1I+0\(\times\)L(N:IDIV(N:B2))) Very cool! Thanks for consistently bringing up this calculator. You don't need MOD if you combine the calculations from successive lines. Example: DEC → OCT Code: 2014 BC:ANS= 0\(\times\)L(K:FROM-TO) +N +\(\Sigma\)(I:1:LOG(N)\(\div\)LOG(TO):1: G(K)\(\times\)L(N:IDIV(N:TO)) +0\(\times\)L(K:FROM\(\times\)G(K)) ) Kind regards Thomas |
|||
06-19-2014, 09:06 AM
Post: #3
|
|||
|
|||
RE: number base conversion for hp17b/17bii
A little shorter:
BC:ANS= N+ (FROM-TO)\(\times\) \(\Sigma\)(I:0:LOG(N)\(\div\)LOG(TO):1: L(N:IDIV(N:TO))\(\times\)FROM^I ) |
|||
06-19-2014, 01:45 PM
Post: #4
|
|||
|
|||
RE: number base conversion for hp17b/17bii
(06-19-2014 09:06 AM)Thomas Klemm Wrote: A little shorter: Thomas, that is way cool! Thanks. The method I chose was based on how I learned to manually convert numbers from one base to another back in computer programming school in 1968. That method is described at the bottom of this page. I just converted those manual steps to an equivalent solver equation. I like your method also, it is simple and elegant. Don |
|||
06-19-2014, 02:06 PM
Post: #5
|
|||
|
|||
RE: number base conversion for hp17b/17bii | |||
06-19-2014, 02:36 PM
Post: #6
|
|||
|
|||
RE: number base conversion for hp17b/17bii
(06-19-2014 02:06 PM)Thomas Klemm Wrote:(06-18-2014 06:53 PM)Don Shepherd Wrote: Either B1 or B2 must be 10. I am stunned! I never thought that was possible. You are a true missle-man. |
|||
06-19-2014, 10:15 PM
Post: #7
|
|||
|
|||
RE: number base conversion for hp17b/17bii
(06-19-2014 02:36 PM)Don Shepherd Wrote: I am stunned! I never thought that was possible. It's been there for a while: Base Conversion for HP-11C |
|||
06-21-2014, 10:18 PM
Post: #8
|
|||
|
|||
RE: number base conversion for hp17b/17bii
Here's a program for the HP-12C:
Code: 01 - 36 ENTER Example: 201410 → 37368 10 STO PMT 8 STO FV 2014 R/S |
|||
06-21-2014, 11:27 PM
Post: #9
|
|||
|
|||
RE: number base conversion for hp17b/17bii
(06-21-2014 10:18 PM)Thomas Klemm Wrote: Here's a program for the HP-12C: That is just amazing, Thomas. I'm sure the creators of NPV and delta-percent on the 12c never envisioned those functions being used for number base conversions. I tip my hat to you, you are "da man". |
|||
06-21-2014, 11:54 PM
(This post was last modified: 06-22-2014 12:26 AM by Thomas Klemm.)
Post: #10
|
|||
|
|||
RE: number base conversion for hp17b/17bii
But then I realized that the 1:1 translation of my HP-11C program was shorter. And it uses only 3 registers. However it was fun to figure it out.
Addendum: As long as the from-base PMT doesn't change the following lines could be removed: Code: 15 - 1 1 Of course you still have to calculate i once and store it. (06-21-2014 11:27 PM)Don Shepherd Wrote: That is just amazing, Thomas. I'm sure the creators of NPV and delta-percent on the 12c never envisioned those functions being used for number base conversions. I've seen this trick in Valentin's paper: HP-12C’s Serendipitous Solver |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)