How Codes Are Used in Computers

 All things in all posts will help you visualize about the way that computers work generally. Note that it is not the real structure of modern computers, but the way that modern computers work is nearly the same as in my posts. I am sure that if you understand about the way that computers work in my posts, you will easy to learn about all fields of computer afterward. Thank you !!!

In my previous post, you can see that one 8-bit memory can have up to 256 possibilities. With one bit, you can only use it for simple works that only have two states such as traffic lights or yes/no question works,...But with 8-bit, you can perform more complex works that need more details than simple bit works.

Languages are the first thing that need to be represented in states of bits because it is the only thing that people need to communicate. In a language, we have letters (uppercase and lowercase), digits from 0 to 9, punctuation marks, special symbols,...Assume we have 100 different symbols that are used in a language and we will call them “characters”. 

As you know, we have 256 possibilities in our computer memory. With 100 characters, it is easy for computer memory to contain that 100 characters. One code (states of bits in 8-bit memory) in 256 codes can be assigned to one character. There is no relationship between characters and codes. We only choose one code for one character, the only thing that we do is assign the meaning of a code for a character. Like in traffic lights, we only assign “on” and “off” signals for every red, yellow and green light to control them. Likewise, the meaning of code is our choices, it is not essential for any works (traffic lights or characters).

You should know that the thing that you assign to a code is a thing in the real world. You can list all 256 possibilities and assign them any symbols that you want. You can also combine that symbol to another symbol that does not exist in the world because you create it. You can assign anything that you want. You can use all 256 codes if you want to create characters yourself.

As the way above, codes will be invented and many computer companies communicate together for unique code, committees will be formed to decide the unique code use in all computers. You can create code yourself but it can not be used as widely as code from committees.

One of the codes that is famous most is ASCII (American Standard Code for Information Interchange). Below are some of codes in ASCII:

So, from the code table above, you can make a message such as “Hello World” with 11 bytes memory because we need one byte for every letter. The first byte for “H”, the second byte for “e” and so on. Blank spaces also have code in ASCII (0010 0000), so you can create separate words in sentences.

Again, the thing you assign to code is the meaning of code that you want it to carry. The letter that you assign to code is also the meaning that you want the code to carry. You can assign another meaning to that code in other situations or simply you want.

For example, 0010 0000 is the code for blank space in ASCII. But in other situations, you can assign it another meaning such as 32 in numbers or any symbols that you want in your own system. Imagine 0010 0000 when ASCII does not exist yet, will not mean blank space (maybe do not have any meaning). Thanks for reading and see you again.

Đăng nhận xét

0 Nhận xét