
David W. answered 03/10/16
Tutor
4.7
(90)
Experienced Prof
Like decimal, binary is a positional number system. Going from right to left, each bit (binary digit) is the remainder after dividing by 2 repeatedly (that is, powers of 2).
So, to convert 13 to binary:
divide 13 by 2 and get a quotient of 6 and a remainder of 1
divide 6 by 2 and get 3 with a remainder of 0
divide 3 by 2 and get 1 with a remainder of 1
divide 1 by 2 and get 0 with a remainder of 1
Reading the remainders in l-to-r order (bottom to top), 13 (decimal) is 1101 (binary).
Note: to convert from decimal to either octal or hexadecimal is pretty easy (if you have practice), then converting to binary is easy (see Kenneth S's post).
convert 4867 to binary
Divide 4867 by 2 and get 2433 with a remainder of 1
Divide 2433 by 2 and get 1216 with a remainder of 1
Divide 1216 by 2 and get 608 with a remainder of 0
Divide 608 by 2 and get 304 with a remainder of 0
Divide 304 by 2 and get 152 with remainder of 0
Divide 152 by 2 and get 76 with a remainder of 0
Divide 76 by 2 and get 38 with a remainder of 0
Divide 38 by 2 and get 19 with a remainder of 0
Divide 19 by 2 and get 9 with a remainder of 1
Divide 9 by 2 and get 4 with a remainder of 1
Divide 4 by 2 and get 2 with a remainder of 0
Divide 2 by 2 and get 1 with a remainder of 0
Divide 1 by 2 and get 0 with a remainder of 1 [note: don't stop too early]
The result:
1 0011 0000 0011
[write as hexadecimal groups of 4 bits much like we use commas to separate large decimal numbers]