Fixed-point type declarations, Table 3-8. fixed-point data type summary, Generic functions – National Instruments AutoCode NI MATRIX User Manual
Page 85

Chapter 3
Ada Language Reference
© National Instruments Corporation
3-23
4.
Compile the generated files—Two source files are generated,
gaintest.a
and
fxp_gaintest_.a
, as shown in Figure 3-1. The
imposed package dependencies (refer to the
section) require that the
RT_FIXED_OPERATORS
package be compiled
into the Ada Library before the code that represents the model. Thus,
the file
fxp_gaintest.a
is compiled before
gaintest.a
.
5.
Create an executable—This is the final step and it creates an
executable file. Refer to your Ada compiler documentation on how
to complete this step.
Fixed-Point Type Declarations
Within the
SA_FIXED
package, all of the supported fixed-point data type
are declared. Table 3-8 summarizes the fixed-point type specifications.
Generic Functions
The generic functions that are used to instantiate overloaded operators and
other functions are found in the
SA_FIXED_GENERICS
package, which is
found in the
sa_fxpgenerics_.a
and
sa_fxpgenerics.a
files.
Table 3-9 summarizes the functions and their purpose. Refer to the package
specification for more details.
Table 3-8. Fixed-Point Data Type Summary
Name
1
Radix
Range
Delta
2
Range
2
(smallest .. largest)
RT_SBYTExx
–16..48
2.0 ** (–r)
–(2.0 ** 7 – r)..((2.0 ** 7 – r) – (2.0 ** (–r)))
RT_UBYTExx
–16..48
2.0 ** (–r)
0.0 .. ((2.0 ** 8 – r) – (2.0 ** (–r)))
RT_SSHORTxx
–16..48
2.0 ** (–r)
–(2.0 ** 15 – r)..((2.0 ** 15 – r) – (2.0 ** (–r)))
RT_USHORTxx
–16..48
2.0 ** (–r)
0.0 .. ((2.0 ** 16 – r) – (2.0 ** (–r)))
RT_SLONGxx
–16..48
2.0 ** (–r)
–(2.0 ** 31 – r)..((2.0 ** 31 – r) – (2.0 ** (–r)))
RT_ULONGxx
3
–16..48
2.0 ** (–r)
0.0 .. ((2.0 ** 31 – r) – (2.0 ** (–r)))
1
xx denotes a two-digit number representing the radix, like 03 or 12.
2
r denotes a specific radix.
3
Ada compiler limitations restrict the range of the data types to be the same as if the data types were signed.