Kamis, Juli 16, 2015

Convert Binary to Decimal Manually by Your Self

Example we have binary n digit, the formula to convert to decimal is:

digit to-1 x 2n-1 + digit to-2 x 2n-2 + digit to-3 x 2n-3 + ... + digit to-(n-3) x 22 + digit to-(n-1) x 21 + digit to-n x 20

Example:

Convert binary 111001 to decimal
Binary 111001 consist of 6 digits, its decimal is:
digit to-1 x 2n-1 + digit to-2 x 2n-2 + digit to-3 x 2n-3 + digit to-(n-3) x 22 + digit to-(n-1) x 21 + digit to-n x 20
= 1 x 25 + 1 x 24 + 1 x 23 + 0 x 22 + 0 x 21 +1 x 20
= 1x32 + 1x16 + 1x8 + 0x4 + 0x2 + 1x1
= 32 + 16 + 8 + 0 + 0 + 1
= 57

So if binary 111001 is converted to decimal is 57

If there is something not understand, please asked... : ) Hope it is useful, thank you... :)

0 komentar: