English
Language : 

EP2S90F1020C5 Datasheet, PDF (529/768 Pages) Altera Corporation – Stratix II Device Handbook, Volume 1
DSP Blocks in Stratix II and Stratix II GX Devices
Saturation and Rounding
The DSP blocks have hardware support to perform optional saturation
and rounding after each 18 × 18 multiplier for Q1.15 input formats.
1 Designs must use 18 × 18 multipliers for the saturation and
rounding options because the Q1.15 input format requires 16-bit
input widths.
1 Q1.15 input format multiplication requires signed multipliers.
The most significant bit (MSB) in the Q1.15 input format
represents the value’s sign bit. Use signed multipliers to ensure
the proper sign extension during multiplication.
The Q1.15 format uses 16 bits to represent each fixed point input. The
MSB is the sign bit, and the remaining 15-bits are used to represent the
value after the decimal place (or the fractional value). This Q1.15 value is
equivalent to an integer number representation of the 16-bits divided by
215, as shown in the following equations.
1
0x4000
− = 1 100 0000 0000 0000 = −
2
215
1
0x1000
= 0 001 0000 0000 0000 =
8
215
All Q1.15 numbers are between –1 and 1.
When performing multiplication, even though the Q1.15 input only uses
16 of the 18 multiplier inputs, the entire 18-bit input bus is transmitted to
the multiplier. This is like a 1.17 input, where the two least significant bits
(LSBs) are always 0.
The multiplier output will be a 2.34 value (36 bits total) before performing
any rounding or saturation. The two MSBs are sign bits. Since the output
only requires one sign bit, you can ignore one of the two MSBs, resulting
in a Q1.34 value before rounding or saturation.
When the design performs saturation, the multiplier output gets
saturated to 0x7FFFFFFF in a 1.31 format. This uses bits [34..3] of the
overall 36-bit multiplier output. The three LSBs are set to 0.
The DSP block obtains the mult_is_saturated or
accum_is_saturated overflow signal value from the LSB of the
multiplier or accumulator output. Therefore, whenever saturation occurs,
the LSB of the multiplier or accumulator output will send a 1 to the
Altera Corporation
January 2008
6–13
Stratix II Device Handbook, Volume 2