Forum Discussion
Altera_Forum
Honored Contributor
14 years agoAdding further details:
Truncation leads to noise(truncation noise) and dc bias. Noise is worst with direct truncation(no rounding) and results from random error of up to 1 LSB. It is similar to quantisation noise concept when sampling analogue signals and so its distribution is dependent on signal values probabilty. DC bias is negative due to 2's complement and is worst in direct truncation but also occurs in "nearest" below but here it is positive and dependant on probabilty of midvalues (ties) which is highest when discarding only one bit and gets less and less if discarding more bits. There are 4 examples of truncation algorithms below: (1) convergent : round to nearest even. gives unbiased rounding, commonly used in hardware. (2) nearest : simple, leads to dc bias, common in hardware. (3) round : ideal, no dc bias, minimum noise but method 1 more easily implementable in hardware (4) truncate only, dc bias and noise
for midpoint values case (ties)
Convergent nearest round trunc
-7/2 -3.5 -4 -3 -4 -4
-5/2 -2.5 -2 -2 -3 -3
-3/2 -1.5 -2 -1 -2 -2
-0.5 0 0 -1 n/a
0.5 0 1 1 n/a
3/2 1.5 2 2 2 1
5/2 2.5 2 3 3 2
7/2 3.5 4 4 4 3
The above table represents worst case i.e. one bit discarding and midpoint values(ties). For non ties, both nearest and convergent are equivalent to round Finally, note that say 4.5 is as close to 5 as it is to 4 and so the notion that it must 5 is not exactly solid fact except at school.