The elements required for defining fixed-point variables
are included in a profile called FixedPoint.
About this task
This profile contains:
- Predefined types representing 8-bit, 16-bit, and
32-bit fixed-point variables: FXP_8Bit_T, FXP_16Bit_T, FXP_32Bit_T.
(These are the only types that can be used with fixed-point operations.)
- A "new term" stereotype, applicable to attributes,
called FixedPointVar, with a tag called FXP_Shift which
is used to define the scale of the fixed-point variable.
The word-size is determined by the type chosen,
while the shift to use is determined by the value entered for the
tag FXP_Shift.
The profile uses a file
called FixedPoint.h, which contains:
- Typedefs representing the predefined fixed-point
variable types
- Macros that are used for carrying out operations
on fixed-point variables.
The file is "included" into the generated code
where fixed-point variables are generated.