Some forms of Simulink logging write 64 bit integers as fi objects. Does that mean I need a Fixed-Point Designer license?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Fixed Point Team
il 10 Set 2020
Modificato: Andy Bartlett
il 10 Set 2020
I've observed that some forms of logging in Simulink write integer variables out to MATLAB as fi objects.
For example, DSP Binary File Writer is logging 64 bit unsigned integers to fi( val, 0, 64, 0 ) objects.
Does that mean I need a Fixed-Point Designer license to log these variables?
0 Commenti
Risposta accettata
Andy Bartlett
il 10 Set 2020
Modificato: Andy Bartlett
il 10 Set 2020
As of R2017a,
a Fixed-Point Designer license would NOT be required.
As of R2017a,
constructing a fi object whose type is equivalent to MATLAB's 11 built-in numerictypes
double, single, logical, uint8, int8, uint16, int16, uint32, int32, uint64, int64
does not require a Fixed-Point Designer license.
For example, this code
v_u64 = fi( 123, 0, 64, 0)
v_s64 = fi( 123, 1, 64, 0)
v_u32 = fi( 123, 0, 32, 0)
v_s32 = fi( 123, 1, 32, 0)
v_u16 = fi( 123, 0, 16, 0)
v_s16 = fi( 123, 1, 16, 0)
v_u8 = fi( 123, 0, 8, 0)
v_s8 = fi( 123, 1, 8, 0)
would not require a Fixed-Point Designer license.
In R2016b and earlier,
a Fixed-Point Designer license would be required.
This change coincided with another important license change.
In R2016b and earlier,
use of 64 bit integers in Simulink requires a Fixed-Point Designer license.
As of R2017a,
usage of 64 bit integers in Simulink does not require any additional licenses.
FYI:
If you'd like to change a fi object to its built-in MATLAB eqivalent, it's easy to do.
In R2020a and later, you can use utilities castFiToMATLAB
a = fi(123,0,64,0)
a =
123
DataTypeMode: Fixed-point: binary point scaling
Signedness: Unsigned
WordLength: 64
FractionLength: 0
>> b = castFiToMATLAB(a)
b =
uint64
123
or castFiToInt
> a = fi(123,0,64,0)
a =
123
DataTypeMode: Fixed-point: binary point scaling
Signedness: Unsigned
WordLength: 64
FractionLength: 0
>> b = castFiToInt(a)
b =
uint64
123
In earlier releases, you can simply cast using the name of the MATLAB class (a.k.a. data type name)
for example
>> a = fi(123,0,64,0)
a =
123
DataTypeMode: Fixed-point: binary point scaling
Signedness: Unsigned
WordLength: 64
FractionLength: 0
>> b = uint64( a )
b =
uint64
123
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Fixed Point in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!