(15C)(DM15) - Convert Number from one Base to Another
|
11-22-2021, 10:45 AM
Post: #1
|
|||
|
|||
(15C)(DM15) - Convert Number from one Base to Another
Hi!
As owner of a new DM15 I proudly present my first program, which converts one number from one base to another. This could give the DM15 a little bit of the HP-16C features. Unfortunately the calculator doesn't support figures >9 (ie. letters A ... F). So involving number bases >10 (ie HEX) doesn't work properly. Example: To convert 1101 from base 2 to base 8 simple enter 1101, 2 and 8 to the stack and start the program. The outputs on the stack are the original number (Z: 1101), the number converted to decimal (Y: 13) and the number converted to octal (X: 15). The program source code - as output of Thorsten Manz' great HP15C-Simulator - is: Code:
Probably the code can be optimized - but so far I'm happy that it works. Regards deetee |
|||
07-05-2022, 05:49 PM
Post: #2
|
|||
|
|||
RE: (15C)(DM15) - Convert Number from one Base to Another
This is a verbatim translation of this (HP-67) Base Conversion program for the HP-15C:
Code: 001 { 42 21 11 } f LBL A Examples 3258 to base 3 325 ENTER 8 ENTER 3 A 21220. 11012 to base 8 1101 ENTER 2 ENTER 8 A 15. Compared to your output, the original number and its conversion to decimal are missing. But I am sure that you can modify this program according to your needs. This is a mostly verbatim translation for the HP-41C: Code: 01 LBL "BC" And here's the same for the HP-42S: Code: 00 { 58-Byte Prgm } |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)