In reply to saritr:
Two issues:
-
You are attempting to do arithmetic with 16 bit vectors where the intermediate results exceed 16 bits. This will result in overflow conditions affecting your results.
-
You are attempting to conduct floating point arithmetic with integers.