DSPRelated.com
Forums

some anomolies i found while working on adsp 21061 simulator in visual dsp 3++??

Started by canb...@yahoo.co.in May 21, 2007
r3=r1*r2; supporeted in ADSP 21061 but while checking the results in r3 it is zero whatever the value of r1 and r2 may be..but r3=r1+r2;it works with charms and i can check the value of r3.

mrf=r1*r2;
i always find the result twice of what i am expecting say r1=2,r2=r3 then mrf which is 2*6( 6 is the expected result);
canbruce_contact wrote:
>
> r3=r1*r2; supporeted in ADSP 21061 but
> while checking the results in r3 it is
> zero whatever the value of r1 and r2 may be.

You forgot to specify the data types in the instruction. By default,
the multiplier takes fractional data. You probably want

r3 = r1*r2 (uui);

Regards,
Andor
On Mon, 21 May 2007 c...@yahoo.co.in wrote:

> r3=r1*r2; supporeted in ADSP 21061 but while checking the results in r3
>it is zero whatever the value of r1 and r2 may be..but r3=r1+r2;it works
>with charms and i can check the value of r3.

What is the mode of your multiply? You may need to add things like (SSF)
or (UUI) to ensure signed or unsigned. Note that if you are inputing
integers and you get fractional mode, most of the time you'll get zero for
the result.

> mrf=r1*r2;
> i always find the result twice of what i am expecting say
>r1=2,r2=r3 then mrf which is 2*6( 6 is the expected result);

Sounds like signed fractions then. It's shifting off the extra sign bit
and getting the correct fractional result. You are reading like it's an
integer. Try r3 = r1*r2 (ssi); and see what happens.

Patience, persistence, truth,
Dr. mike