Bits
If you're in this forum, you probably know that each letter is 8 bits long. A bit is a single integer, 0 or 1, which is actually represented by an impulse of electricty for 1, or a lack thereof for 0, in your computers RAM. Now, how do we convert these impulses of electricty to a letter?
ASCII
All 256 characters have an ASCII value, 0 to 255. Each of the 256 integers has a binary representation too. Lets asume you've already converted your letter to Ascii.
Note, this can be done by using 'a' in the common syntax, or Asc("a") in VisualBasic, asuming you're working with the letter a.
Place Value
The 8 binary integers each have a value of their own. From left to right, these are 128, 64, 32, 16, 8, 4, 2, and 1. This may be confusing, so I'll provide an example. The number 10000000 has a value of 128, and 00100000 has a value of 32. How do we get up to 256? We need to set more of 0's to 1's.
Applying Binary
By now, you should have a pretty good idea of how binary works. Now lets apply it to some actual use. A null terminator, commonly used at the end of packets, is the ASCII character 0. To represent this in binary, we use 00000000. The character "a" has an ASCII value of 97. This is where the real fun begins.
I don't see X number for any place in binary
You're going to have to do some major subtraction here. We're working with "a", ASCII letter 97. Seeing as how 97 is under 128, we set the first bit to 0.
0XXXXXXX
Its under 64, so we set the second to 1.
01XXXXXX
Before we go any further, we need to subtract 64 from 97. We are left with 33. Seeing as how 33 is over 32, we'll set the next bit to a 1, and subtract 32.
011XXXXX
We're left with one, and we know thats not equal or bigger than anything but itself, so we don't need to check for the rest. We'll just set the last bit to a 1 and we're done.
01100001 = 97.
If anyone has any questions, feel free to ask.