Block Floating-Point Scaling Subroutine - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

14.7.4

Block Floating-Point Scaling Subroutine

The bfp_adj routine checks the FFT output data for bit growth and scales
the entire set of data if necessary. This check prevents data overflow for
each stage in the FFT. The routine, shown in Listing 14.8, uses the
exponent detection capability of the shifter.
.MODULE
dit_radix_2_bfp_adjust;
{
Calling Parameters
Radix-2 DIT FFT stage results in inplacereal and inplaceimag
Return Parameters
inplacereal and inplaceimag adjusted for bit growth
Altered Registers
I0,I1,AX0,AY0,AR,MX0,MY0,MR,CNTR
Altered Memory
inplacereal, inplaceimag, blk_exponent
}
.CONST
Ntimes2 = 2048;
.EXTERNAL
inplacereal, blk_exponent; {Begin declaration section}
.ENTRY
bfp_adj;
bfp_adj:
AY0=CNTR;
AR=AY0-1
IF EQ RTS;
AY0=-2;
AX0=SB;
AR=AX0-AY0;
IF EQ RTS;
I0=^inplacereal;
I1=^inplacereal;
AY0=-1;
MY0=H#4000;
Software Examples
{Check for last stage}
{If last stage, return}
{Check for SB=-2}
{IF SB=-2, no bit growth, return}
{I0=read pointer}
{I1=write pointer}
{Set MY0 to shift 1 bit right}
14
14 – 19

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents