In reply to amy992:
The assignment to y needs to go inside the initial begin/end block. There is nothing wrong with the use of the sum() method.
In reply to amy992:
The assignment to y needs to go inside the initial begin/end block. There is nothing wrong with the use of the sum() method.