Text Data Representation

Imagine if I wanted you to write me a note, but you were only allowed to use numbers. The simplest way you could represent text, using numbers is to allocate a number to each letter. So let's make it really easy to begin with, and just say that A = 1, and B = 2 and so on and so forth.

How would you represent 'a' or 'b', if it was also a '1' or '2' then there would be no way of telling apart A from a (or B from b)

So, then maybe you decide that a = 27, b = 28 and so on and so forth (assuming A - Z is 1 - 26)

Then how do you represent a full stop, or a question mark?

You can start to see where this is going.

In the early years of computer development, different computer companies applied the binary system in their own way. The code for the letters in the word “dog” was often different in different brands of computers.

Eventually, a set of standards was developed. Computer manufacturers agreed to use one code called the ASCII (American Standard Code for Information Interchange). ASCII is an 8-bit code. That is, it uses eight bits to represent a letter or a punctuation mark. (remember that eight bits is called a byte).

A binary code with eight digits, such as 1101 10112, can be stored in one byte of computer memory.

The word "DOG" is

  • D = 0100 0100

  • O = 0100 1111

  • G = 0100 0111

BUT the word "dog" is

  • d = 0110 0100

  • o = 0110 1111

  • g = 0110 0111

Each letter, number, and symbol is represented by an 8-bit ASCII code. Check out the handout called "Just ASCII Code" - Notice that there is even an ASCII code for a blank space.

We have included two downloads with this activity. One is a worksheet intended to extend your students in thinking. There are no answers for it because it is meant to start a discussion. If you don't feel comfortable discussing the answers with the kids quite yet, please post them in the discussion forums here and we can have a chat about it!