# Thread: TI-83 Calc - Converting Binary to Decimal

1. ## TI-83 Calc - Converting Binary to Decimal

Hi,

Does anyone know how to convert Binary numbers (eg. 11001) to Decimal numbers (eg. 25) using a program on a TI-83?

Thanks,

Neil

2. Banned
Join Date
Jun 2003
Location
The United States Site: http://kellyj.t35.com
Posts
2,561
not sure of how the code would go, but:

i would loop for each digit starting on the right, and keep a running total of the number. If the number is a 1, add 2^character position (ones digit=1,10s digit=2,...). Loop until the last character is reached.

Here is a javascript that will do that, if you want to try changing it to fit the ticalc:
PHP Code:
``` <script type="text/javascript">   var myNum = "11011"   var newNum = parseInt(myNum, 2)   alert(newNum) </script>  ```
Last edited by steelersfan88; 03-20-2004 at 09:41 PM.

3. The only problem is I'm not sure the calc can get individual digits from a variable. Is there one? Or is there another way of doing so?

Thanks,

Neil

4. Banned
Join Date
Jun 2003
Location
The United States Site: http://kellyj.t35.com
Posts
2,561
Try this link, maybe this will do it: here

5. Thanks, but it looks like that is programed in BASIC. The calculator has it's own programming language, which I am using.

Thanks,

Neil

6. Yes, the calculator has it's own programming language - TI-83 BASIC. As far as I can see, that program should be suitable, as should this one.

7. Wow - I downloaded that last Zip and looked in HEX.83G and it looked nothing like the TI programming language I'm used to. Maybe I need some special program to view it properly. Is there a mathamatical formula to convert binary to dec? I've got a programme which converts decimal to binary.

Neil

8. Sam
Registered User
Join Date
Aug 2003
Posts
1,576
do you have the silver edition, or regular?

9. I have the TI-83 Plus.

Thanks,

Neil

10. Sam
Registered User
Join Date
Aug 2003
Posts
1,576
the reason its not showing is because you don't have the TI-83 fonts installed on your computer, you'll need to do that then open it up in word... or the TI software

11. Not to worry - I've invented my own. It converts bases 2-9 to base 10 (Normal). Here it is. -> is store.

Lbl 0
ClrHome
Disp "ENTER NUM"
Prompt A
Disp "Base:"
Prompt F
A->E
ClrHome
Output(1,1,E)
0->C
1->D
While A>0
round(0.1A,0)*10->B
D(A-B)+C->C
0.1B->A
FD->D
End
Output(8,1,C)
Pause
Lbl 1
Stop

Neil

12. Error discovered, wont work for bases above 5.

Neil

13. Registered User
Join Date
Mar 2003
Posts
575
Try "Int" or "Floor" or something instead of "Round". Does that fix it?

14. Registered User
Join Date
Apr 2005
Posts
1
You could make the user's binary number be stored in a string and then use sub() to get numbers out of that string.
The only problem is that you would get "1" instead of 1 (or "0" instead of 0)
I don't know function in Basic to convert the "1" to the 1 (SURE WOULD LIKE TO KNOW A WAY), so you would have to do it like this

Input "binary number",str1
length(str1)->A
0->R

for(i,1,A)
If sub(str1,i,1)="1"
R+2^(i-1) -> R
end

Disp R

Oops, now I wrote the complete program for you, oh well...

EDITED to get out a little bug (which I made due to the little time I took to write it)
EDITED I mistyped the correction
Last edited by GreatMagicalHat; 04-21-2005 at 01:34 PM.

15. Registered User
Join Date
Dec 2005
Posts
1
Originally Posted by GreatMagicalHat

Input "binary number",str1
length(str1)->A
0->R

for(i,1,A)
If sub(str1,i,1)="1"
R+2^(i-1) -> R
end

Disp R

sorry to drag up a thread from the dead, but searching google to find a simple binary conversion program for the ti-83 i stumbled upon this site. This code ALMOST works properly, there is just one little mistake. When the ti puts the number into a string the msb of the binary number is given the string position of 1. With your code the msb is given the least weight. For this to be fully functional you would want to use:

Input "binary number",str1
length(str1)->A
0->R
0->i

for(i,1,A)
If sub(str1,i,1)="1"
R+2^(A-I) -> R
end

Disp R