By default, DSP Builder preserves the binary point so that the fixed-point interpretation of the result has the same value, subject to rounding, as the fixed-point interpretation of the input.
You can dynamically perform additional scaling, by specifying a variable number of bits to shift, allowing you to introduce any power of two gain.
The Scale block provides scaling in addition to rounding and saturation to help you manage bit growth. The basic functional modules of a Scale block are shifts followed by rounding and saturation. The multiplication factor (default is 1) is a constant scale to apply to the input.
The number of bits to shift left allows you to select the most meaningful bits of a wide word, and discard unused MSBs. You can specify the number of shifts as a scalar or a vector. The block relies on shift input port to decide which value to use if you specified the number of shifts as a vector. The shift input signal selects which gain to use cycle-by-cycle.
In a multichannel design, changing the shift value cycle-by-cycle allows you to use a different scaling factor for different channels.
A positive number of Number of bits to shift left indicates that the MSBs are discarded, and the Scale block introduces a gain to the input. A negative number means that zeros (or 1 in the signed data case) are padded to the MSBs of the input data signal, and the output signal is attenuated.
|Output data type||The type of the result. For example: sfix(16), uint(8).|
|Output scaling value||The scaling of the result if the result type is fixed-point. For example: 2^-15.|
|Rounding method||Specifies one of the following three rounding methods for discarding the least significant bits (LSBs):
|Multiplication factor||Modify the interpreted value by scaling it by this factor. This factor does not affect the hardware generated for the Scale block, but merely affects the interpretation of the result. For example: 1, 2, 3, 4, 8, 0.5.|
|Saturation method||Specifies one of the following three saturation methods for discarding the most significant bits (MSBs):
|Number of bits to shift left||A scalar or a vector that determines the gain of the result. A positive number indicates that the scale block introduces a gain to the input. A negative number means that the output signal is attenuated. A vector of gains allows the shift input signal to select which gain to use on a cycle per cycle basis. The value of the shift input performs zero-based indexing of the vector.|
|a||Input||The fixed-point data input to the block. If you request more channels than can fit onto a single bus, this signal is a vector. The width in bits is inherited from the input wire.|
|a_v||Input||Indicates the validity of the data input signals. If a_v is high, the data on the a wire is valid.|
|a_chan||Input||Indicates the channel of the data input signals. If a_v is high, a_chan indicates to which channel the data corresponds.|
|shift||Input||Indicates which element of the zero-based shift vector to use.|
|q||Output||The scaled fixed-point data output from the block. If you request more channels than can fit onto a single bus, this signal is a vector. The width in bits is calculated as a function of the input width in bits and the parameterization.|
|q_v||Output||Indicates the validity of the data output signals.|
|q_chan||Output||Indicates the channel of the data output signals.|
|q_exp||Output||Indicates whether the output sample has saturated or overflowed.|
After you run a simulation, DSP Builder updates the help pages with specific information about each instance of a block.
|Written on Tue Feb 19 11:25:27 2008||Date and time when this file ran.|
|Number of physical buses: 4||Depending on the input data rate, the number of data wires needed to carry the input data may be more than 1.|
|Calculated bit width of output stage: 16||The width in bits of the (vectorized) data output.|
|Latency is 2||The latency introduced by this block.|
|Parameters table||Lists the current rounding and saturation modes.|
|Port interface table||Lists the port interfaces to the Scale block.|