DSP_recip16
*(rexp++)=normal−15; | /* store exponent */ | |
b=0x80000000; | /* dividend = 1 */ | |
for(j=15;j>0;j−−) |
| |
b=_subc(b,a); | /* divide */ | |
b=b&0x7FFF; | /* clear remainder | |
| /* (clear upper half) */ | |
if(neg) b=−b; | /* if originally | |
| /* negative, negate */ | |
*(rfrac++)=b; | /* store fraction */ |
}
}
Special Requirements None
Implementation Notes
| - Bank Conflicts: No bank conflicts occur. | |
| - Interruptibility: The code is interruptible. | |
| - The conditional subtract instruction, SUBC, is used for division. SUBC is | |
| used once for every bit of quotient needed (15). | |
Benchmarks | Cycles | 8 * nx + 14 |
| Codesize | 196 bytes |