www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: TI-83 Calc - Converting Binary to Decimal

  1. #1
    Join Date
    Jun 2003
    Location
    UK
    Posts
    789

    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
    if($neil=="stuck"){echo("Help!");
    pull_out("hair", $neil);
    $neil=bald;}
    else{echo("What do you want?");}

  2. #2
    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(myNum2)
      
    alert(newNum)

    </script> 
    Last edited by steelersfan88; 03-20-2004 at 09:41 PM.

  3. #3
    Join Date
    Jun 2003
    Location
    UK
    Posts
    789
    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
    if($neil=="stuck"){echo("Help!");
    pull_out("hair", $neil);
    $neil=bald;}
    else{echo("What do you want?");}

  4. #4
    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. #5
    Join Date
    Jun 2003
    Location
    UK
    Posts
    789
    Thanks, but it looks like that is programed in BASIC. The calculator has it's own programming language, which I am using.

    Thanks,

    Neil
    if($neil=="stuck"){echo("Help!");
    pull_out("hair", $neil);
    $neil=bald;}
    else{echo("What do you want?");}

  6. #6
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    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.

    Adam
    "If youíre not using valid HTML, then you havenít created a Web page. You may have created something else, but it isnít a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  7. #7
    Join Date
    Jun 2003
    Location
    UK
    Posts
    789
    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.

    Thanks for your help,

    Neil
    if($neil=="stuck"){echo("Help!");
    pull_out("hair", $neil);
    $neil=bald;}
    else{echo("What do you want?");}

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

  9. #9
    Join Date
    Jun 2003
    Location
    UK
    Posts
    789
    I have the TI-83 Plus.

    Thanks,

    Neil
    if($neil=="stuck"){echo("Help!");
    pull_out("hair", $neil);
    $neil=bald;}
    else{echo("What do you want?");}

  10. #10
    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. #11
    Join Date
    Jun 2003
    Location
    UK
    Posts
    789
    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
    Menu("AGAIN?","YES",0,"NO",1)
    Lbl 1
    Stop


    Neil
    if($neil=="stuck"){echo("Help!");
    pull_out("hair", $neil);
    $neil=bald;}
    else{echo("What do you want?");}

  12. #12
    Join Date
    Jun 2003
    Location
    UK
    Posts
    789
    Error discovered, wont work for bases above 5.

    Neil
    if($neil=="stuck"){echo("Help!");
    pull_out("hair", $neil);
    $neil=bald;}
    else{echo("What do you want?");}

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

  14. #14
    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. #15
    Join Date
    Dec 2005
    Posts
    1
    Quote 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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles