The number of 8-bit strings containing 2 1's =
Number of combinations of 2 from 8 = 8C2 = 8*7 =28 strings
For 3 1's we have 8C3 = 56
For 4 1's we have 8C4 = 70
For 5 's it is 56 , For 6 it is 28 , For 7 it is 8 and for 8 it is 1
So our answer is
1 + 8 + 2(28) + 2(56) + 70 = 247 (answer)