Number System Is 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 !!!

Number system is a vital system in all computers because computers need a number system for many calculations in tasks. This number system is not a number character system such as ASCII. The number character system such as ASCII is used for displaying numbers on the computer screen mainly. 

The number system will help computers perform calculations on numbers such as 100 + 1,...Let’s review the ASCII code table to see codes for numbers in ASCII:

As you can see in the picture above, the first ten characters are number characters. That’s enough for representing all numbers on the computer screen but we must use up to 8 bits for representing only ten numbers! That’s a terrible waste of bits and it can not also perform many calculations. So, we should use another system for storing more numbers and can perform many calculations on it.

This number system only needs for calculations in computers and does not need for representing numbers on the computer screen because number characters in ASCII are enough for that purpose. With 8 bits, we can represent 256 different possibilities, so we should use this potential thoroughly to represent numbers (256 numbers).

Before learning about the number system that computers use, we will mention some number systems and understand basic principles of those number systems. Understanding basic principles of these number systems will help you learn number systems that computers use easier.

Firstly, we have hash marks (or Tally marks). This is a number system that use symbol “|” for each of the first four things and use a symbol “/” across the first four things for the fifth thing. Next things will be started over the cycle that is from first to fifth thing. Look at the table below to understand this number system:

You can see that numbers are represented by symbols “|” and “/” and every five things will be grouped.

Secondly, we have Roman numerals. We have seven basic digits: “I” for one, “V” for five, “X” for ten, “L” for fifty, “C” for one hundred, “D” for five hundred and “M” for one thousand. Look at the picture below:

We can use these digits separately such as “I” for a value of 1. But you can use these digits in combination. The principle of combination is you must write symbols that represent the largest digit first, then add other symbols to the left or to the right of the first symbols. If you add to the right, value will be added to the number. If you add to the left, the value will be subtracted from the number.

For example, we have number 48. We can see that the largest digit in the number is 40. So, we represent 40, 40 will be represented as “XL” and 8 can be represented as “VIII” easily. So we have “XL” + “VIII” = “XLVIII” = 48. 

Thirdly, we have a very common number system that is Arabic numerals. This number system is so common with us in school and it has ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. As Roman numerals, you can use them separately or in combination. In combination, the value of every digit will be different. The value of digits in numbers will increase ten times every time we choose the nearby digit to the left.

For example, we have a number of 345. We can represent this number: 300 + 40 + 5 or 3 x 100 + 4 x 10 + 5 x 1. So, you can see that the value of digits from right to left will increase 10 times. And this number system is called the decimal system or base-10 system because this system uses ten digits above.

And one more thing that you should remember is that any digits in number increase over 9, that digit will be returned to 0 and the digit next to on the left will increase one. For example, 359 when add 1, the number will be 360 (“9” returns to “0” and “5” becomes “6”) or 390 when add 10, the number will be 400. So, digits in numbers will work in a “close cycle” from 0 to 9 and from 9 to 0. 

From the decimal system, we can have many more systems that work similarly. Based on the number of digits that we use, we will have a corresponding number system. For example, we can have octal (base-8) or senary (base-6) systems. We will only review the senary system and the octal system will work similarly.

Scenery system will use six digits for representing numbers: 0, 1, 2, 3, 4 and 5. So, if we have a number of 21 in the senary system, how can we know the value of it in the decimal system that we use daily? OK, imaging 321 in decimal number, you can represent it as 3 x 100 + 2 x 10 + 1 x 1. Number of 21 in the senary system is similar, you can represent them as 3 x 36 + 2 x 6 + 1 x 1 = 121. So, 216 = 12110!!!

Digits in senary numbers will also work in a “close cycle” from 0 to 5 and 5 to 0, similar to decimal numbers. In the same way, octal numbers will work and have properties similar to decimal numbers.

Now, we will come to the main topic in this post is the binary system (base-2 system). This system only works with two digits: “0” and “1”. This system also works similar to the senary system that we learned above. For example, 10000010 in the binary system will be: 1 x 128 + 0 x 64 + 0 x 32 + 0 x 16 + 0 x 8 + 0 x 4 + 1 x 2 + 0 x 1 = 130 in the decimal system. So, 100000102 = 13010!!!

This system is suitable for computers because it can only be in two states “0” or “1” at any given time. “0” corresponds to “off” and “1” corresponds to “on”. So, signals in computers can combine with this number system for storing numbers or calculating on these binary numbers.

You can see that a digit in a number can be only “0” or “1”. In the other word, a digit can only have (1) or not have (0) value in the number and there will not have any intermediate value. For example, a decimal system will have many values such as 2, 3,...not only 0 and 1. 

Another number system that I want to introduce for you is the hexadecimal system. This system is used in industry regularly. Because this number system uses up to 16 digits so we must have symbols for digits from 10 to 15. And they will be: “A” for 10, “B” for 11, “C” for 12, “D” for 13, “E” for 14 and “F” for 15.

The way that hexadecimal work is similar to other number systems. Digits in hexadecimal numbers will work in a “close cycle” from 0 to F and from F to 0. Try to translate a number such as 21 in the hexadecimal system to a decimal system. Likewise other number systems, we will have: 2116 = 2 x 16 + 1 = 3310.

You can represent binary numbers to hexadecimal numbers easily by grouping each four digits in the binary number. For example, 10001110 in the binary system can be represented by “8E” in the hexadecimal system because the first four bits is 1000 (equal to 8) and the second four bits is 1110 (equal to 14 or “E”).

I have just introduced some number systems that are important in computers, especially binary system. Binary system is the most important number system because it is compatible with the way that computers work. More things about these number systems will be mentioned later. Thank you for your reading and see you later!!!

Đăng nhận xét

0 Nhận xét