On 04/24/2013 03:02 PM, Jones, Andy D wrote: > Formatting error... example should be: > > Variable a, b : ufixed(arg'range) := (others => '0'); -- 0.0 > > Variable sum : ufixed := a + b; -- also 0.0, but "bigger" > > Variable product : ufixed := a * b; -- still 0.0, but even "bigger" > Cleaver. This will work to bound the types. I admit the helper scripts here are a bit verbose, but I could not think of a better way to do it. The idea here is that none of the operations do any rounding, they just let the number grow. The way I fix this issue is like this: variable a, b : ufixed (arg'range); variable result : ufixed (arg'range); result := resize ((a + b) * a, result'high, result'low); -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Apr 24 14:00:28 2013
This archive was generated by hypermail 2.1.8 : Wed Apr 24 2013 - 14:00:35 PDT