Oct 10, 2007

How to convert from decimal to binary :

Sometimes we need to convert numbers from decimal to binary. Here is how to do the same.

Divide the decimal number by 2 until quotient remains 0 and write the remainder each time you divide. How you will do this as shown below.

Note: each time you divide the decimal number by 2 then remainder will be always either 0 or 1 because we are dividing a decimal number by 2. There is no chance to remain other than 0 or 1 as a remainder.

Example: Suppose decimal number is (13)10 and we would like to convert this (13)10 into binary number.

2

13

2

6

1

2

3

0

2

1

1

0

1

In above example first of all 13 is divided by 2 so quotient will be 6 and remainder will be 1. Again divide remaining quotient 6 by 2 so quotient is now 3 and remainder is 0. Now divide this quotient 3 by 2 so quotient will be 1 and remainder is 1 too. At the last quotient 1 is divided by 2 but 1 is not divided by 2 so quotient will be 0 and remainder will be 1 and it is finished. It always happen when quotient will remain 1 and it is not divided by 2 so quotient will be 0 and remainder will be 1.

After completion of this process write down the remainders from bottom to up. In above example (1101)2. So binary number of 13 is (1101)2.

Here is a list of decimal and its binary equivalent.

Decimal

Binary

0

0000

1

0001

2

0010

3

0011

4

0100

5

0101

6

0110

7

0111

8

1000

9

1001

10

1010

11

1011

12

1100

13

1101

14

1110

15

1111

Another Example of Decimal to Binary conversion

Converting Decimal number 25 to its binary equivalent:

2

25

2

12

1

2

6

0

2

3

0

2

1

1

2

0

1

So writing remainders from bottom to up is (11001)2. Binary equivalent of 25 is (11001)2.

No comments:

Post a Comment

Infolinks In Text Ads

Total Pageviews

Powered by Blogger.

Dont Forget To Follow Us

Blog Archive