Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Binary --> Hex and Vice versa also Binary --->Decimal
#1
Hey guys im haaving problems starting it anyone with any tips or help would be appreciated thanx.
img]http://img213.imageshack.us/img213/6104/sig1jb.gif[/img]
Reply
#2
Binary -> Hex:

It's very easy as long as you realize that always 1 hex digit = 4 binary digits, i.e. 0000 is 0, 0001 is 1, 0010 is 2, 0011 is 3, 0100 is 4, 0101 is 5, 0110 is 6, 0111 is 7, 1000 is 8, 1001 is 9, 1010 is A, 1011 is B, 1100 is C, 1101 is D, 1110 is E and 1111 is F. Just go along the binary string taking bits of 4 characters and substute them for 0-9,A-F.

Binary -> Decimal:

Easy as well. Take your binary number, and start counting on "0" from the right. If that digit is "1", add 2^(order from right), this way:

Binary: 11001

0th digit from right: 1, I add 2^0 = 1
1st digit from right: 0.
2nd digit from right: 0.
3rd digit from right: 1, I add 2^3 = 8
4th digit from right: 1, I add 2^4 = 16

Result=> 1 + 8 + 16 = 25.

Use a bucle which does just this and you're done.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
Base conversion routine
Decimal to binary format
am the last survivor of the Quickbasics world (at least at qbasicnews).
Reply
#4
That won't help him learn how to do it himself. There's an implicit rule here of not doing people's homework, but helping them to do it.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#5
Quote:That won't help him learn how to do it himself.
sorry, my opinion it's some different, reading and working codes it's another way of learnig.
am the last survivor of the Quickbasics world (at least at qbasicnews).
Reply
#6
It's also a good way of directly copying it and no learning - this guy is doing homework.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#7
if you want to test your bin to dec, dec to bin use this site:

http://www.roubaixinteractive.com/PlayGr...o_Text.asp
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#8
Quote:That won't help him learn how to do it himself. There's an implicit rule here of not doing people's homework, but helping them to do it.

It's also a good way of directly copying it and no learning - this guy is doing homework.

Nathan, I totally agree. Your first post helped him with all the concepts without actually providing the code. This is the way we all should approach these kinds of requests for homework help.
*****
Reply
#9
I know how to do all conversions on paper. I wanted but to make a program that does it in qbasic. I need to help started with that
img]http://img213.imageshack.us/img213/6104/sig1jb.gif[/img]
Reply
#10
I will be watching this one. I have had a go at a making a program to convert decimal to binary so will be interested to see u r result ( it was not homework i like playing)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)