In reply to hsam:
This is because the result of the sum method has the same type as the elements of the array, which in your example is only 4 bits. You need 5 bits to hold the sum of two 4-bit numbers, 6 bits to hold the sum of four 4-bit numbers, and so on. When using a with expression, the result is the same type as that expression.