Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP

Discussion Groups

Discussion Groups | Analog Devices DSPs | floating point multiplication in ADSP 218x

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

floating point multiplication in ADSP 218x - Sonali Agarwal - Mar 15 0:29:00 2005




Hello,
I have some confusion regarding the
multiplication in ADSP 218x.
For example, i want to multiply 1.5 * 1.5 which should
give 2.25 in assembly language of ADSP 218x.
to represent 1.5 , i use the 2.14 format which gives
it to be 0x6000.
Now when i keep MX0 = 0x6000 and MY0 = 0x6000 and give
MR = MX0 * MY0, the result is
MR2 = 00
MR1 = 4800
MR0 = 0000
Now the problem is how to shift the data to bring it
to the format understandable by the DSP.
Can anybody help me in this regard. I hope i am able
to make my point clear. Or if you can suggest soem
technical material for this.
Thanks,
SOnali

__________________________________





(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: floating point multiplication in ADSP 218x - Mike Rosing - Mar 15 10:04:00 2005

On Tue, 15 Mar 2005, Sonali Agarwal wrote:

> I have some confusion regarding the
> multiplication in ADSP 218x.
> For example, i want to multiply 1.5 * 1.5 which should
> give 2.25 in assembly language of ADSP 218x.
> to represent 1.5 , i use the 2.14 format which gives
> it to be 0x6000.
> Now when i keep MX0 = 0x6000 and MY0 = 0x6000 and give
> MR = MX0 * MY0, the result is
> MR2 = 00
> MR1 = 4800
> MR0 = 0000
> Now the problem is how to shift the data to bring it
> to the format understandable by the DSP.
> Can anybody help me in this regard. I hope i am able
> to make my point clear. Or if you can suggest soem
> technical material for this.

the multiplier is doing things with fractions, and you want a different
representation. 0x6000 = .75 and .75*.75 = 0x4800. Since you want to
scale everything by 2 in each number you want to scale things by 4 in the
final result. So 0x4800 is now in 3.13 format (1 bit sign and 2 bits
before binary point since multiplier takes care of the sign for you).

Patience, persistence, truth,
Dr. mike




(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: floating point multiplication in ADSP 218x - Jaime Andres Aranguren Cardona - Mar 16 14:54:00 2005

Hi,

The 218x has a mode (M_MODE, if recall well) on which
the DSP makes the shift itself, but it only works for
1.15 x 1.15 = 2.30 -> 1.31.

For other formats, you'd heve to do the shift by
yourself, using the barrel shifter. What result do you
expect (expressed in your 2.14 format?)

JaaC

--- Sonali Agarwal <> wrote: > Hello,
> I have some confusion regarding the
> multiplication in ADSP 218x.
> For example, i want to multiply 1.5 * 1.5 which
> should
> give 2.25 in assembly language of ADSP 218x.
> to represent 1.5 , i use the 2.14 format which gives
> it to be 0x6000.
> Now when i keep MX0 = 0x6000 and MY0 = 0x6000 and
> give
> MR = MX0 * MY0, the result is
> MR2 = 00
> MR1 = 4800
> MR0 = 0000
> Now the problem is how to shift the data to bring it
> to the format understandable by the DSP.
> Can anybody help me in this regard. I hope i am able
> to make my point clear. Or if you can suggest soem
> technical material for this.
> Thanks,
> SOnali Jaime Andrés Aranguren Cardona
__________________________________





(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )