Docsity

Assignment 2 Questions - Electrical Engineering | ELE 591, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
DASP :: Assignment 2 2008.09.03.W
Page 1 of 2
ELE 591/CIS 500 :: Digital Audio Signal Processing :: Assignment 2
OBJECTIVE: Get familiar with assembly and the simulator
Total Points = 60
Due date: 16 Sep 2008 at the start of class OR before
Any form of plagiarism will have serious consequences.
Q1 [6 pts]
[a] How does the DSP represent the integer value -1?
[b] How does it represent the fractional value -1.0?
Q2 [12 pts]
Consider the code shown below to multiply two numbers [file Asn2_Q2.asm on the class web site]:
pXNumbers equ $100
pYFractionalResult equ $200
pYIntegerResult equ pYFractionalResult+1
pProgramBase equ $300
section ASN2_Q2
org x:pXNumbers
dc 3,5
org p:pProgramBase
move #>pXNumbers,r0
move x:(r0)+,x0
move x:(r0),y0
mpy x0,y0,a
endsec
end
[a] Is the result in the 56-bit accumulator A what you expect it to be? Can you explain the result?
[b] What code would you insert after the MPY operation to put the fractional result of the computation in
y:pYFractionalResult?
[c] What code would you insert after the MPY operation to put the integer result of the computation in
y:pYIntegerResult?
pf2

Partial preview of the text

Download Assignment 2 Questions - Electrical Engineering | ELE 591 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

DASP :: Assignment 2 2008.09.03.W

Page 1 of 2

ELE 591/CIS 500 :: Digital Audio Signal Processing :: Assignment 2

OBJECTIVE: Get familiar with assembly and the simulator

Total Points = 60

Due date: 16 Sep 2008 at the start of class OR before

Any form of plagiarism will have serious consequences.

Q1 [6 pts] [a] How does the DSP represent the integer value -1? [b] How does it represent the fractional value -1.0?

Q2 [12 pts] Consider the code shown below to multiply two numbers [file Asn2_Q2.asm on the class web site]:

pXNumbers equ $ pYFractionalResult equ $ pYIntegerResult equ pYFractionalResult+ pProgramBase equ $

section ASN2_Q org x:pXNumbers dc 3,

org p:pProgramBase move #>pXNumbers,r move x:(r0)+,x move x:(r0),y mpy x0,y0,a

endsec end

[a] Is the result in the 56-bit accumulator A what you expect it to be? Can you explain the result?

[b] What code would you insert after the MPY operation to put the fractional result of the computation in y:pYFractionalResult? [c] What code would you insert after the MPY operation to put the integer result of the computation in

y:pYIntegerResult?

DASP :: Assignment 2 2008.09.03.W

Page 2 of 2

Q3 [10 pts] Consider the code shown below that uses the increment and decrement instructions [file Asn2_Q3.asm on the class web site]:

pXNumbers equ $ pYResultA equ $ pYResultB equ pYResultA+ pProgramBase equ $

section ASN2_Q org x:pXNumbers dc 3,

org p:pProgramBase move #>pXNumbers,r move #>pYResultA,r move x:(r0)+,a move x:(r0),b inc a inc a dec b dec b move a,y:(r1)+ move b,y:(r1)

endsec end

[a] Are the results in y:pYResultA and y:pYResultB what you expect them to be? Can you explain how INC and DEC work?

Q4 [16 pts] Write DSP assembly code to take the integer value 3 and the integer value 5 and perform the division operation 3 / 5. Put the result in y:$200? Please verify that you have the correct answer by using the simulator.

Q5 [16 pts] Consider the two arrays shown below:

Array X Array Y X[0] = 0.01 Y[0] = 0. X[1] = 0.02 Y[1] = 0. X[2] = 0.03 Y[2] = 0. X[3] = 0.04 Y[3] = 0. X[4] = 0.05 Y[4] = 0.

Write DSP assembly code, using pointers, to create the sum of products โˆ‘

=

4

0

[] [ ]

i

X iY i and put the

result in y:$200.