Runescape Bits & Bytes https://www.rsbandb.com/forums/ |
|
Shane, help please? https://www.rsbandb.com/forums/viewtopic.php?f=38&t=70472 |
Page 1 of 1 |
Author: | Kyle [ August 26th, 2008, 3:27 pm ] |
Post subject: | Shane, help please? |
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? |
Author: | Adbot [ August 26th, 2008, 3:27 pm ] |
Post subject: | Register and login to get these in-post ads to disappear |
Author: | Shane [ August 26th, 2008, 4:20 pm ] |
Post subject: | Re: Shane, help please? |
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. |
Author: | Kyle [ August 26th, 2008, 5:05 pm ] |
Post subject: | Re: Shane, help please? |
would you happen to have a magic website that i can type 65 and it gives it to me in binary. |
Author: | hummerwar921 [ August 26th, 2008, 5:15 pm ] |
Post subject: | Re: Shane, help please? |
http://www.nickciske.com/tools/binary.php I like doing it the real way, though. |
Author: | Kyle [ August 26th, 2008, 5:25 pm ] |
Post subject: | Re: Shane, help please? |
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? |
Author: | Ben [ August 26th, 2008, 6:34 pm ] |
Post subject: | Re: Shane, help please? |
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. |
Author: | Adbot [ August 26th, 2008, 6:34 pm ] |
Post subject: | Register and login to get these in-post ads to disappear |
Author: | Ranging God [ August 26th, 2008, 7:23 pm ] |
Post subject: | Re: Shane, help please? |
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. |
Page 1 of 1 | All times are UTC - 7 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |