Decimal to binary conversion is pretty simple. All you have to do is keep dividing the decimal number by two (2) (recording the remainder that you get each time), until you get zero (0).
That is, we divide the decimal digit by 2, store the remainder, then divide the quotient (the result obtained from the previous division) by 2, store the remainder and so on... until we get zero for the quotient. Finally, the remainders in reverse order are the binary value digits. The following example illustrates this process.
____________________________________________________________
E.g. Convert the decimal number 13710 into binary
137/2 = 68 (remainder = 1)
68/2 = 34 (remainder = 0)
34/2 = 17 (remainder = 0)
17/2 = 8 (remainder = 1)
8/2 = 4 (remainder = 0)
4/2 = 2 (remainder = 0)
2/2 = 1 (remainder = 0)
1/2 = 0 (remainder = 1)
13710 ------> 100010012
____________________________________________________________
Quick tip: Whenever you divide a number by 2, the remainder is always either 0 or 1
No comments:
Post a Comment