2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16
2^5=32
2^6 = 64
since this isn't maths but programming you should always have a leading zero to show it's a positive number, thus the 8th digit is a zero.
01000000
No messing with trying to see what combinations add up to 64.
Update and practice examples:
It's not much harder to do other numbers like say 59. Let's try it:
59 is less than 64 so let's have a zero in that spot.
0
59 is greater than 32 so let's have a one in that spot.
01 now we have 59-32=27
27 is greater than 16 so let's have a one in that spot.
011 and now we have 27-16 = 11.
11 is greater than 8 so let's have a 1 in that spot.
0111 and now we have 11-8 = 3.
3 is less than 4 so let's have a zero in that spot.
01110
3 is greater than 2 so let's have a 1 in that spot.
011101 and 3-2 = 1 since 1 is equal to 1 let's have a 1 in the final spot.
0111011
Let's check.
1+2+8+16+32 = 59
Now your turn.
See if you can turn these numbers into binary.
5
12
26
87
Remember positive numbers ALWAYS start with a zero in the left most position. A computer will interpret a 1 in the left most position as a negative number.
1000000