00000000 = 0
00000001 = 1
00000010 = 2
00000011 = 3
00000100 = 4
00000101 = 5
00000110 = 6
00000111 = 7
00001000 = 8
etc...
see the pattern?
one easy way to do it is this:
look at your number, for example 00011011
find the number of decimal places for each of the one's.
the first decimal place = 1
the second decimal place = 2
the third decimal place = 4
fourth = 8
fifth = 16
sixth = 32
seventh = 64
eigth = 128
the number 00011011 has ones at the first, second, fourth and fifth decimal place
which means the number is 1 + 2 + 8 + 16
= 27