Okay, I'm taking a digital Circuits course, so I figured I'd cook up a TI-BASIC converter, since the function wasn't already built in.

If only it were that easy.

This is what I have so far for the dec to bin part:

Lbl B

Disp "DECIMAL:"

Input D

For(X,8,0,-1)

If (D-(2^X))>0

Then

O+(10^X)->O 'That's a Store In command, not a minus and a greater than.

D-2^X->D

End 'For the IF

End 'For the For loop

My problem is that a decimal 1 comes out as 0, and a decimal 255 comes out as 11111110. So does 256.

What am I doing wrong? Or is this just not possible?