Red Hot Bits and Bytes
Anybody and everybody is welcome to take a quiz it's all free and open but only logged in users will have their results saved, receive detailed feedback and be able to participate in the leaderboards.
At the smallest scale in a computer, information is stored as bits. A bit can be either a 0 or 1 where 0 is off and 1 is on. In the computer everything from numbers and letters to pictures and movies is made up of bits. In a chip an on or off electric charge represents the state of a bit. If the charge is on the bit is a 1, if the charge is off the bit is a 0. In a hard drive spots of magnetism represent the state of a bit. If the spot has a north magnetism the bit is a 0 and if the spot has as south magnetism the bit is a 1. A bit is too small to be much use so a group of 8 bits together is used to represent things like letters and numbers, the group of 8 bits is a byte.
Bytes and Characters
Each character on a keyboard is encoded in a byte. The ASCII to Binary table above show the byte representation of the numbers 0 to 9 and the upper and lower case letters.
Look at the number 1 in the table, the first 4 bits are 0011 which specify a number or a punctuation character, the last 4 bits specify which number it is and for the number 1 the last 4 bits are 0001, only the last bit is on. Now look at the Bit Values in a Byte table and you can see that each bit from 7 to 0 has a value associated with it. Look at bit 0, the bit furthest to the right, and you can see it’s value is 1, that means if that bit is on it’s value is 1, if we add up the values of the bits that are on in that group of 4 we get off + off + off + 1 which equals 1 and that sets that byte as the number 1.
Remember it is only the last 4 bits which specify what the number is. Look at the number 5 and the last 4 bits are 0101, only bit 2 and bit 0 are on. Now looking at the values for those bits; when bit 2 is on the value is 4 and when bit 0 is on the value is 1 if we add up the values of 4 + 1 we get 5.
That same logic applies to all the numbers, if you look at the last 4 bits and add up the values for the bits that are on you will get the number that byte represents.
The same logic also applies for lower case and upper case letters but the first 3 bits set wether it is an upper or lower case letter and the last 5 bits specify what the letter is. We need 5 bits to specify the letter because there are 26 letters in the alphabet. If we only used 4 bits and they were all on the value would be 8 + 4 + 2 + 1, which equals 15 so we would only be able to specify up to the letter o.
Looking at the last 5 bits for the letter A they are 00001, only bit 0 is on and its value is 1 and of course A is the first letter in the alphabet. For the letter E the last 5 bits are 00101 and adding up the values for the bits that are on we get 5, because E is the 5th letter in the alphabet.