R
Rick C
Guest
CLK_HZ : REAL := 33.554432E6 -- 2^25
..
..
..
constant MS_MAX_Cnt : integer := integer(ROUND(CLK_HZ/1000.0)) - 1;
What should be the value of MS_MAX_Cnt, 33,555, 33,554 or 33,553?
I say 33,553, the Aldec simulator says 33,554. Who\'s right?
What am I missing about the operation of ROUND ?
The definition says it adds 0.5 before taking the FLOOR of positive values. Even with the 0.5 added the FLOOR should make the value 33,554.0 then with the integer conversion 33,554 then minus 1 to give 33,553.
--
Rick C.
- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209
..
..
..
constant MS_MAX_Cnt : integer := integer(ROUND(CLK_HZ/1000.0)) - 1;
What should be the value of MS_MAX_Cnt, 33,555, 33,554 or 33,553?
I say 33,553, the Aldec simulator says 33,554. Who\'s right?
What am I missing about the operation of ROUND ?
The definition says it adds 0.5 before taking the FLOOR of positive values. Even with the 0.5 added the FLOOR should make the value 33,554.0 then with the integer conversion 33,554 then minus 1 to give 33,553.
--
Rick C.
- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209