So far, we have seen how computers translate 1s and 0s into numbers, but we want to use computers for a lot more than math. Computers can also deal with a lot of other kinds of information, but perhaps the most important type of information is text. Ultimately, text characters are also stored in the computer as binary impulses, but they have intermediate values as numbers. Imagine two children keeping a secret code. They might agree to encode their messages by representing each letter in the alphabet with its corresponding number, so A becomes 1, B becomes 2, and so on. The message "HI THERE" would become this: 8 9 20 8 5 18 5. This code would be somewhat effective at keeping secrets, but it has another benefit. The children could communicate by tapping on the walls, or banging on a drum. 8 taps would represent an "H", and 20 taps a "T".
This would be fine for simple communication, but eventually the children might want to send more complex messages with punctuation marks, capital and lowercase letters, and some special symbols for spaces, the end of a message, and so on.
Early computer scientists developed codes along exactly the same lines. The most popular encoding technique is called ASCII (American Standard Code for Information Interchange) (Yea, it should be ASCFII, but nobody asked my opinion...) In this scheme, capital A is represented by a 65, B by 66 and so on... Lowercase a is represented by 97, lowercase b by 98. Most punctuation and other special characters are assigned to the values below 65. These seem like completely random values until you look at them in binary notation.
| Character | Binary value | Decimal Value |
| (space) | 0100000 | 32 |
| A | 1000001 | 65 |
| B | 1000010 | 66 |
| a | 1100001 | 97 |
| b | 1100010 | 98 |
Notice that "A" and "a" have completely different (but numerically related) values. Some programs can tell that "A" and "a" mean nearly the same thing, and some programs cannot. The programs that treat them as completely different letters are referred to as "case-sensitive."
It would be silly for you to memorize how these codes are stored. That's the computer's job. The important thing for you to recognize is that letters are translated to numbers, and ultimately to 1s and 0s.
Here's a trap: The character '4' has an ASCII value of 52( which is binary 110100). This is fine when we are thinking of '4' as a character inside a text document. However, if we want the computer to do math on the value 4, it needs to be stored as 4 in binary (100). If we try to do math on the numeric figures, 4+4 in binary is 100 + 100 =1000 or eight. If we tried to do the math on the ASCII representation of four, we would get
110100 + 110100 = 1101000 or "4" + "4" = 104(!), but if we are thinking of characters, 104 = lowercase "h" ?!??!
Don't get hung up on the details here. This is just an illustration of how important it is to keep numbers and text defined properly. In some programs, the numeric value 4 is VERY different than the character '4' (Notice the quotes). When we get to those types of programs, we will refer back to this discussion.