Number System conversions

Syeda Tasneem
5 min readMar 21, 2023

--

Before we move on to the topic of conversion, let's understand a little bit about number systems and their types.

A computer can only understand numbers that’s why whenever we try to type a letter or word, it automatically translates it to numbers. A computer can only understand the language of digits and these digits describe different values depending on the position they hold in the number. So, Numbers were used in computers. however, other types of number systems are used based on the given information.

TYPES OF NUMBER SYSTEMS:
There are many types of number systems in mathematics, but the following are the most commonly used:
1. Decimal Numbers (0–9).
2. Binary Numbers (1,0).
3. Octal Numbers (0–7).
4. Hexadecimal Numbers(0–9, A(10), B(11), C(12), D(13), E(14), F(15)).

CONVERSIONS:
A number system is a form of expressing numbers. We’ll learn about number systems conversions where we’ll convert a number of one base, to a number of another base considering all the base numbers such as decimal, binary, octal, and hexadecimal with the help of examples. Conversions methods that we are going learn are:
1. Decimal to Binary numbers.
2. Binary to Decimal numbers.
3. Octal to Binary numbers.
4. Binary to Octal numbers.
5. Hexa to Octal numbers.

  1. DECIMAL TO BINARY NUMBERS:
    Decimal numbers are nothing but numbers that we use in our daily life. It starts with 0 and ends with 9. Whereas Binary numbers are those numbers that are used in computers, they start and end with 0 and 1. The conversion of decimal value to binary number is very easy, we just have to divide the numbers of a decimal by 2 as the base value of binary numbers is 2 i.e., (0/1). Let’s see the binary numbers of decimal values:

From the above table, each decimal value is divided by 2.
For instance, let's take the number 106.
106 / 2:

Here, we divide each quotient by 2 till we get 1 as shown above. After dividing, we have to take the remainder from the bottom to the top, we’ll get the value 1101010. So, the Binary number of 160 is 1101010.
Try solving with other decimal numbers like 45, 34, 312

2. BINARY TO DECIMAL NUMBERS:
In Binary to decimal numbers conversion, we have to multiply the decimal value by 2 as per the base value. let’s take the above example, here the binary value is 1101010.
Calculate each value multiplied by 2 from the LSB(Least Significant Bit) to MSB(Most Significant Bit) in a fraction way given below:

Basically, the above calculation goes like this:
(1 × 2⁶) + (1 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (0 × 2²) + (1 × 2¹) + (0 × 2⁰) = 106
So, the Decimal value of 1101010 is 106.

3. OCTAL TO BINARY NUMBERS:
A number system whose base is ‘eight’ is called an Octal number. It uses numbers from 0 to 7. Let us understand with an example, take 67. For conversion, we’ll follow the below pattern:

(1). octal to decimal:
(6 x 8¹) + (7 x 8⁰) → 48 + 7 = 55
[note: except 0 as the LSB value, we should add any LSB number during number systems calculations.]
(2). decimal to binary:

after calculating as shown above, we get a binary value of 67 as 110111.
Try solving with other octal numbers like 162, 47, 77

4. BINARY TO OCTAL NUMBERS:
Conversion from binary to octal is very simple, you just have to reverse the above pattern. But while converting the Decimal value to an octal value make sure to divide the number by 8. let’s take the same above Binary value example, i.e., 110111.
the calculation goes like this:
1. Binary to Decimal:
(110111)₂ = (1 × 2⁵) + (1 × 2⁴) + (0 × 2³) + (1 × 2²) + (1 × 2¹) + (1 × 2⁰) = (55)₁₀
2. Decimal to Octal:
Divide 55 by 8, we’ll get 67 as shown below:

then our values will be:

5. HEXADECIMAL TO OCTAL NUMBERS:
A number system whose base value is 16 is known as Hexadecimal. That means, it represents 16 digits i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A(10), B(11), C(12), D(13), E(14), F(15). For conversion:
1. multiply the hexadecimal value by 16 to get the decimal number.
2. Divide the decimal number by 8.
For instance, take BA as a hexadecimal value:
We’ll get 186 as a decimal number for BA.

Calculation:
(11 × 16¹) + (10 × 16⁰) = (186)₁₀
Now, let’s divide 186 by 8:

We got 272 as an octal number. For more clarification, just follow the below pattern.

For verifying whether the values are correct or not, just have to reverse the pattern, and you’ll get your answers. But while converting Decimal value to hexa, make sure to divide by 16.

CONCLUSION:
Conversions in Number Systems are very simple. In order to convert number systems to decimal numbers, we just have to multiply by their base numbers or digits. And to convert decimal values to number systems types, we just have to divide based on their base numbers.

--

--