Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Quartus eliminates intermediate signal causing an overflow.

I have the following code:

input signed  b;
input signed  c;
input signed  d;
output signed  e;
wire signed  f;
assign f = b*c/d;
assign e = f
I believe that Quartus is eliminating f and replacing my two assignments with:

assign e = b*c/d;
which causes b*c to overflow and the operation is effectively e = ((b*c)%2^14)/d. The purpose of f is to expand b and c so that no overflow occurs. After dividing by d the result cannot be larger than 2^14.

If I make f an output rather than just a wire, Quartus does not eliminate it and the operation is performed correctly. Is there some way to get Quartus to not eliminate f without making f an output?

12 Replies