Sorry, I should have provided more information. Because of other logic, d cannot be less than c. Hence, b*c/d cannot be greater than b. To show why d cannot be less than c, here is the rest of the logic:
input signed b;
input signed c0;
input signed c1;
output signed e0;
output signed e1;
wire signed f0;
wire signed f1;
wire d2;
wire d;
assign d2 = c0*c0 + c1*c1;
sqrt u1 (.radical(d2), .q(d)); // d = d2^0.5
assign f0 = b*c0/d;
assign f1 = b*c1/d;
assign e0 = f0;
assign e1 = f1;
d is the magnitude of (c0, c1) so neither c0 nor c1 can be greater than d.
e0 and e1 are exactly what I expect when I make f0 and f1 outputs. That is,
wire signed f0;
wire signed f1;
is replaced with
output signed f0;
output signed f1;
However, when f0 and f1 are not outputs, instead of f = b*c/d, I get f = ((b*c)%(2^14))/d, where % stands for modulus.
For example, when b = 2000, c0 = 1536, and c1 = 640, I expect e0 = 1846 and e1 = 769. I get this when f is an output, but when it is not I get e0 = 1 and e0 = 4.
What I think is happening is Quartus is simplifying
assign f0 = b*c0/d;
assign f1 = b*c1/d;
assign e0 = f0;
assign e1 = f1;
into
assign e0 = b*c0/d;
assign e1 = b*c1/d;
In the first case, since f is 28 bits long, the right hand side should be expanded, which prevents b*c from overflowing and gives the correct result. In the second case, all of the signals are 14 bits long, so b*c overflows before it is divided by d.
What I want to know is whether there is a way to get Quartus to not eliminate the signal f without making f an output.