| Contents | Index |
In Fixed-Point Toolbox software, the fipref object determines the display properties of fi objects. Code examples throughout this User's Guide generally show fi objects as they appear with the following fipref object properties:
NumberDisplay — 'RealWorldValue'
NumericTypeDisplay — 'full'
FimathDisplay — 'full'
Setting 'FimathDisplay' to 'full' provides a quick and easy way to differentiate between fi objects with a local fimath and those that are associated with the global fimath. When 'FimathDisplay' is set to 'full', MATLAB displays fimath object properties for fi objects with a local fimath. MATLAB never displays fimath object properties for fi objects that are associated with the global fimath. Because of this display difference, you can tell when a fi object is associated with the global fimath just by looking at the output.
Additionally, unless otherwise specified, examples throughout the Fixed-Point Toolbox documentation use the following configuration of the global fimath:
RoundMode: nearest
OverflowMode: saturate
ProductMode: FullPrecision
MaxProductWordLength: 128
SumMode: FullPrecision
MaxSumWordLength: 128
Note If you are using a different global fimath, you may see different results when running the examples. |
For more information on display settings, refer to Working with fipref Objects.
To see the output as it appears in most Fixed-Point Toolbox code examples, set your fipref properties as follows and create two fi objects:
p = fipref('NumberDisplay', 'RealWorldValue',...
'NumericTypeDisplay', 'full', 'FimathDisplay', 'full');
a = fi(pi,'RoundMode', 'floor', 'OverflowMode', 'wrap')
b = fi(pi)
MATLAB returns the following:
a =
3.1415
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 13
RoundMode: floor
OverflowMode: wrap
ProductMode: FullPrecision
MaxProductWordLength: 128
SumMode: FullPrecision
MaxSumWordLength: 128
b =
3.1416
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 13MATLAB displays fimath object properties in the output of fi object a because a has a local fimath.
MATLAB does not display any fimath object properties in the output of fi object b because b associates itself with the global fimath.
If you are working with multiple fi objects that have local fimaths, you may want to turn off the fimath object display:
NumberDisplay — 'RealWorldValue'
NumericTypeDisplay — 'full'
FimathDisplay — 'none'
For example,
p = fipref('NumberDisplay', 'RealWorldValue',...
'NumericTypeDisplay', 'full', 'FimathDisplay', 'none')
p =
NumberDisplay: 'RealWorldValue'
NumericTypeDisplay: 'full'
FimathDisplay: 'none'
LoggingMode: 'Off'
DataTypeOverride: 'ForceOff'
F = fimath('RoundMode', 'floor', 'OverflowMode', 'wrap');
a = fi(pi, F)
a =
3.1415
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 13
Although this setting helps decrease the amount of output produced, it also makes it impossible to tell from the output whether a fi object is associated with the global fimath. To do so, you can use the isfimathlocal function. For example,
isfimathlocal(a)
ans =
1When the isfimathlocal function returns 1, the fi object has a local fimath. If the function returns 0, the fi object is associated with the global fimath. For more information on the global fimath, see Working with the Global fimath in the Fixed-Point Toolbox User's Guide.
To reduce the amount of output even further, you can set the NumericTypeDisplay to 'short'. For example,
p = fipref('NumberDisplay', 'RealWorldValue',...
'NumericTypeDisplay', 'short', 'FimathDisplay', 'full');
a = fi(pi)
a =
3.1416
s16,13
![]() | Getting Help | Demos | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |