0=0
1=1
01=1
10=2
binary each digit doubles
so
11111 would be 16+8+4+2+1 or 31
to make the number 20 it would be 10100