

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


DASP :: Assignment 2 2008.09.03.W
Page 1 of 2
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.
=
4
0
i
result in y:$200.