Conversions - Decimal and Binary
 

Binary to Decimal
It is very easy to convert from a binary number to a decimal number. Just like the decimal system, we multiply each digit by its weighted position, and add each of the weighted values together.


For example, the binary value 1100 1010 represents:

1*27 + 1*26 + 0*25 + 0*24 + 1*23 + 0*22 + 1*21 + 0*20 =


1 * 128 + 1 * 64 + 0 * 32 + 0 * 16 + 1 * 8 + 0 * 4 + 1 * 2 + 0 * 1 =


128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 =


202


Decimal to Binary

Divide the decimal number by 2, if the remainder is 0, on the side write down a 0. If the remainder is 1, write down a 1.


This process is continued by dividing the quotient by 2 and dropping the previous remainder until the quotient is 0.

 

When performing the division, the remainders which will represent the binary equivalent of the decimal number are written beginning at the least significant digit (right) and each new digit is written to more significant digit (the left) of the previous digit.

 

Consider the number 2671.



































































Division Quotient Remainder Binary Number
2671 / 2 1335 1 1
1335 / 2 667 1 11
667 / 2 333 1 111
333 / 2 166 1 1111
166 / 2 83 0 0 1111
83 / 2 41 1 10 1111
41 / 2 20 1 110 1111
20 / 2 10 0 0110 1111
10 / 2 5 0 0 0110 1111
5 / 2 2 1 10 0110 1111
2 / 2 1 0 010 0110 1111
1 / 2 0 1 1010 0110 1111

 


 

(c) Shilpa Sayura Foundation 2006-2017