All the information that we want in our computer needs to be represented in machine code. This is a daunting task but at least we already saw how numbers are represented in binary in Chapter 17. Now it is time to talk about letters and symbols!
Glossary
Encoding | Converting text into a special format for efficient transmission or storage. |
ASCII
The American Standard Code for Information Interchange, ASCII in short, is a code that represents 128 English characters. Each symbol is assigned a number from 0 to 127. The picture below displays part of the ASCII code. Notice that `A` has a numerical value of 65 and `a` has a value of 97.
Refer to the ASCII table and understand the following points:
Since every symbol has a value between 0 and 127 then all we need it 7 bits for each character.
ASCII is a standard therefore all computers can interpret it, this makes it easier for computers to communicate with one another.
The letters are in alphabetical order so it is easy to deduce the number of any other letter if you already know just one.
This code includes special characters like `space`.
If you had a good look at the ASCII table, you probably noticed the section for extended ASCII which goes beyond 127. In actual fact, this is more commonly used and characters take up 8 bits. With just one extra bit we have the possibility of representing 256 symbols. A part of the extended ASCII code is shown in the following picture.
Unicode
Everyone in the world should be able to use their own language on phones and computers. Unfortunately ASCII does not support every language in the world! Unicode which stands for Unique, Universal, and Uniform character enCoding is the IT standard to represent text in most languages. Similar to ASCII, Unicode provides a unique number for every character. This code is widely adopted therefore different platforms are able to handle Unicode out of the box. Part of the reason Unicode is so popular is because it is constantly being maintained. At the time of writing the latest version was Unicode 14 which can represent 144,697 characters. Unicode can use 8, 16, 24 or 32 bits.
Using standard codes brings us closer together 🌎
Other chapters cover computer networks in detail but we are assuming you know this:
being able to communicate with other people who have computers is a big part of using a computer. Data on our phone needs to be sent to a different phone. Imagine we don't use standard codes? Imagine if every device would have its own unique character code... what will happen?
If various devices are using different character codes then they are not compatible! We would need translators in the middle so that it is possible for data to be presented correctly in both devices. This characteristic is referred to as data portability.
My advice is always use a widely adopted character code like Unicode and you can be certain that data portability is there!
Comentarios