beautypg.com

Motorola DSP96002 User Manual

Page 550

background image

MOTOROLA

DSP96002 USER’S MANUAL

B-31

DSP56000 IMPLEMENTATION

Program

ICycles

Words

move #k+N-1,r0 ;point to k

move #N-1,m0 ;number of k’s-1

move #state,r4 ;point to filter states

move m0,m4 ;mod for states

movep y:datin,a ;get input sample

move x:(r0)-,x0 y:(r4)+,y0 ;first k, first s 1 1

macr -x0,y0,a x:(r0)-,x0 y:(r4)-,y0 ;t’=t-k*s 1 1

do #n-1,_endlat ;do sections 2 3

macr -x0,y0,a b,y:(r4)+ ;t’-k*s, save state 1 1

move a,x1 y:(r4)+,b ;copy t’,get s again 1 1

macr x1,x0,b x:(r0)-,x0 y:(r4)-,y0 ;fnd s,get s,get k 1 1

_endlat

move b,y:(r4)+ ;save second last s 1 1

move x:(r0)+,x0 a,y:(r4)+ ;update r0,save last s 1 1

movep a,y:datout ;output sample

----- -----

9 3N+4

DSP96002 IMPLEMENTATION

Program ICycles

Words

move #k+N-1,r0 ;point to k

move #N-1,m0 ;number of k’s-1

move #state,r4 ;point to filter states

move m0,m4 ;mod for states

move #2,n4 ;offset for state indexing 1 1

movep y:datin,d1 ;get input sample

move x:(r0)-,d5.s y:(r4)+,d6.s 1 1

fmpy.s d5,d6,d3 x:(r0)-,d5.s y:(r4)-,d6.s 1 1

fsub.s d3,d1 1 1

do #N-1,_elat 2 3

fmpy d5,d6,d0 fadd.s d0,d3 1 1

fsub.s d0,d1 d6.s,d3.s d3.s,y:(r4)+n4 1 1

fmpy d5,d1,d0 x:(r0)-,d5.s y:(r4)-,d6.s 1 1

_elat

fadd.s d0,d3 (r0)+ 1 1

move d3.s,y:(r4)+ 1 1

move d1.s,y:(r4)+ 1 1

movep d1.s,y:datout

--- ---

Totals: 12 3N+7