AnsweredAssumed Answered

VisualDSP++ Rounding off Issue

Question asked by gopakumar on Feb 4, 2010
Latest reply on Feb 4, 2010 by SeanM

Hi,


I observed a small problem while initializing the data memory of SHARC 21369 with floating point values. I have a set of floating point coefficients to be initialized in the data memory. The code looks like this.


.segment/dm seg_dmda;

.var coeff = 0.693142768;
.var _coeff;


.segment/pm seg_pmco;

f0 = 0.693142768;
dm(_coeff) = f0;

 

After loading the code into the dsp and observing the memory locations showed that coeff had a value 0.69314271 and _coeff had the value 0.69314277 (Screenshot attached). The value of _coeff seems to be more correctly rounded. coeff and _coeff differed by 2 bits. I have observed similar results with some other values too.

 

My question is: Is it possible to make some settings in the Visual DSP IDE so that initializing a variable in data memory while it is declared happens to the correctly rounded value?

 

Thanks in advance

 

 

Gopakumar

Attachments

Outcomes