Forum Discussion
sstrell
Super Contributor
2 years agoWhy do you even need $signed here? If you're using arithmetic shift right (>>>) it would automatically shift in 1's to maintain the sign if the MSB is 1.
And also realize that Quartus 12.1 is now a 12 year old version of the tool. Have you tried anything more recent?
FvM
Super Contributor
2 years agoIt's no bug.
IEEE 1800-2017, 11.4.10 Shift operators specifies:
The arithmetic right shift shall fill the vacated bit positions with zeros if the result type is unsigned. It shall fill the vacated bit positions with the value of the most significant (i.e., sign) bit of the left operand if the result type is signed. (...) The result signedness is determined by the left-hand operand and the remainder of the expression, as outlined in 11.8.1.
As the result type in example is unsigned, the observed behaviour is correct.
IEEE 1800-2017, 11.4.10 Shift operators specifies:
The arithmetic right shift shall fill the vacated bit positions with zeros if the result type is unsigned. It shall fill the vacated bit positions with the value of the most significant (i.e., sign) bit of the left operand if the result type is signed. (...) The result signedness is determined by the left-hand operand and the remainder of the expression, as outlined in 11.8.1.
As the result type in example is unsigned, the observed behaviour is correct.