Simulink Reference Previous page   Next Page
Data Type Propagation

Set the data type and scaling of the propagated signal based on information from the reference signals

Library

Signal Attributes

Description

The Data Type Propagation block allows you to control the data type and scaling of signals in your model. You can use this block in conjunction with fixed-point blocks that have their Specify data type and scaling parameter configured to Inherit via back propagation.

The block has three inputs: Ref1 and Ref2 are the reference inputs, while the Prop input back propagates the data type and scaling information gathered from the reference inputs. This information is then passed on to other fixed-point blocks.

The block provides you with many choices for propagating data type and scaling information. For example, you can:

You specify how data type information is propagated with the Propagated data type parameter list. If the parameter list is configured as Specify via dialog, then you manually specify the data type via the Propagated data type edit field. If the parameter list is configured as Inherit via propagation rule, then you must use the parameters described in "Inheriting Data Type Information" of the Simulink Fixed Point documentation.

You specify how scaling information is propagated with the Propagated scaling parameter list. If the parameter list is configured as Specify via dialog, then you manually specify the scaling via the Propagated scaling edit field. If the parameter list is configured as Inherit via propagation rule, then you must use the parameters described in "Inheriting Scaling Information" in the Simulink Fixed Point documentation.

After you use the information from the reference signals, you can apply a second level of adjustments to the data type and scaling by using individual multiplicative and additive adjustments. This flexibility has a variety of uses. For example, if you are targeting a DSP, then you can configure the block so that the number of bits associated with a MAC (multiply and accumulate) operation is twice as wide as the input signal, and has a certain number of guard bits added to it.

The Data Type Propagation block also provides a mechanism to force the computed number of bits to a useful value. For example, if you are targeting a 16-bit micro, then the target C compiler is likely to support sizes of only 8 bits, 16 bits, and 32 bits. The block will force these three choices to be used. For example, suppose the block computes a data type size of 24 bits. Since 24 bits is not directly usable by the target chip, the signal is forced up to 32 bits, which is natively supported.

There is also a method for dealing with floating-point reference signals. This makes it easier to create designs that are easily retargeted from fixed-point chips to floating-point chips or visa versa.

The Data Type Propagation block allows you to set up libraries of useful subsystems that will be properly configured based on the connected signals. Without this data type propagation process, a subsystem that you use from a library will almost certainly not work as desired with most integer or fixed-point signals, and manual intervention to configure the data type and scaling would be required. This block can eliminate the manual intervention in many situations.

Precedence Rules

The precedence of the dialog box parameters decreases from top to bottom. Additionally:

Data Type Support

The Data Type Propagation block accepts signals of any data type supported by Simulink, including fixed-point data types.

Parameters and Dialog Box

The Propagated type pane of the Data Type Propagation block dialog appears as follows:

Propagated data type
Use the parameter list to propagate the data type via the dialog box, or inherit the data type from the reference signals. Use the edit field to specify the data type via the dialog box.
If any reference input is double, output is
Specify single or double. This parameter makes it easier to create designs that are easily retargeted from fixed-point chips to floating-point chips or visa versa.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated data type parameter list.
If any reference input is single, output is
Specify single or double. This parameter makes it easier to create designs that are easily retargeted from fixed-point chips to floating-point chips or visa versa.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated data type parameter list.
Is-Signed
Specify the sign of Prop as one of the following values:

Parameter Value
Description
IsSigned1
Prop is a signed data type if Ref1 is a signed data type.
IsSigned2
Prop is a signed data type if Ref2 is a signed data type.
IsSigned1 or IsSigned2
Prop is a signed data type if either Ref1 or Ref2 are signed data types.
TRUE
Ref1 and Ref2 are ignored, and Prop is always a signed data type.
FALSE
Ref1 and Ref2 are ignored, and Prop is always an unsigned data type.
For example, if the Ref1 signal is ufix(16), the Ref2 signal is sfix(16), and the Is-Signed parameter is IsSigned1 or IsSigned2, then Prop is forced to be a signed data type.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated data type parameter list.
Number-of-bits: Base
Specify the number of bits used by Prop for the base data type as one of the following values:

Parameter Value
Description
NumBits1
The number of bits for Prop is given by the number of bits for Ref1.
NumBits2
The number of bits for Prop is given by the number of bits for Ref2.
max([NumBits1 NumBits2])
The number of bits for Prop is given by the reference signal with largest number of bits.
min([NumBits1 NumBits2])
The number of bits for Prop is given by the reference signal with smallest number of bits.
NumBits1+NumBits2
The number of bits for Prop is given by the sum of the reference signal bits.
Refer to "Targeting an Embedded Processor" in the Simulink Fixed Point documentation for more information about the base data type.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated data type parameter list.
Number-of-bits: Multiplicative adjustment
Specify the number of bits used by Prop by including a multiplicative adjustment. For example, suppose you want to guarantee that the number of bits associated with a multiply and accumulate (MAC) operation is twice as wide as the input signal. To do this, you configure this parameter to the value 2.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated data type parameter list.
Number-of-bits: Additive adjustment
Specify the number of bits used by Prop by including an additive adjustment. For example, if you are performing multiple additions during a MAC operation, the result may overflow. To prevent overflow, you can associate guard bits with the propagated data type. To associate four guard bits, you specify the value 4.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated data type parameter list.
Number-of-bits: Allowable final values
parameter allows you to force the computed number of bits used by Prop to a useful value. For example, if you are targeting a processor that supports only 8, 16, and 32 bits, then you configure this parameter to [8,16,32]. The block always propagates the smallest specified value that fits. If you want to allow all fixed-point data types, you would specify the value 1:128.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated data type parameter list.

The Propagated scaling pane of the Data Type Propagation block dialog appears as follows:

Propagated scaling
Use the parameter list to propagate the scaling via the dialog box, or inherit the scaling from the reference signals. Use the edit field to specify the scaling via the dialog box.
Values used to determine best precision scaling
Specify any values to be used to constrain the precision, such as the upper and lower limits on the propagated input. Based on the data type, the scaling will automatically be selected such that these values can be represented with no overflow error and minimum quantization error.
This parameter is only visible if Obtain via best precision is selected for the Propagated scaling parameter list.
Slope: Base
Specify the slope used by Prop for the base data type as one of the following values:

Parameter Value
Description
Slope1
The slope of Prop is given by the slope of Ref1.
Slope2
The slope of Prop is given by the slope of Ref2.
max([Slope1 Slope2])
The slope of Prop is given by the maximum slope of the reference signals.
min([Slope1 Slope2])
The slope of Prop is given by the minimum slope of the reference signals.
Slope1*Slope2
The slope of Prop is given by the product of the reference signal slopes.
Slope1/Slope2
The slope of Prop is given by the ratio of the Ref1 slope to the Ref2 slope.
PosRange1
The range of Prop is given by the range of Ref1.
PosRange2
The range of Prop is given by the range of Ref2.
max([PosRange1 PosRange2])
The range of Prop is given by the maximum range of the reference signals.
min([PosRange1 PosRange2])
The range of Prop is given by the minimum range of the reference signals.
PosRange1*PosRange2
The range of Prop is given by the product of the reference signal ranges.
PosRange1/PosRange2
The range of Prop is given by the ratio of the Ref1 range to the Ref2 range.
You control the precision of Prop with Slope1 and Slope2, and you control the range of Prop with PosRange1 and PosRange2. Additionally, PosRange1 and PosRange2 are one bit higher than the maximum positive range of the associated reference signal.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated scaling parameter list.
Slope: Multiplicative adjustment
Specify the slope used by Prop by including a multiplicative adjustment. For example, if you want 3 bits of additional precision (with a corresponding decrease in range), the multiplicative adjustment is 2^-3.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated scaling parameter list.
Slope: Additive adjustment
Specify the slope used by Prop by including an additive adjustment. An additive slope adjustment is often not needed. The most likely use is to set the multiplicative adjustment to 0, and set the additive adjustment to force the final slope to a specified value.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated scaling parameter list.
Bias: Base
Specify the bias used by Prop for the base data type. The parameter values are described below.

Parameter Value
Description
Bias1
The bias of Prop is given by the bias of Ref1.
Bias2
The bias of Prop is given by the bias of Ref2.
max([Bias1 Bias2])
The bias of Prop is given by the maximum bias of the reference signals.
min([Bias1 Bias2])
The bias of Prop is given by the minimum bias of the reference signals.
Bias1*Bias2
The bias of Prop is given by the product of the reference signal biases.
Bias1/Bias2
The bias of Prop is given by the ratio of the Ref1 bias to the Ref2 bias.
Bias1+Bias2
The bias of Prop is given by the sum of the reference biases.
Bias1-Bias2
The bias of Prop is given by the difference of the reference biases.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated scaling parameter list.
Bias: Multiplicative adjustment
Specify the bias used by Prop by including a multiplicative adjustment.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated scaling parameter list.
Bias: Additive adjustment
Specify the bias used by Prop by including an additive adjustment.
If you want to guarantee that the bias associated with Prop is zero, you should configure both the multiplicative adjustment and the additive adjustment to 0.
This parameter is only visible if Inherit via propagation rule is selected for the Propagated scaling parameter list.

Characteristics

Direct Feedthrough
Yes
Scalar Expansion
Yes


Previous page  Data Type Duplicate Data Type Scaling Strip Next page

© 1994-2005 The MathWorks, Inc.