fi.sum increases bitlength although fimath is set to KeepMSB
Mostrar comentarios más antiguos
Hi there,
I was wondering why the sum function increases the length of my fixed point variable.
Here is a little example:
fimath('SumMode','KeepMSB')
x = fi(1:100,true,8,0)
.
.
.
y = sum(x)
y = 5050
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 15
FractionLength: 0
I actually expected y to be 39, which is the decimal representation of 00100111 (the first 8 bit of y). It seams that the sum function just works with FullPrecision anyways?! Am I doing something wrong here?
Any help is highly appreciated.
Regards,
Len
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Fixed-Point Designer en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!