how does the c5402 handle overflow? does it just saturate (clip) or wrap-around? i tried looking for answers in the overwhelming documents but found none. I performed some experiment using the filter design toolbox in MATLAB. it strongly indicated that the 5402 "wraps around". I ask this question just to be sure. If the dsp indeed wraps around the calculations, can we somehow configure it such that is just clips the results that overflow? For that matter, is there some trick (like editing some memory mapped registers) so that the dsp will just clip instead of wrap around the values? thanks, marlo |
|
c5402 saturate/wrap-around
Started by ●May 20, 2002
Reply by ●May 20, 20022002-05-20
On Sun, 19 May 2002 23:37:24 -0700 (PDT), you wrote: >how does the c5402 handle overflow? does it just >saturate (clip) or wrap-around? i tried looking for Depends on how you setup the ALU control flags. It can saturate at 0x7fffffff, or roll over depending on how you have the OVM flag set. Also see the SXM and FRCT flags for related functions that can mysteriously mess up your code if you're not careful. Brian ----------------- Brian C. Lane (KC7TYU) Programmer www.shinemicro.com RF, DSP & Microcontroller Design |