Yes, this is an example of overflow. When assigning a large positive value to a smaller signed variable, the overflow can result in the value being negative. If you want to avoid overflow from multiplication, the storage for the result must be at least as wide as the sum of the original widths of the factors. If the factors are unsigned and the result is signed, then the result will need an additional bit to avoid overflow into the sign bit. Steven Sharp sharp@cadence.comReceived on Thu May 18 17:00:51 2006
This archive was generated by hypermail 2.1.8 : Thu May 18 2006 - 17:00:57 PDT