ModelSim, unexpected output value

Status
Not open for further replies.

echo47

Advanced Member level 6
Joined
Apr 7, 2002
Messages
3,933
Helped
638
Reputation
1,274
Reaction score
90
Trophy points
1,328
Location
USA
Activity points
33,176
I'm running ModelSim SE 5.8d on Win2k. Why does this Verilog 2001 module return the value 49 instead of 35?

Code:
module foo (y);
  wire   signed [15:0] a, b;
  output signed [15:0] y;

  assign a = 5;
  assign b = 7;
  assign y = 1 * a * b;
endmodule
 

ModelSim, unexpected output value.

interesting, the problem is 1 or signed.
for signed, if you try 1*b*a, it's 25; & if you write 16'd1, there is no problem.
for unsigned, there is right also.
i don't know why. who can explain it?
 

This is possibly a bug in Modelsim version you are working with.
I am getting correct result on ModelSim SE vlog 5.5d Linux
 

hi, i try it with 6.0b on sun. same problem.
 

Ya,

Ur right on Modelsim 6.0b linux its giving wrong response!
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…