Post Reply 
Base Conversion
08-16-2018, 05:36 AM
Post: #21
RE: Base Conversion
Bonjour
C'est un fichier texte si j'ai bien compris.
Vous devez dans ce cas faire un click droit sur programme dans le conectivity kit puis faire nouveau et nommer le programme.
Une fenêtre s'ouvre avec :
EXPORT nom()
BEGIN

END;
Effacez cela puis faites un copier coller du contenu de vôtre fichier texte (le code du programme) dans la fenêtre du connectivity kit.
Puis sauvegarde, cela devrait être bon.


Hello
It's a text file, if I understand correctly.
In this case, you must right click on program in the conectivity kit and then make a new one and name the program.
A window opens with:
EXPORT name ()
BEGIN

END;
Erase this and then copy and paste the contents of your text file (the program code) into the connectivity kit window.
Then backup, it should be good.

Sorry for my english
Find all posts by this user
Quote this message in a reply
08-16-2018, 10:02 AM
Post: #22
RE: Base Conversion
(08-16-2018 05:36 AM)Tyann Wrote:  ...you must right-click on program in the connectivity kit and then make a new one and name the program.
A window opens with:
EXPORT name ()
BEGIN

END;

Erase this and then copy and paste the contents of your text file (the program code) into the connectivity kit window.
Then backup, it should be good.

Thank you for the instructions! That worked perfectly. I am able to press Blue-Shift & 1(Program) and then tap "Run." Works great.

Well, the program itself actually does NOT work great. It only converts from Decimal to another base. I want a program that allows me to choose, within the program, the base I want to convert FROM and then the base TO which I want to convert. If anyone has an extremely useful program like that, please specify a URL!

On my 28S, 48GX and 50g, these base conversions are so easy, it just boggles my mind why the Prime makes it so hard.

Anyway, thanks again, Tyann, for instructing me how to save Programs to my Prime.
Find all posts by this user
Quote this message in a reply
08-16-2018, 11:21 AM (This post was last modified: 08-16-2018 11:27 AM by Stevetuc.)
Post: #23
RE: Base Conversion
(08-16-2018 10:02 AM)JDW Wrote:  Well, the program itself actually does NOT work great.

Read earlier in thread how numbers in different bases are represented in prime. This may help you.

Numbers without # are treated as decimal

Numbers with # but without explicit type are treated as per system setting for integers

Unsigned/Signed support - if width is selected as 8,16,32 or 64 a choose box for unsigned/signed is presented. 
If Width is selected as System, then system setting for sign state is used.
If Width is selected as Input, then the input sign state is used.

An example:

Baseconv(#111b) gives #7d when converted to decimal
Baseconv(#FEh) gives #376o when converted to octal

Of course the best constructive criticism would be for you to write an "extremely useful" program and post it here. I look forward to it!
Find all posts by this user
Quote this message in a reply
08-16-2018, 11:43 AM
Post: #24
RE: Base Conversion
(08-16-2018 11:21 AM)Stevetuc Wrote:  Of course the best constructive criticism would be for you to write an "extremely useful" program and post it here. I look forward to it!

Indeed. That would be a program that mimics what I see on my 28S, 48GX and 50g when it comes to base conversion and manipulations like AND, OR and XOR. On my 28S, for example, I need only press the red button, then the B key for Binary and that's where the magic happens. I want it to be that easy on the Prime.
Find all posts by this user
Quote this message in a reply
08-16-2018, 12:19 PM (This post was last modified: 08-16-2018 12:20 PM by Stevetuc.)
Post: #25
RE: Base Conversion
(08-16-2018 11:43 AM)JDW Wrote:  
(08-16-2018 11:21 AM)Stevetuc Wrote:  Of course the best constructive criticism would be for you to write an "extremely useful" program and post it here. I look forward to it!

Indeed. That would be a program that mimics what I see on my 28S, 48GX and 50g when it comes to base conversion and manipulations like AND, OR and XOR. On my 28S, for example, I need only press the red button, then the B key for Binary and that's where the magic happens. I want it to be that easy on the Prime.


Until we have your program and in the interest of clarity, so others are aware, baseconv WILL convert between ANY base and also easily handles manipulations such as AND, OR and XOR:

eg. Baseconv(#FEh XOR #11101b) converted to decimal #227d


Heres the code again to bring the thread back on topic
Code:

EXPORT Baseconv(in)
BEGIN
LOCAL base,bits,sign;
CHOOSE(base, "Base", "System", "Binary","Octal","Decimal","Hex");
CHOOSE(bits, "Size","System","Input","8","16","32","64");
IF bits >2 THEN CHOOSE(sign, "Sign","Unsigned","Signed") END;
//IF LEFT(STRING(in),1) ≠ "#" THEN in:=EXPR("#"+in+"d") END; //correct the format - no longer needed
CASE
IF bits=1 THEN bits:=GETBITS(#) END //use system bitw
IF bits=2 THEN bits:=GETBITS(in) END //use input bitw
DEFAULT bits:=2^(bits)
END;
IF sign=2 THEN bits:=1-bits END;
SETBITS(SETBASE(in,base-1),bits); 
//R→B(B→R(in),bits,base-1) //old command
END;
Find all posts by this user
Quote this message in a reply
08-17-2018, 01:46 AM
Post: #26
RE: Base Conversion
(08-16-2018 12:19 PM)Stevetuc Wrote:  ...baseconv WILL convert between ANY base and also easily handles manipulations such as AND, OR and XOR:

eg. Baseconv(#FEh XOR #11101b) converted to decimal #227d

I performed the above mentioned manipulation on my 48GX and then compared to the Prime, showing every last nitty gritty comparison detail on the iPhone video I just made this morning, shown below. I would encourage everyone to watch the video in its entirety, as I present the case for greater ease of use on the Prime, relative to what we have on the 28S & 48GX and 50g. It strikes me odd that HP didn't create its own app for the Prime to make such manipulations easier. I look forward to hearing the detailed thoughts of everyone on this subject. And please remember, it's not about whether the Prime can perform these conversions and manipulations. It's all about EASE OF USE. Thanks.



Find all posts by this user
Quote this message in a reply
08-17-2018, 04:13 AM (This post was last modified: 08-17-2018 06:12 AM by Stevetuc.)
Post: #27
RE: Base Conversion
(08-17-2018 01:46 AM)JDW Wrote:  
(08-16-2018 12:19 PM)Stevetuc Wrote:  ...baseconv WILL convert between ANY base and also easily handles manipulations such as AND, OR and XOR:

eg. Baseconv(#FEh XOR #11101b) converted to decimal #227d

I performed the above mentioned manipulation on my 48GX and then compared to the Prime, showing every last nitty gritty comparison detail on the iPhone video I just made this morning, shown below. I would encourage everyone to watch the video in its entirety, as I present the case for greater ease of use on the Prime, relative to what we have on the 28S & 48GX and 50g. It strikes me odd that HP didn't create its own app for the Prime to make such manipulations easier. I look forward to hearing the detailed thoughts of everyone on this subject. And please remember, it's not about whether the Prime can perform these conversions and manipulations. It's all about EASE OF USE. Thanks.



This is a thread containing submitted hp prime software library. Your original post stated in error that this submitted program only converts from decimal to other bases. You then implied it could not handle bit manipulations. You then shifted the ground to EASE OF USE and now have full blown hijacked the thread.
Please follow forum etiquette and move your ease of use of prime discussions versus 38s 48gx and 50g to the main hp prime thread
Id be happy to comment in that thread that I realise you are new to the prime, so you havent found the # key (Alpha 3) and space key ( to left of + ) and it would be easier to just type in #11101b directly.
Im new to 50g and trying to use that to do base conversions as a newbie, ease of use isnt my first impression..
Find all posts by this user
Quote this message in a reply
Post Reply 




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