I have the following asssignment :
predicted.y = ($signed(in_trx.xi) * $signed(in_trx.cos) - $signed(in_trx.xq) * $signed(in_trx.sin))/ (131072);
Where the type are:
bit [15:0] xi;
bit [15:0] xq;
bit [15:0] sin;
bit [15:0] cos;
bit signed [15:0] y;
For the following input:
xi = -4, cos = 32766 xq = -4 sin = 0
I expected to get -1 (the result is -0.99993896484375), but for some reason I get 0.
Why?