Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Shane, help please?
PostPosted: August 26th, 2008, 3:27 pm 
Dragon Member
Offline

Joined: October 7th, 2005, 5:06 am
Posts: 3783
Location: Draynor Village us
RS Name: Punisher1288
RS Status: P2P
Clan Name: The Cookie Armada
Ok so im trying to learn Binary code for my class, and ive got it most of the way down, expect the letters part. I underdstant 8 bits make a byte and the values of the bits.


01010101=128
00001010=8?


But what i dont under stand is when letters start, and then how to make letters out of the code? Could you please explain at what number does the alphabet start?

_________________
*Member #514*
Image
Image
Image
*Rsbandb Donor*


Top
 Profile  
 
 Post subject: Register and login to get these in-post ads to disappear
PostPosted: August 26th, 2008, 3:27 pm 
Dragon Member

Joined: September 9th, 2004, 1:47am
Posts: 9047
Location: In your web browserz


Top
  
 
 Post subject: Re: Shane, help please?
PostPosted: August 26th, 2008, 4:20 pm 
Site Owner
Offline

Joined: September 9th, 2004, 9:26 am
Posts: 6994
Location: Wild Rose Country ca
RS Name: shane12088
RS Status: P2P
In order to make "letters" out of the binary number you would have to look up an ascii table and then take your numerical value (in decimal) and match it up. The standard character set is 8 bits which provides pretty much everything that we need.

But if you're asking how to convert from binary here's how...

Note: Binary means base 2, a number range including only 0 and 1.

00001010 = 0 * 2^0 + 1 * 2^1 + 0 * 2^2 + 1 * 2^3 = 0 + 2 + 0 + 8 = 10.

Basically you start from the right counting at 0 moving left and incrementing the power each time. Then add them up. Or more generally said...

∑(n * 2^i) Starting at i = 0 going to the most significant set bit number (highest bit that is 1). Where n is the value of the bit.

Now going back is pretty much the reverse (divide and subtract). Note we use integer division, meaning ignore decimals and use remainders.

So going back from 10...

10/2 = 5 R 0
5/2 = 2 R 1
2/2 = 1 R 0

So we stop when the quotient reaches 1, then read the remainders backwards, after we put the quotient down first: 1010. And of course you can tack your 4 high bits on again to get 00001010.

Note: Some people like to use an upside down long division sign as it makes it easier to read, I don't have one here on my keyboard so that's why I didn't.
The procedure is the same for converting any base whether it be 8, 16, or 32.

_________________


Top
 Profile  
 
 Post subject: Re: Shane, help please?
PostPosted: August 26th, 2008, 5:05 pm 
Dragon Member
Offline

Joined: October 7th, 2005, 5:06 am
Posts: 3783
Location: Draynor Village us
RS Name: Punisher1288
RS Status: P2P
Clan Name: The Cookie Armada
would you happen to have a magic website that i can type 65 and it gives it to me in binary.

_________________
*Member #514*
Image
Image
Image
*Rsbandb Donor*


Top
 Profile  
 
 Post subject: Re: Shane, help please?
PostPosted: August 26th, 2008, 5:15 pm 
Rsbandb Donor
User avatar
Offline

Joined: February 4th, 2006, 5:40 pm
Posts: 1832
Location: 127.0.0.1
RS Status: P2P
http://www.nickciske.com/tools/binary.php

I like doing it the real way, though.

_________________
Image
Mike wrote:
Say NOOOOOOOOOOOOOOOOOOOO to star trek


Top
 Profile  
 
 Post subject: Re: Shane, help please?
PostPosted: August 26th, 2008, 5:25 pm 
Dragon Member
Offline

Joined: October 7th, 2005, 5:06 am
Posts: 3783
Location: Draynor Village us
RS Name: Punisher1288
RS Status: P2P
Clan Name: The Cookie Armada
hummerwar921 wrote:
http://www.nickciske.com/tools/binary.php

I like doing it the real way, though.



one more question, my teacher is wanting me to convert the followning numbers in bytes, but he said a single byte..

the number are

11=00001011 i think i did this right.
65
100
255

but for large numbers id have to use two bytes right?

_________________
*Member #514*
Image
Image
Image
*Rsbandb Donor*


Top
 Profile  
 
 Post subject: Re: Shane, help please?
PostPosted: August 26th, 2008, 6:34 pm 
Runite Member
User avatar
Offline

Joined: February 18th, 2007, 1:28 pm
Posts: 598
Location: Mother's basement us
RS Name: Nightgunner5
RS Status: P2P
Clan Name: Bits and Bytes
Kyle wrote:
hummerwar921 wrote:
http://www.nickciske.com/tools/binary.php

I like doing it the real way, though.



one more question, my teacher is wanting me to convert the followning numbers in bytes, but he said a single byte..

the number are

11=00001011 i think i did this right.
65
100
255

but for large numbers id have to use two bytes right?

255 is the largest number you can have in a single byte.

_________________

Shane wrote:
Just be sure to let me know if they're male or female, sometimes it can be hard to tell :P


Top
 Profile  
 
 Post subject: Register and login to get these in-post ads to disappear
PostPosted: August 26th, 2008, 6:34 pm 
Runite Member

Joined: September 9th, 2004, 1:47am
Posts: 9047
Location: In your web browserz


Top
  
 
 Post subject: Re: Shane, help please?
PostPosted: August 26th, 2008, 7:23 pm 
Rsbandb Donor
Offline

Joined: October 16th, 2005, 3:14 pm
Posts: 4731
Location: Kasnas City us
RS Name: Azek
RS Status: P2P
When I learned Binary, I found it really easy to start from the beginning, on a large white board and just go threw the numbers.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to: