number base conversion for hp17b/17bii

06182014, 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 (210) B2 = new base (210) 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\)B1^{I}+0\(\times\)L(N:IDIV(N:B2))) 

06192014, 01:59 AM
(This post was last modified: 06192014 08:55 AM by Thomas Klemm.)
Post: #2




RE: number base conversion for hp17b/17bii
(06182014 06:53 PM)Don Shepherd Wrote: BC:ANS=\(\Sigma\)(I:0:LOG(N)\(\div\)LOG(B2):1:MOD(N:B2)\(\times\)B1^{I}+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:FROMTO) +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 

06192014, 09:06 AM
Post: #3




RE: number base conversion for hp17b/17bii
A little shorter:
BC:ANS= N+ (FROMTO)\(\times\) \(\Sigma\)(I:0:LOG(N)\(\div\)LOG(TO):1: L(N:IDIV(N:TO))\(\times\)FROM^I ) 

06192014, 01:45 PM
Post: #4




RE: number base conversion for hp17b/17bii
(06192014 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 

06192014, 02:06 PM
Post: #5




RE: number base conversion for hp17b/17bii  
06192014, 02:36 PM
Post: #6




RE: number base conversion for hp17b/17bii
(06192014 02:06 PM)Thomas Klemm Wrote:(06182014 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 missleman. 

06192014, 10:15 PM
Post: #7




RE: number base conversion for hp17b/17bii
(06192014 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 HP11C 

06212014, 10:18 PM
Post: #8




RE: number base conversion for hp17b/17bii
Here's a program for the HP12C:
Code: 01  36 ENTER Example: 2014_{10} → 3736_{8} 10 STO PMT 8 STO FV 2014 R/S 

06212014, 11:27 PM
Post: #9




RE: number base conversion for hp17b/17bii
(06212014 10:18 PM)Thomas Klemm Wrote: Here's a program for the HP12C: That is just amazing, Thomas. I'm sure the creators of NPV and deltapercent on the 12c never envisioned those functions being used for number base conversions. I tip my hat to you, you are "da man". 

06212014, 11:54 PM
(This post was last modified: 06222014 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 HP11C program was shorter. And it uses only 3 registers. However it was fun to figure it out.
Addendum: As long as the frombase 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. (06212014 11:27 PM)Don Shepherd Wrote: That is just amazing, Thomas. I'm sure the creators of NPV and deltapercent on the 12c never envisioned those functions being used for number base conversions. I've seen this trick in Valentin's paper: HP12C’s Serendipitous Solver 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)