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

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Analog Devices DSPs | Reciprocal function

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

  

Post a new Thread

Reciprocal function - Hari Krishna Vuppaladhadiam - Feb 23 19:22:00 2000

Hi,
Can anyone guide me how to implement reciprocal of a value.

1/x where x is an integer.

Can I use approximation functions?

Hari



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



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

Re: Reciprocal function - Patrick Noffke - Feb 23 20:01:00 2000

The code below was taken from one of the Analog Devices manuals and prettied up
a little. /**************************************************************************
*
* Float_Divide
* Perform a floating point division of two numbers.
*
* Calling Parameters:
* F0 = Numerator,
* F1 = Denominator.
*
* Registers Modified:
* F0, F7, F11, F12.
*
* Return Value:
* F0 = F0/F1.
*
**************************************************************************/
Float_Divide:
F11=2.0;
F7=PASS F0, F12=F1; // Move numerator to F7, denominator to F12.

F0=RECIPS F12; /*Get 4 bit seed R0=1/D*/
F12=F0*F12; /*D' = D*R0*/
F7=F0*F7, F0=F11-F12; /*F0=R1=2-D', F7=N*R0*/
F12=F0*F12; /*F12=D'=D'*R1*/
F7=F0*F7, F0=F11-F12; /*F7=N*R0*R1, F0=R2=2-D'*/
RTS (DB), F12=F0*F12; /*F12=D'=D'*R2*/
F7=F0*F7, F0=F11-F12; /*F7=N*R0*R1*R2, F0=R3=2-D'*/
F0=F0*F7; /*F0=N*R0*R1*R2*R3*/ *************************************************
Patrick Noffke
QTI Color Registration Systems
Sussex, WI
*************************************************
----- Original Message -----
From: "Hari Krishna Vuppaladhadiam" <>
To: <>
Sent: Wednesday, February 23, 2000 1:22 PM
Subject: [adsp] Reciprocal function > Hi,
> Can anyone guide me how to implement reciprocal of a value.
>
> 1/x where x is an integer.
>
> Can I use approximation functions?
>
> Hari



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



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

Re: Reciprocal function - Hari Krishna Vuppaladhadiam - Feb 24 20:00:00 2000

Is there a source on Fixed Point Implementation for 1/x where x is an
integer (16-bit)?

Regards
Hari

-----Original Message-----
From: Patrick Noffke <>
To: <>
Date: Wednesday, February 23, 2000 12:38 PM
Subject: [adsp] Re: Reciprocal function >The code below was taken from one of the Analog Devices manuals and
prettied up
>a little. >/**************************************************************************< br /> >*
>* Float_Divide
>* Perform a floating point division of two numbers.
>*
>* Calling Parameters:
>* F0 = Numerator,
>* F1 = Denominator.
>*
>* Registers Modified:
>* F0, F7, F11, F12.
>*
>* Return Value:
>* F0 = F0/F1.
>*
>**************************************************************************/< br /> >Float_Divide:
> F11=2.0;
> F7=PASS F0, F12=F1; // Move numerator to F7, denominator to F12.
>
> F0=RECIPS F12; /*Get 4 bit seed R0=1/D*/
> F12=F0*F12; /*D' = D*R0*/
> F7=F0*F7, F0=F11-F12; /*F0=R1=2-D', F7=N*R0*/
> F12=F0*F12; /*F12=D'=D'*R1*/
> F7=F0*F7, F0=F11-F12; /*F7=N*R0*R1, F0=R2=2-D'*/
> RTS (DB), F12=F0*F12; /*F12=D'=D'*R2*/
> F7=F0*F7, F0=F11-F12; /*F7=N*R0*R1*R2, F0=R3=2-D'*/
> F0=F0*F7; /*F0=N*R0*R1*R2*R3*/ >*************************************************
>Patrick Noffke
>QTI Color Registration Systems
>Sussex, WI
>*************************************************
>----- Original Message -----
>From: "Hari Krishna Vuppaladhadiam" <>
>To: <>
>Sent: Wednesday, February 23, 2000 1:22 PM
>Subject: [adsp] Reciprocal function >> Hi,
>> Can anyone guide me how to implement reciprocal of a value.
>>
>> 1/x where x is an integer.
>>
>> Can I use approximation functions?
>>
>> Hari
> >
>






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

Re: Reciprocal function - Anoop Kumar - Feb 25 7:02:00 2000

Hi,

If you are using Sharc processor you can use the function

Fn = RECIPS Fx

Floating point representation of input in Fx is needed.
Please refer to Manual of Sharc page B-39 for the description of the
fuction.

Regards,
Anoop
On Wed, 23 Feb 2000, Hari Krishna Vuppaladhadiam wrote:

> Hi,
> Can anyone guide me how to implement reciprocal of a value.
>
> 1/x where x is an integer.
>
> Can I use approximation functions?
>
> Hari >
> ------------------------------------------------------------------------
> To Join: Send an email to
> To Post: Send an email to
> To Leave: Send an email to
> Archives: http://www.egroups.com/group/adsp
> Other Groups: http://www.dsprelated.com
>
> ------------------------------------------------------------------------
> *** Got Questions? Get Answers. Got Answers? Get Paid. ***
> Sign up at Infomarco.com and you can win $30,000 cash or a trip to China.
> http://click.egroups.com/1/1251/3/_/8508/_/951333883/
>
> -- Create a poll/survey for your group!
> -- http://www.egroups.com/vote?listname=adsp&m=1


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



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

Re: Reciprocal function - Per Johan Vannebo - Feb 25 7:55:00 2000

Hi,
 
This code is from the Analog Devices application book:
 
.MODULE Signed_SP_Divide;
 
{
        Signed Single-Precision Divide
 
        Calling Parameters
                 AF = MSW of dividend
                 AY0 = LSW of dividend
                 AX0 = 16-bit divisor
 
        Return Values
                 AY0 = 16-bit result
 
        Altered Registers
                 AY0, AF
 
        Computation Time
                 17 cycles
 
}
 
.ENTRY  sdivs;
 
sdivs:  DIVS AF,AX0;            & nbsp;            &nb sp;  {Compute sign bit}
        DIVQ AX0; DIVQ AX0; DIVQ AX0;           {Compute 15 quotient bits}
        DIVQ AX0; DIVQ AX0; DIVQ AX0;
        DIVQ AX0; DIVQ AX0; DIVQ AX0;
        DIVQ AX0; DIVQ AX0; DIVQ AX0;
        DIVQ AX0; DIVQ AX0; DIVQ AX0;
        RTS;
 
.ENDMOD;
Check out: http://www.analog.com/techsupt/software/dsp/app_note/21xx_book.html
 
Regards,
 
Per Johan
 
 
>Is there a source on Fixed Point Implementation for 1/x where x is an
>integer (16-bit)?

>Regards
>Hari

-----Original Message-----
>From: Patrick Noffke <p...@QTIWORLD.COM>
>To: a...@eGroups.com <a...@eGroups.com>
>Date: Wednesday, February 23, 2000 12:38 PM
>Subject: [adsp] Re: Reciprocal function>The code below was taken from one of the Analog Devices manuals and
prettied up
>a little.>/******************************************************************** ******
>*
>*  Float_Divide
>*     Perform a floating point division of two numbers.
>*
>*  Calling Parameters:
>*     F0 = Numerator,
>*     F1 = Denominator.
>*
>*  Registers Modified:
>*     F0, F7, F11, F12.
>*
>*  Return Value:
>*     F0 = F0/F1.
>*
>************************************************************************** /
>Float_Divide:
>   F11=2.0;
>   F7=PASS F0, F12=F1; // Move numerator to F7, denominator to F12.
>
>   F0=RECIPS F12;           /*Get 4 bit seed R0=1/D*/
> F12=F0*F12;           &nb sp;  /*D' = D*R0*/
> F7=F0*F7, F0=F11-F12;    /*F0=R1=2-D', F7=N*R0*/
> F12=F0*F12;           &nb sp;  /*F12=D'=D'*R1*/
> F7=F0*F7, F0=F11-F12;    /*F7=N*R0*R1, F0=R2=2-D'*/
> RTS (DB), F12=F0*F12;    /*F12=D'=D'*R2*/
> F7=F0*F7, F0=F11-F12;    /*F7=N*R0*R1*R2, F0=R3=2-D'*/
> F0=F0*F7;             ;  /*F0=N*R0*R1*R2*R3*/>*************************************************
>Patrick Noffke
>QTI Color Registration Systems
>Sussex, WI
>*************************************************
>----- Original Message -----
>From: "Hari Krishna Vuppaladhadiam" <h...@chiplogic.com>
>To: <a...@eGroups.com>
>Sent: Wednesday, February 23, 2000 1:22 PM
>Subject: [adsp] Reciprocal function>> Hi,
>>  Can anyone guide me how to implement reciprocal of a value.
>>
>>   1/x where x is an integer.
>>
>> Can I use approximation functions?
>>
>> Hari
>>
>
------------------------------------------------------------------------
To Join:  Send an email to a...@egroups.com
To Post:  Send an email to a...@egroups.com
To Leave: Send an email to a...@egroups.com
Archives: http://www.egroups.com/group/adsp
Other Groups: http://www.dsprelated.com

------------------------------------------------------------------------
-- Check out your group's private Chat room
-- http://www.egroups.com/ChatPage?listName=adsp&m=1
Vennlig hilsen
Per Johan Vannebo
Gemini Communication AS


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



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