Binary to Decimal number Conversion
To convert the binary number to the decimal number, we multiply each digit by its weighted position, and add each of the weighted values together. For example, the binary value 1011 0101 represents:
1*27 + 0*26 + 1*25 + 1*24 + 0*23 + 1*22 + 0*21 + 1*20
= 1 * 128 + 0 * 64 + 1 * 32 + 1 * 16 + 0 * 8 + 1 * 4 + 0 * 2 + 1 * 1
= 128 + 0 + 32 + 16 + 0 + 4 + 0 + 1
= 181
Decimal to Binary number Conversion
To convert any decimal number to its binary number system the general method is to 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.
Let us take an example. Consider the number 2671. The binary conversion for the number 2671 has been given in the following table.
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 |
|