Is it impossible for you to type a message to someone else using only two keys? After all, how many words only use the letters 'a' and 'b'? Not many.
However, you can still send messages. How? You can encode your messages. For example, consider the ASCII code. The ASCII code assigns a number to each letter on the keyboard, plus many other symbols. For example, 'A' is encoded to the value 65 (in base 10). If you convert that to an 8-bit hexadecimal (base 16) value, it's 0100 0001. If 'a' is 0 and 'b' is 1, then you can encode that as "abaa aaab".
Most people tend to think of codes as trying to keep something secret. In fact, there's a branch of mathematics/computer science devoted to making messages hard to deciper. It's called cryptography.
However, not all codes are meant to keep messages secret. For example, there are error-correcting codes. These codes are meant to be robust against certain kinds of errors and still be decoded. For example, if a few bits are flipped, these codes can still be deciphered.
And, of course, in this example of the two-letter keyboard, the code was created out of necessity. If you only have two letters, you need to encode.
Computers encode things in binary, which means, it encodes in 0's and 1's. To encode using more values (like ten values) is much more difficult to implement in physical hardware. Plus, binary has some advantages over base 10. It's easier to do arithmetic (such as multiplication and addition) using binary.
Just like the typewriter with two keys, using binary representation forces us to encode things. For example, if you want to save information about a student, you need to encode it in 0's and 1's. If you want to store the structure of a tree in memory, that too has to be encoded.
Even more basic things have to be encoded. Integers have to be encoded in 0's and 1's. Characters have to be encoded. Floating point values have to be encoded.
One of the most important things to learn about computer hardware are the common ways that data is encoded in 0's and 1's. This is called data representation.
We're interested in encoding the following data types:
I often say that, of all the things that you learn about computer organization, data representation will probably be the most important. Most CS graduates never design hardware. However, most of you will have to program, and knowing how your data is encoded is fundamental.