Page 9 - Computer - 7
P. 9
CONVERSION OF DECIMAL NUMBER INTO BINARY NUMBER
To convert a decimal number into a binary number:
• Divide the decimal number constantly by two.
• Write the remainder on the right hand side.
• Continue the process till you reach a zero quotient.
• Write the remainders from bottom to top to form the binary equivalent of the decimal number. The
first remainder becomes the last binary digit, and the final remainder becomes the first binary digit.
Example 1 Example 2
To convert the decimal number To convert the decimal number 145 into
35 into its binary equivalent. its binary equivalent.
2 35 2 145
2 17 Remainder 1 2 72 Remainder 1
2 8 Remainder 1 2 36 Remainder 0
2 4 Remainder 0 2 18 Remainder 0
2 2 Remainder 0 2 9 Remainder 0
2 1 Remainder 0 2 4 Remainder 1
0 Remainder 1 2 2 Remainder 0
2 1 Remainder 0
0 Remainder 1
1 0 0 0 1 1 Thus, the decimal number 145
Thus, the decimal number 35
is equal to 100011 in binary form. is equal to 10010001 in binary form.
It is expressed as (35) = (100011) It is expressed as (145) = (10010001) 1 0 0 1 0 0 0 1
10 2 10 2
Conversion of Binary Number into Decimal Number
To convert a binary number into a decimal number:
• Write the place value of every digit of the binary number by multiplying it with the correct power
of the base 2, starting with power 0 from the extreme right.
• Add the result of each multiplication to get the decimal number.
Example 1: To convert (11001) into decimal number.
2
(11001) = 1 × 2 + 1 × 2 + 0 × 2 + 0 × 2 + 1 × 2 0
4
1
3
2
2
= 1 × 16 + 1 × 8 + 0 × 4 + 0 × 2 + 1 × 1
= 16 + 8 + 0 + 0 + 1
= 25
Thus, (11001) = (25) 10
2
7