English
Language : 

EP4SE360F35I4 Datasheet, PDF (112/432 Pages) Altera Corporation – This section provides a complete overview of all features relating to the Stratix IV device family, which is the most architecturlly advanced
4–32
Chapter 4: DSP Blocks in Stratix IV Devices
Stratix IV Operational Mode Descriptions
Rounding and Saturation Mode
Rounding and saturation functions are often required in DSP arithmetic. Use
rounding to limit bit growth and its side effects; use saturation to reduce overflow and
underflow side effects.
Two rounding modes are supported in Stratix IV devices:
■ Round-to-nearest-integer mode
■ Round-to-nearest-even mode
1 You must select one of these two options at compile time.
Round-to-nearest-integer provides the biased rounding support and is the simplest
form of rounding commonly used in DSP arithmetic. The round-to-nearest-even
method provides unbiased rounding support and is used where DC offsets are a
concern. Table 4–6 lists how round-to-nearest-even works.
Table 4–6. Example of Round-To-Nearest-Even Mode
6- to 4-bits
Rounding
010111
001101
001010
001110
110111
101101
110110
110010
Odd/Even
(Integer)
x
x
Even (0010)
Odd (0011)
x
x
Odd (1101)
Even (1100)
Fractional
> 0.5 (11)
< 0.5 (01)
= 0.5 (10)
= 0.5 (10)
> 0.5 (11)
< 0.5 (01)
= 0.5 (10)
= 0.5 (10)
Add to Integer
1
0
0
1
1
0
1
0
Result
0110
0011
0010
0100
1110
1011
1110
1100
Table 4–7 lists examples of the difference between the two modes. In this example, a
6-bit input is rounded to 4 bits. The main difference between the two rounding
options is when the residue bits are exactly halfway between its nearest two integers
and the LSB is zero (even).
Table 4–7. Comparison of Round-to-Nearest-Integer and Round-to-Nearest-Even
Round-To-Nearest-Integer
010111 ➱ 0110
001101 ➱ 0011
001010 ➱ 0011
001110 ➱ 0100
110111 ➱ 1110
101101 ➱ 1011
110110 ➱ 1110
110010 ➱ 1101
Round-To-Nearest-Even
010111 ➱ 0110
001101 ➱ 0011
001010 ➱ 0010
001110 ➱ 0100
110111 ➱ 1110
101101 ➱ 1011
110110 ➱ 1110
110010 ➱ 1100
Stratix IV Device Handbook
Volume 1
February 2011 Altera Corporation