The question is pretty straightforward.
We reduce the problem to "represent any decimal number from 1 to 127 in form of binary number but how many bits do we need to do that?"
That is, ceil(lg 127)=7
Thus, we need, 1, 2, 4, 8, 16, 32, and 64 gram weights
so 7 weights in total we need to represent any number from 1 to 127