	page 132,66,0,6
        opt     rc
;*******************************************
;Motorola Austin DSP Operation  June 30,1988
;*******************************************
;DSP96001/2
;8 pole 5 multiply cascaded canonic IIR filter
;File name: 5-96.asm
;**************************************************************************
;	Maximum sample rate: 435.5 KHz at 27.0 MHz
;	Memory Size: Prog: 4+13 words ; Data :4*(2+5) words
;	Number of clock cycles:	62 (31 instruction cycles)
;	Clock Frequency:        27.0 MHz
;	Cycle time:		74.1 ns
;**************************************************************************
;	This IIR filter reads the input sample
;	from the memory location Y:input
;	and writes the filtered output sample
;	to the memory location Y:output
;
;	The samples are stored in the X memory
;	The coefficients are stored in the Y memory
;**************************************************************************
;
;	initialization
;**********************
;	The equations of the filer are:
;       w(n) =    x(n) - ai1*w(n-1) - ai2*w(n-2)
;       y(n) = b0*w(n) + bi1*w(n-1) + bi2*w(n-2)
;
;		             w(n)
;   x (n)------(-)---------->-|->---bi0---(+)-------> y(n)
;               A             |            A
;               |            1/z           |
;               |             | w(n-1)     |
;               |             v            |
;               |-<--ai1----<-|->---bi1-->-|
;               |             |            |
;               |            1/z           |
;               |             | w(n-2)     |
;               |             v            |
;               |-<--ai2----<--->---bi2-->-|
;
;
;       X Memory Organization            Y Memory Organization
;					       |   b0N   | Coef. + 5N-1
;         |         |                          |   b1N   |
;         |         |                          |   b2N   |
;         |         |                          |   a1N   |
;         |         |                          |   a2N   |
;         | wN(n-1) | Data + 2N-1              |    .    |
;         | wN(n-2) |                          |   b01   |
;         |   .     |                          |   b11   |
;         |   .     |                          |   b21   |
;         | w1(n-1) |                          |   a11   |
;    R0 ->| w1(n-2) | Data                R4 ->|   a21   | Coef.
;         |         |                          |         |
; 
nsec	equ	4
start	equ	$40
data	equ	0
cddr	equ 	0	
input	equ	$ffe0
output	equ	$ffe1
;
;                                                       Program  Icycles
;                                                       Words

       move   #data,r0                                  ;     1      1
       move   #coef,r4                                  ;     1      1
       move   #2*nsec-1,m0                              ;     1      1
       move   #4*nsec-1,m4                              ;     1      1
;                                                            ---    ---
       opt   cc                                         ;     4      4
;      filter loop:5*nsec+11
;*************************************************                                   
       movep                      x:input,d0.l          ;     1      2
       float  d0,d0                                     ;     1      1
       fclr   d1                  x:(r0)+,d4.s y:(r4)+,d6.s ; 1      1
       do     #nsec,end_cell                            ;     2      3
       fmpy d4,d6,d1 fadd  d1,d0  x:(r0)-,d5.s y:(r4)+,d6.s ; 1      1
       fmpy d5,d6,d1 fsub  d1,d0  d5.s,x:(r0)+ y:(r4)+,d6.s ; 1      1
       fmpy d4,d6,d1 fsubr d1,d0               y:(r4)+,d6.s ; 1      1
       fmpy d5,d6,d5              d0.s,x:(r0)+ y:(r4)+,d6.s ; 1      1
       fmpy d0,d6,d0 fadd  d5,d1  x:(r0)+,d4.s y:(r4)+,d6.s ; 1      1
end_cell
                     faddr d1,d0                            ; 1      1
       int  d0,d0                                           ; 1      1
       movep                     d0.l,x:output              ; 1      2
                                                            ;---    ---
;*************************************************	     13	5*nsec+11
                                             ;   -----------------------
                                             ;  Totals       15  5*nsec+13
        end



