Sunteți pe pagina 1din 34

Experiment 6

ADDRESSING MODES AND SEQUENCE GENERATION


Aim:
a) To learn the following addressing modes of TMS320C54X DSP.
i) immediate
ii) direct addressing
iii) indirect addressing : general type, indexing, circular addressing
iv) memory mapped register addressing
b) To generate and find the sum of the following arithmetic sequences.
i) 1+2+3+4+ + n
ii) 1-2+3-4+ + n
iii) 12+22+32++ n2
iv) 1+1+2+3+5+8 + n (Fibonacci series)
The value of n is defined as variable assignment in the program
Objectives:
1. To understand the data load and store operations and various addressing modes of TMS320C54X DSP.
2. To make familiar the assembly instructions for arithmetic and logical operations.
3. To understand the branch instructions suitable to define loop functions
Algorithm:
a) Addressing modes
i) Immediate addressing mode: Write the various arithmetic, logic instructions, load and
store instructions that support short and long immediate addressing mode.
ii) Direct addressing mode: Write the various arithmetic, logic instructions, load and
store instructions that direct addressing mode with DP.
iii) Indirect addressing mode: Write the various arithmetic, logic instructions load and
store instructions that support various indirect addressing mode.
iv) Memory mapped register addressing mode: Write the assembly instructions to access
memory mapped registers using various addressing modes and memory mapped
register addressing mode. (Example use AR0, DP and BK registers)
b) Sequence generation
i) 1+2+3+4+ + n
Start
Read n
Sum = 0 i=1

for i=1: n
Begin
Store i in memory
Sum=Sum+i 3
Increment i by 1
End
Store Sum in memory
Stop
ii) 1-2+3-4+ + n
Start
Read n
Sum = 0, Sum1 = 0, Sum2 =0, i=1
for i=1: n
Begin
Store i in memory
If i is odd
Sum1=Sum1+i
Else
Sum2=Sum2+i
Increment i by 1
Sum = Sum1+negative of (Sum2)
End
Store Sum in memory
Stop
iii) 12+22+32 +...+n2
Start
Read n
Sum = 0, i=1 to n, a=0
for i=1:n
Begin
Store i in the memory
a=i*i
Store a in memory
Sum=Sum+a
End
Store Sum in the memory
End
iv) 1+1+2+3+5+8 + n (Fibonacci series)
Start
Read n
a=0, b=1
Store a and b in the memory
for i=1: n-2
Begin
c=a

a=a+b
b=c
Store a in the memory 4
End
Stop
Assembly Language Codes and Observations:
(i) Addressing Modes:
.mmregs
.text

Loop

LD #05,A
STL A,BK
LD #10,A
STL A,AR3
STL A,10H
LD #1080h,A
STL A,AR2
LD #0h,A
ADD *AR2+%,A
ADD *AR2+%,A
ADD *AR2+%,A
ADD *AR2+%,A
ADD *AR2+%,A
BANZ Loop,*AR3.end

(ii) Sequence Generation


(a) 1+2+3+...+n
.mmregs
.text
LD #09H,A
STL A,AR3
LD #00h,A
LD #01h,B
ST #1000H,AR6
Loop
STL B,*AR6+
ADD B,A
ADD #1h,B
BANZ Loop,*AR3STL A,*AR6
.end

(b) 1-2+3-4+ + n
.mmregs
.text
LD #0,B
LD #4,A
STL A,AR3
LD #1,A
STL A,AR5
LD #1,A
ST #2000H,AR2
Loop
STL A,*AR2+
ADD A,B
ADD AR5,A
SUB A,B
ADD AR5,A
BANZ Loop,*AR3STL B,*AR2
.end

(c) 12+22+32 +...+n2


.mmregs
.text
LD #04H,A
STL A,AR3
LD #01h,A
STL A,T
LD #00h,A
LD #01,B

ST #7000H,AR6
Loop
MPY T,B
STL B,*AR6+
ADD B,A
LD #0h,B
ADD T,B
ADD #1h,B
STL B,T
BANZ Loop,*AR3STL A,*AR6
.end

(d) 1+1+2+3+5+8 + n (Fibonacci series)


.mmregs
.text
LD #1,B
LD #5,A
STL A,AR5
LD #0,A
STL A,AR7
ST #5000H,AR6
Loop
STL B,*AR6+
LD #0H,A
ADD AR7,A
ADD B,A
STL A,AR7
ADD AR7,B
BANZ Loop,*AR5STL A,*AR6
.end

Result:
a) Thus learnt the following addressing modes of TMS320C54X DSP.
i) immediate
ii) direct addressing
iii) indirect addressing : general type, indexing, circular addressing
iv) memory mapped register addressing
b)Hence generated and found the sum of the following arithmetic sequences.
i) 1+2+3+4+ + n
ii) 1-2+3-4+ + n
iii) 12+22+32++ n2
iv) 1+1+2+3+5+8 + n (Fibonacci series)
The value of n is defined as variable assignment in the program

Experiment 7
CONVOLUTION
Aim:
To perform the linear convolution and circular convolution of two sequences using
i) overlap add technique
ii) overlap save technique
Objectives:
1. To understand the various multiply instructions.
2. To make familiar with multiply and accumulate (MAC) operation and to know the format of various
MAC instructions in PDSPs.
3. To determine the memory size required in implementing the convolution operations using overlap add
and overlap save techniques.
4. To understand the concept involved in implementing the linear and circular convolution.
Algorithm:
Convolution:
Get the input sequence x(n) of length m and another sequence h(n) of length n each
Get the sequence x1(n) by concatenating sequence x(n) twice
for i=1 to n
Sum = 0
for j=1 to n
Sum = Sum + x1(n-j+i+i)*h(j)
g(i) = Sum
Stop
Overlap & add method
Start
Get input sequence x(n) of length m and other sequence h(n) of length n
Segment the input sequence into blocks of length m each
Append n-1 zeros to the i-th block of x(n) and m-1 zeros to the sequence h(n) and perform circular
convolution
Store the output of i-th block in the output sequence. Before storing overlap i-th output over and (i-1) the
output for n-1 samples and add them both and save it.
Repeat steps 3, 4 till input sequence is completed.
Overlap & save method
Get input sequence x(n) of length m and other sequence h(n) of length N
In the input sequence, take the first block of m samples and append n-1 zeros before it

Append m-1 zeros to the sequence h(n) and perform circular convolution.
Save the output of the block in the output sequence by overlapping n-1 samples and discard the
overlapped samples of previous output block.
Take the next block with n-1 last samples of previous output block of m fresh samples.
Repeat steps 3 to 5 till the end of the input sequence
Assembly Language Codes and Observations
(i) Multiply and Add:

Loop
Lpoo

.mmregs
.text
stm Data+4,ar2
stm #1050h,ar3
LD #4h,A
STL A,AR7
LD #1094h,A
STL A,AR6
stm #07h,ar5
Ld #0,B
Ld *ar6+,T
MPY *AR2-,A
ADD A,B
BANZ Lpoo,*AR7LD #1094h,A
STL A,AR6
LD #4h,A
STL A,AR7
stl B,*ar3+
mar *+ar2(6)
Banz Loop,*ar5-

coeff .Word 1h,2h,3h,4h,5h


.Word 0,0,0,0
.Data
Data .Word 0,0,0,0,3h,4h,5h,0h
.Word 0h,0h,0h,0h

.end

(ii) MACP:

Loop

.mmregs
.text
stm Data+4,ar2
stm #1050h,ar3
stm #07h,ar5
Ld #0,B
Rpt #4h
Macp *ar2-,coeff,B
stl B,*ar3+
mar *+ar2(6)
Banz Loop,*ar5-

coeff .Word 1h,2h,3h,4h,5h


.Word 0,0,0,0
.Data
Data .Word 0,0,0,0,3h,4h,5h,0h
.Word 0h,0h,0h,0h

.end

(iii) MACD:

Loop

.mmregs
.text
stm Data+9,ar2
stm #1050h,ar3
stm #07h,ar5
Ld #0,B
Rpt #6h
Macd *ar2-,coeff,B
Delay *ar2
stl B,*ar3mar *+ar2(7)
Banz Loop,*ar5-

coeff .Word 1h,2h,3h,4h,5h


.Word 0,0,0,0
.Data

Data .Word 0,0,0,3h,4h,5h,0h


.Word 0h,0h,0h,0h

.end

(iv) MAC:
.mmregs
.text
stm Data+4,ar2
stm #1050h,ar3
LD #4h,A
STL A,AR7
LD #1094h,A
STL A,AR6
stm #07h,ar5
Loop Ld #0,B
Lpoo Ld *ar6+,T
MAC *AR2-,B
BANZ Lpoo,*AR7LD #1094h,A
STL A,AR6
LD #4h,A
STL A,AR7
stl B,*ar3+
mar *+ar2(6)
Banz Loop,*ar5coeff .Word 1h,2h,3h,4h,5h
.Word 0,0,0,0
.Data
Data .Word 0,0,0,0,3h,4h,5h,0h
.Word 0h,0h,0h,0h

.end

(v) Overlap and Add:


.mmregs
.text
stm #03h,ar1
stm #1000h,ar4
stm #00h,ar6
stm #data2,ar3
lp1

+mvdp *ar3+,coeff
mvdp *ar3+,coeff+1
mvdp *ar3+,coeff+2
mvdp *ar3+,coeff+3
mvdp *ar3+,coeff+4
stm data1+6,ar2 ; 6 or b
stm #02h,ar7

lp

ld #00h,b
rpt #04h
macp *ar2-,coeff,b
stl b,*ar4+
mar *+ar2(+6)
banz lp2,*ar7mar *+ar3(-2)
banz lp1,*ar1nop
nop

coeff .word 0,0,0,0,0


.data
data1 .word 0,0,0,0,1,2,3,0,0,0,0,0
data2 .word 0,0,1,2,3,4,5,6,7,8,9,0,0,0

(vi) Overlap and Save:


.mmregs
.text
stm #03h,ar1
stm #3000h,ar4
stm #00h,ar6
stm #1000h,ar2
stm #data2,ar3
lp1:
mvdp *ar3+,coeff+2
mvdp *ar3+,coeff+3
mvdp *ar3+,coeff+4
mvdp *ar3+,coeff+5
mvdp *ar3+,coeff+6
stm data1+6,ar2 ; 6 or b
stm #04h,ar7

lp2:

ld #00h,b
rpt #06h
macp *ar2-,coeff,b
stl b,*ar4+
mar *+ar2(+8)
banz lp2,*ar7mar *+ar3(-2)
banz lp1,*ar1nop
nop

coeff .word 0,0,0,0,0,0,0


.data
data1 .word 0,0,0,0,1,2,3,0,0,0,0,0
data2 .word 0,0,1,2,3,4,5,6,7,8,9,0,0,0

Result:
Hence performed the linear convolution and circular convolution of two sequences using
i) overlap add technique
ii) overlap save technique

Type
MACP
MACD
MULTIPLY AND ADD
MAC
OVERLAP AND ADD
OVERLAP AND SAVE

Time Complexity(ns)
459
569
1106
946
1510
2400

Experiment 8
CORRELATION
Aim:
To implement
i) cross correlation
ii) auto correlation of two sequences through assembly language programming.
Objectives:
1. To understand, how MAC instruction can be used to perform correlation.
2. To know, what are the various MAC instructions available in PDSPs to perform
3. correlation.
4. To calculate the effective memory required to perform the correlation operation.
Algorithm:
Cross correlation
x1(n) First input sequence of length m
x2(n) Second input sequence of length n
out[n] output sequence
for (i=0; i<m; i++)
{
for (j=0; j<n; j++)
{
Out[i+j]+= x1[i]* x2[n-j]
}
}
Display out[ ].
Auto correlation
x1(n) input sequence of length l
for (i=0;i<l;i++)
{
for (j=0;j<l;j++)
{
out[i+j] + = x1[i] x1[l-j]
}
}
Display out[ ]

Assembly Language Codes and Observations:


Cross Correlation
.mmregs
.text
f1 .word 4,9,12,15,18,19,20,20,18,16,13,10,6,1,-3,-7,-11,-15,-17,-19,-20,-20,-19,-17,-14,-11,-7,3,2,6,10,14

f2 .word 118,190,190,118,0,-117,-190,-190,-118,-1,117,190,190,118,1,-117,-190,-191,-119,1,116,190,191,119,2,-116,-190,-191,-119,-2,116,190
ld #f1,a
stl a,ar1
ld #f2,a
stl a,ar2
ld #31,a
stl a,ar3
ld #1600h,a
stl a,ar5
out:

ld #31,a
stl a,ar4
ld #f2,b
add #31,b
stl b,ar2

in:

ld *ar5,a
ld *ar1,b
stl b,t
mpy *ar2-,b
add b,a
stl a,*ar5+
banz in,*ar4ld *ar1+,a
ld ar5,a
sub #31,a
stl a,ar5
banz out,*ar3nop
.end

Auto Correlation for First Signal (f1)


.mmregs
.text
f1 .word 4,9,12,15,18,19,20,20,18,16,13,10,6,1,-3,-7,-11,-15,-17,-19,-20,-20,-19,-17,-14,-11,-7,3,2,6,10,14

f2 .word 118,190,190,118,0,-117,-190,-190,-118,-1,117,190,190,118,1,-117,-190,-191,-119,1,116,190,191,119,2,-116,-190,-191,-119,-2,116,190
ld #f1,a
stl a,ar1
ld #f1,a
stl a,ar2
ld #31,a
stl a,ar3
ld #1600h,a
stl a,ar5
out:

ld #31,a
stl a,ar4
ld #f2,b
add #31,b
stl b,ar2

in:

ld *ar5,a
ld *ar1,b
stl b,t
mpy *ar2-,b
add b,a
stl a,*ar5+
banz in,*ar4-

ld *ar1+,a
ld ar5,a
sub #31,a
stl a,ar5
banz out,*ar3nop
.end

Auto Correlation for Second Signal (f2)


.mmregs
.text
f1 .word 4,9,12,15,18,19,20,20,18,16,13,10,6,1,-3,-7,-11,-15,-17,-19,-20,-20,-19,-17,-14,-11,-7,3,2,6,10,14

f2 .word 118,190,190,118,0,-117,-190,-190,-118,-1,117,190,190,118,1,-117,-190,-191,-119,1,116,190,191,119,2,-116,-190,-191,-119,-2,116,190
ld #f2,a
stl a,ar1
ld #f2,a
stl a,ar2
ld #31,a
stl a,ar3

ld #1600h,a
stl a,ar5
out:

ld #31,a
stl a,ar4
ld #f2,b
add #31,b
stl b,ar2

in:

ld *ar5,a
ld *ar1,b
stl b,t
mpy *ar2-,b
add b,a
stl a,*ar5+
banz in,*ar4ld *ar1+,a
ld ar5,a
sub #31,a
stl a,ar5
banz out,*ar3nop
.end

Result:
Hence implemented
i) cross correlation
ii) auto correlation of two sequences through assembly language programming.

Experiment 9
WAVEFORM GENERATION
Aim:
To write assembly language program to generate
i) saw tooth wave,
ii) triangular wave,
iii) square wave,
iv) trapezoidal wave and
iv) sine wave
Objectives:
1. To know the method to define multiple loops
2. To understand the unconditional and conditional types of branch instructions
3. To make familiar with the display tools in the Code Composer Studio (CCS)
4. To understand the relation between machine cycle time and execution time of the program
Algorithm:
i) Saw tooth wave
start
k=0, out[ ]
for i=0 to 16
begin
out[k]=0
increase k
for j=0 to 48
Begin
out[k]=out[k-1]+1
increase k
end
end
stop
ii) Triangular wave
out[n] output values
out[0] = 0; k=1;
for (i=0;i<16;i++)
begin
for (j=0;i<7;j++)
out[k] = out[k-1]+1;
increase k
end
for (j=0;j<7;j++)
begin

out[k]=out[k-1]-1;
increase k
end 7
end
iii) Square wave
Start
k=0, out[]
for i=0 to 16
begin
for j=0 to 32
begin
out[k]=6
increase k
end
for j=0 to 32
begin
out[k]=0
increase k
end
end
stop
iv) Trapezoidal wave
Start
k=0, out[0]=0
for i=1 to 16
begin
for j=1 to 8
begin
out[k+1]=out[k]+1
increase k
end
for j=1 to 32
begin
out[k+1]=out[k]
increase k
end
for j=1 to 8
begin
out[k+1]=out[k]-1
increase
end
end
stop
v) Sine wave
Start

sine[n]- Array containing sine values 8


out[n]- output array
k=0;
for i=1 to 16
begin
for j=0 to 25
begin
out[k]=sine[k]
increment k
end
end
stop

Assembly Language Codes and Observations


(i) SawTooth
.mmregs
.text
st #7500h, ar2
st #5, ar3
st #20,ar4
ld #50h, a
loop1:
ld #0h, b
stl b,*ar2+
loop2:
add a,b
stl b,*ar2+
banz loop2,*ar4st #20,ar4
banz loop1,*ar3nop
nop
.end

(ii)Triangular
.mmregs
.text
ld #5,a
st #3000h,ar2
st #10,ar3
st #20,ar4
ld #0,b
loop1:
loop2:
stl b,*ar2+
add a,b
banz loop2,*ar4st #20,ar4
loop3:
sub a,b
stl b,*ar2+
banz loop3,*ar4st #20,ar4
banz loop1,*ar3.end

(iii) Square
.mmregs
.text
ld #1000h,a
st #1500h,ar2
st #5,ar3
st #20,ar4
ld #0h,b
loop1:
loop2:
stl a,*ar2+
banz loop2,*ar4st #20,ar4
loop3:
stl b,*ar2+
banz loop3,*ar4st #20,ar4
loop4:
stl a,*ar2+
banz loop4,*ar4st #20,ar4
loop5:
stl b,*ar2+
banz loop5,*ar4st #20,ar4
banz loop1,*ar3.end

(iv)Trapezoidal
.mmregs
.text
st #5000h, ar2
st #5, ar3
st #20,ar4
ld #50h, a
loop1:
ld #0h, b
stl b,*ar2+
loop2:
add a,b
stl b,*ar2+
banz loop2,*ar4st #20,ar4
loop3:
stl b,*ar2+
banz loop3,*ar4st #20,ar4
loop4: sub a,b
stl b,*ar2+
banz loop4,*ar4st #20,ar4
banz loop1,*ar3st #5, ar3
st #50,ar4
ld #200h, a
loop5:
ld #0h, b
stl b,*ar2+
loop6:

add a,b
stl b,*ar2+
banz loop6,*ar4st #50,ar4
loop7: stl b,*ar2+
banz loop7,*ar4st #50,ar4
loop8: sub a,b
stl b,*ar2+
banz loop8,*ar4st #50,ar4
banz loop5,*ar3nop
nop

(v)Sinusoidal
.mmregs
.text
f2
.word 0,8,15,23,29,35,40,44,47,49,50,49,47,44,40,35,29,23,15,8,0,-8,-15,-23,-29,-35,-40,-44,47,-49,-50,-49,-47,-44,-40,-35,-29,-23,-15,-8
LD #F2,A
STL A,AR3
.end

Result:
Hence wrote an assembly language program to generate
i) saw tooth wave,
ii) triangular wave,
iii) square wave,
iv) trapezoidal wave and
iv) sine wave

Experiment 10
DISCRETE FOURIER TRANSFORM (DFT)
Aim:
To obtain 8-point Discrete Fourier Transform (DFT) of the sequence through assembly language
programming using Fast Fourier Transform (FFT-radix2) algorithm.
Objectives:
1. To understand the Bit-reversed addressing technique
2. To write subroutines for two, four and eight point butterfly structure
3. To know the memory requirement for DFT implementation
Algorithm:

Get first two input data values (x0 & x1) of the bit reversed 8 data values
Multiply x1 by the weighing factor W20
Add x0 and x1 to get a0
Subtract x1 W20 from x0 to get a1
Repeat the above steps for the remaining six bit reversed data values as set of two
If the weighting factor contains complex values the butterfly computations should be
done separately for real and imaginary parts.

Get the first four outputs of the two point butterfly a0, a1, a2 and a3
Multiply a2 and a3 by the weighting factors W40 and W41 respectively
Add a0 and a1 with a2W40 and a3W41 respectively to get b0 and b1
Subtract a2W40 and a3W41 from a0 and a1 respectively to get b2 and b3
Repeat the above steps for the remaining four data values obtained from two point butterfly

Get eight outputs of the four point butterfly b0, b1, b2, b3, b4, b5, b6 and b7
Multiply b4, b5, b6 and b7 by the weighting factors W80, W81, W82 and W83
respectively
Add b0, b1, b2 and b3 with b4W80, b5 W81, b6 W82 and b7W83 respectively to get
X0, X1, X2 and X3
Subtract b4W80, b5 W81, b6 W82 and b7W83 from b0, b1, b2 and b3 respectively to get
X4, X5, X6 and X7

Assembly Language Codes and Observations


.mmregs
.text

LOOP1

LOOP2

ST #1000H,AR2
ST #2000H,AR3
ST #3,AR4
ST #2,AR0
ADD *AR2+,B
ADD *AR2+,B
STL B,*AR3+0
LD #0,B
BANZ LOOP1, *AR4ST #1000H,AR2
ST #2001H,AR3
ST #3,AR4
ST #2,AR0
ADD *AR2+,B
SUB *AR2+,B
STL B,*AR3+0
LD #0,B
BANZ LOOP2,*AR4ST #2,AR4
ST #2000H,AR2
ST #3000H,AR3

LOOP3

LOOP4

LOOP5

LOOP6

LD #1,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
BANZ LOOP3,*AR4LD #0,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
ST #2,AR4
LD #1,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
BANZ LOOP4,*AR4LD #0,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
ST #2,AR4
ST #2000H,AR2
ST #3500H,AR3
LD #0,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
BANZ LOOP5,*AR4LD #-1,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
ST #2,AR4
LD #0,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
BANZ LOOP6,*AR4LD #-1,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
ST #3000H,AR6
ST #3002H,AR7
ST #4000H,AR5
ST #1,AR4
ST #2,AR0

LOOP7

LD #0,B
ADD *AR6+,B
ADD *AR7+,B

STL B,*AR5+
BANZ LOOP7,*AR4ST #3000H,AR6
ST #3002H,AR7

LOOP8

ST #1,AR4
ST #2,AR0
LD #0,B
ADD *AR6+,B
SUB *AR7+,B
STL B,*AR5+
BANZ LOOP8,*AR4-

ST #3004H,AR6
ST #3006H,AR7
ST #1,AR4
ST #2,AR0
LOOP9

LD #0,B
ADD *AR6+,B
ADD *AR7+,B
STL B,*AR5+
BANZ LOOP9,*AR4ST #3004H,AR6
ST #3006H,AR7

LOOP10

ST #1,AR4
ST #2,AR0
LD #0,B
ADD *AR6+,B
SUB *AR7+,B
STL B,*AR5+
BANZ LOOP10,*AR4-

ST #3500H,AR6
ST #3502H,AR7
ST #4500H,AR5
ST #1,AR4
ST #2,AR0
LOOP11

LD #0,B
ADD *AR6+,B
ADD *AR7+,B
STL B,*AR5+

BANZ LOOP11,*AR4ST #3500H,AR6


ST #3502H,AR7

LOOP12

ST #1,AR4
ST #2,AR0
LD #0,B
ADD *AR6+,B
SUB *AR7+,B
STL B,*AR5+
BANZ LOOP12,*AR4-

ST #3504H,AR6
ST #3506H,AR7
ST #1,AR4
ST #2,AR0
LOOP13

LD #0,B
ADD *AR6+,B
ADD *AR7+,B
STL B,*AR5+
BANZ LOOP13,*AR4ST #3504H,AR6
ST #3506H,AR7

LOOP14

LOOP15

ST #1,AR4
ST #2,AR0
LD #0,B
ADD *AR6+,B
SUB *AR7+,B
STL B,*AR5+
BANZ LOOP14,*AR4-

ST #4,AR4
ST #4000H,AR2
ST #5000H,AR3
LD #1000,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
BANZ LOOP15,*AR4LD #707,B
STL B,T

MPY *AR2+,A
STL A,*AR3+
LD #0,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
LD #-707,B
STL B,T
MPY *AR2+,A
STL A,*AR3+

LOOP16

LOOP17

LOOP18

ST #4,AR4
ST #4500H,AR2
ST #5500H,AR3
LD #0,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
BANZ LOOP16,*AR4LD #-707,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
LD #-1000,B
STL B,T
MPY *AR2+,A
STL A,*AR3+
LD #-707,B
STL B,T
MPY *AR2+,A
STL A,*AR3+

ST #5000H,AR6
ST #5004H,AR7
ST #6000H,AR5
ST #3,AR4
LD #0,B
ADD *AR6+,B
ADD *AR7+,B
STL B,*AR5+
BANZ LOOP17,*AR4ST #5000H,AR6
ST #5004H,AR7
ST #3,AR4
LD #0,B
ADD *AR6+,B
SUB *AR7+,B
STL B,*AR5+
BANZ LOOP18,*AR4-

LOOP19

LOOP20

ST #5500H,AR6
ST #5504H,AR7
ST #6500H,AR5
ST #3,AR4
LD #0,B
ADD *AR6+,B
ADD *AR7+,B
STL B,*AR5+
BANZ LOOP19,*AR4ST #5500H,AR6
ST #5504H,AR7
ST #3,AR4
LD #0,B
ADD *AR6+,B
SUB *AR7+,B
STL B,*AR5+
BANZ LOOP20,*AR4.end

Input

Output

Result:
Hence obtained a 8-point Discrete Fourier Transform (DFT) of the sequence through assembly language
programming using Fast Fourier Transform (FFT-radix2) algorithm.

S-ar putea să vă placă și