Number System of Computer Science

GirayKaleli
3 min readAug 17, 2021

Before I continue to talk about Java in the next chapters, today I will try to explain the language of the computer in my own way, and I should state that I am not a mathematician. I’m talking about the world of zeros and ones, which is quite different from our everyday world. Let’s try…

In our math world, we only use numbers from zero to nine. With them we can create a multi-digit number. For example; 10 occurs with 1 and 0 or 783 with 3,7 and 8. So this system name is the decimal system. However, the decimal system is not sufficient to explain or solve some problems. For this reason, there are many systems in mathematics to help us solve or calculate problems. Some, such as the binary, octal, or hexadecimal system, are used in computer science. We can also convert one number to another between these systems.

So, first of all let’s show the systems;

1.Decimal System : In this system we use numbers from 0 to 9 and form others with them.

2. Binary System : Computers use the system which consists of 0 and 1 to do their operations. 0 means closed, 1 means open, they make up many combinations with them to do their transactions.

3. Octal System : Octal system uses a number between 0 and 7. The system was chosen because 8 is (exponentially) equal to 2³, and each number of the octet is mechanically replaced by its 3-digit binary equivalent. The 2-digit equivalent of an 8-digit number.

4. Hexadecimal System : Numbers are represented by different symbols in the system. The numbers 0 to 9 represent the numbers 0 to 9; Letters from A to F represent numbers 10 to 15.

How we calculate them?

The decimal numbering system has a radix of 10. Hence, we can express a number as :

12 = (1x10¹) + (2x10⁰)

120.1 = (1x10²) + (2x10¹) + (0x10⁰) + (1x10^-1)

  • Since the radix of numbering system is 10 , any number in the scope must be less than 10.

The binary numbering system has radix of 2. So, we can express a number as :

(1100)2 = (1x2³) + (1x2²) + (0x2¹) + (0x2⁰) ==> “12“

(1111000)2 = (1x2⁶) + (1x2⁵) + (1x2⁴) + (1x2³) + (0x2²) + (0x2¹) + (0x2⁰) ==> “120”

  • The number “(1100)2” is 12 in decimal system. Also, since the radix is 2 in binary, any number in the scope must be less than 2.

The base of the octal number system is 8. So we can express a number as:

(14)8 = (1x8¹) + (4x8⁰) ==> “12”

(170)8 = (1x8²) + (7x8¹) + (0x8⁰) ==> “120”

  • Also, since the radix is 8 in the octal system, any number in the scope must be less than 8.

The hexadecimal numbering system has a base of 16 and uses the following 16 different digits:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F (10,11,12,13,14,15)

(C)16 = 12x16⁰ ==> “12”

(78)16 = (7x16¹) + (8x16⁰) ==> “120”

  • Since the base of the numbering system is 16, any number in the scope must be less than 16.

Converting a number from decimal to others

--

--

GirayKaleli

I am an economist and software developer.I interest with C, C++, Java and Pyhton.I am fond of science, technology and nature.