olo_fix_from_real¶
Status Information¶
VHDL Source: olo_fix_from_real
Bit-true Model: olo_fix_from_real
Description¶
This entity converts a real (floating-point) number to fixed-point format.
Real numbers are not used for synthesis normally. The olo_fix_from_real entity has the following use-case:
- Create fixed-point representation of constants
- Example: Calculation of the gravitational force
- A real constant with the value 9.81 is defined (good readability)
- For fixed-point calculations, the constant is converted to fixed-point representation using olo_fix_from_real
- In this case the input is static, therefore the generic interface (Value_g) is used
Note that this entity does not contain any pipeline registers. Real (floating-point) values do no exist in synthesized netlists - so the conversion only is executed at compile-time or in simulations. Hence no registers are needed.
This entity does only allow to handle constant values. For the conversion of real values in simulation, use olo_fix_sim_from_real instead.
For details about the fixed-point number format used in Open Logic, refer to the fixed point principles.
Generics¶
| Name | Type | Default | Description |
|---|---|---|---|
| ResultFmt_g | string | - | Format of the result String representation of an en_cl_fix Format_t (e.g. "(0,1,15)") |
| Saturate_g | string | "SatWarn_s" | Saturation mode String representation of an en_cl_fix FixSaturate_t. |
| Value_g | real | 0.0 | Generic to be used for compile-time static inputs. |
Interfaces¶
Input Data¶
None
Output Data¶
| Name | In/Out | Length | Default | Description |
|---|---|---|---|---|
| Out_Value | out | width(ResultFmt_g) | N/A | Output data |
Detail¶
No detailed description required. All details that could be mentioned here are already covered by fixed point principles.