kommu4946
Member level 4
- Joined
- Feb 21, 2014
- Messages
- 71
- Helped
- 13
- Reputation
- 26
- Reaction score
- 11
- Trophy points
- 1,288
- Location
- India
- Activity points
- 1,846
hi ,
How verilog and vhdl expressions are evaluated.i am getting different results when the same code is written in verilog and vhdl.
the expression is:
d=(a+b)*p;
a,b,p are signed numbers of size 16 bits and d is the signed number with 32 bits.when a, b are 16384(decimal numbers) and p is 1229 .The vhdl simulator is giving output as -40271872 but verilog output is 40271872.I know that sum becomes 32768 which is out of range of -32768 to 32767 so that it is -32768*1229=-40271872 but why verilog is giving 40271872...
How verilog and vhdl expressions are evaluated.i am getting different results when the same code is written in verilog and vhdl.
the expression is:
d=(a+b)*p;
a,b,p are signed numbers of size 16 bits and d is the signed number with 32 bits.when a, b are 16384(decimal numbers) and p is 1229 .The vhdl simulator is giving output as -40271872 but verilog output is 40271872.I know that sum becomes 32768 which is out of range of -32768 to 32767 so that it is -32768*1229=-40271872 but why verilog is giving 40271872...