I am trying to find the formula to calculate the maximum bit-width required to contain a sum of M n-bit unsigned binary numbers. Thanks!
The maximum bit-width needed should be .ceil(log_2(M * (2^n - 1)))
Edit: Thanks to @MBurnham I realize now that it should be floor(log_2(M * (2^n - 1))) + 1
instead.