if Weight == 0 Number_of_Bits = 0 else Number_of_Bits = Max_Number_of_Bits + 1 - Weight