NumberConversion System
NumberConversion System
To convert numbers from decimal to binary, the given decimal number is divided repeatedly by
2 and the remainders are noted down till we get 0 as the final quotient. The following steps is
considered as the decimal to binary formula that shows the procedure of conversion.
Step 1: Divide the given decimal number by 2 and note down the remainder.
Step 2: Now, divide the obtained quotient by 2, and note the remainder again.
Step 3: Repeat the above steps until you get 0 as the quotient.
Step 4: Now, write the remainders in such a way that the last remainder is written first,
followed by the rest in the reverse order.
Step 5: This can also be understood in another way which states that the Least Significant
Bit (LSB) of the binary number is at the top and the Most Significant Bit (MSB) is at the
bottom. This number is the binary value of the given decimal number.
Solution: We will start dividing the given number (13) repeatedly by 2 until we get the quotient
as 0. We will note the remainders in order.
1|Page
Division by 2 Quotient Remainder
13 ÷ 2 6 1 (LSB)
6÷2 3 0
3÷2 1 1
1÷2 0 1 (MSB)
After noting the remainders, we will write them in such a way that the Most Significant Bit (MSB)
of the binary number is written first, followed by the rest. Therefore, the binary equivalent for the
given decimal number 1310 is 11012. This means that 1310 = 11012.
Example 2: Convert the following decimal number into binary number: 156
Solution: To convert 15610 to the binary number system, let us divide it repeatedly by 2 and note
the remainders as shown below.
2|Page
Division by 2 Quotient Remainder
156 ÷ 2 78 0 (LSB)
78 ÷ 2 39 0
39 ÷ 2 19 1
19 ÷ 2 9 1
9÷2 4 1
4÷2 2 0
2÷2 1 0
1÷2 0 1 (MSB)
Let us write the remainders in the reverse order. Hence, the binary equivalent for the given
decimal number 15610 is 100111002.
There are different methods of converting numbers from decimal to binary. When we convert
numbers from decimal to binary, the base of the number changes from 10 to 2. It should be
noted that all decimal numbers have their equivalent binary numbers. The following table shows
the decimal to binary chart of the first 20 whole numbers.
3|Page
Decimal Numbers Binary Numbers
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111
16 10000
17 10001
18 10010
4 |19
Page 10011
20 10100
Example 1: Using decimal to binary formula, convert 29 decimals into a binary number.
Answer: Hence, 29 as binary is 111012111012.
Example 2: Convert 145 decimal into a binary number.
Answer: Hence, 145 decimals as binary is 100100012100100012.
As mentioned in the above paragraph while converting from binary to decimal we need to
consider each digit in binary number from right to left.
5|Page
By this way, we can do binary to decimal conversion.
Note: We represent any binary number with this format (xxxx)2 and decimal in (xxxx)10 format.
We keep on increasing the power of 2 as long as number of digits in binary number increases.
6|Page
Resultant Decimal number = 0+0+4+8+16 = 28
So (11100)2 = (28)10
1 0 0 0 1
Step-1 First we need to multiply 0 with 2 and add the 1st digit in binary number.
0x2+1=0+1=1
Step-2 Now use the result of above step and multiply with 2 and add the second digit of binary
number.
1 0 0 0 1
1x2+0=2+0=2
7|Page
The same step 2 is repeated until there will be no digit left. The final result will be the resultant
decimal number.
0 0 0 1
1
2x2+0=4+0=4
0 0 0 1
1
4x2+0=8+0=8
1 0 0 0 1
8 x 2 + 1 = 16 + 1 = 17
So we performed step 2 on all remaining numbers and finally, we left with result 17 which is a
decimal number for the given binary number.
So (10001)2 = (17)10
1 1 1
0x2+1=0+1=1
1 1
1
8|Page
1x2+1=2+1=3
1 1 1
3x2+1=6+1=7
The final result is 7 which is a Decimal number for 111 binary numeral system. So (111)2 =
(7)10
These are the 2 approaches that can be used or applied to convert binary to decimal.
The hexadecimal system or simply known as ” Hex”, which uses a base of 16, is often
employed in programming, memory addressing, and color coding due to its compact
representation of binary data. Hexadecimal employs sixteen different symbols as opposed to
the decimal system’s ten, which are “0” through “9” for 0 to 9 and “A” through “F” for ten
to fifteen.
When converting from hexadecimal to decimal, it is important to keep consideration for both
number system’s base.
This article provides a well-rounded description of the Hexadecimal Number System, the
Decimal Number System, and how to convert hexadecimal numerals into decimal numerals.
The hexadecimal number system, commonly known as base-16 or just hex, is a system of
numbers that employs 16 different symbols for representing various values. There are only 16
symbols used for denoting hexadecimal integers. A, B, C, D, E, and F are the following values
or symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
9|Page
A decimal value is represented by each digit. D, for instance, is equal to base-10 number 13.
This table, which lists the 16 hexadecimal digits and their decimal, octal, and binary equivalents,
will be useful for converting between number systems. The following list is additionally useful as
a converter or translator.
Numeral 0 1 2 3 4 5 6 7 8 9 A B C D E F
Used
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
For
As hexadecimal is a number system, all numbers in decimal and other number systems can
also be represented in the hexadecimal number system. The following table represents some
numbers in hexadecimal, decimal, octal, and binary as well.
Solution:
10 | P a g e
So, the hexadecimal number “1A3” is equivalent to the decimal number 419.
Solution:
6=6
C = 12
F = 15
Start at the unit’s place of the number and multiply each digit by a power of 16 in order to
convert this to a decimal number system.
⇒ 6CF= (6 × 256 + 12 × 16 + 15 × 1)
⇒ 6CF= 1743
Problems/Exercises
Solution:
4= 4, C = 12, and 7 = 7
⇒ (4C7)16 = 1223
11 | P a g e
Therefore, (2C7)16 = (1223)10
Solution:
We have a hexadecimal number 16F that we want to convert into a decimal number.
Solution:
⇒ (5BC)16 = 1280+176+12
⇒ (5BC)16 = (1468)10
4. Convert 31.D216.
Solution
As we know,
Digit 3 1 D 2
Place
161 160 16-1 16-2
value
12 | P a g e
31.D216 = (3×161) + (1×160) + (D×16-1) + (2×16-2)
⇒ 31.D216 = 48 + 1 + 13×16-1 + 2×16-2
⇒ 31.D216 = 48 + 1 + 0.8125 + 0.0078125
⇒ 31.D216 = 49.8203125
Solution:
We know that to convert a number from decimal to hexadecimal we need to divide the number
by 16 and then successively divide the quotient by 16 until quotient is zero
20 ÷ 16 gives Q1 = 1, R1 = 4
1 ÷ 16 gives Q2 = 0, R2 = 1
Solution:
42 ÷ 16 gives Q2 = 2, R2 = 10 = A
2 ÷ 16 gives Q3 = 0, R3 = 2
Solution:
89 ÷ 16 gives Q2 = 5 and R2 = 9
5 ÷ 16 gives Q3 = 0 and R3 = 5
13 | P a g e
Example 4: Convert 0.125 in Hexadecimal
Solution:
To convert a fractional number we multiply the fractional part by 16 and then again multiply the
fractional part of the product by 16 till the number becomes zero and then write the result from
the first product and not from the last as we do normally.
0.125 ⨯ 16 = 2.0
0 ⨯ 16 = 0
Hence, (.125)10 = 0.2
14 | P a g e