Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Pls HelP Me.. ADSP 2181 Processor Arith Operation Query

Status
Not open for further replies.

rajhere

Junior Member level 3
Junior Member level 3
Joined
Sep 18, 2006
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,513
Hi all
I am working with ADSP2181 processor. Here I am doing the subtraction of two 32bit values.

Method 1:

I have two inputs. Each is 32bits. Now I will subtract lsw1-lsw2 and msw1-msw2. Status of the arithmetic will be stored automatically in ASTAT register. Output of this 32bit subtraction will feed to the PID controller block which is again implemented in 32bit. The output is stored in a buffer1 as shown in figure 1 which is not the expected result.



Figure 1



Method 2:

Now the same two 32bit input i will take and subtract as shown in Figure 2. The result obtained from this again i will subtract with ZERO (32bit) and feed to the PID controller block (32bit). The output is stored in the buffer2 as shown in the figure 2 which I got the result is expected one.



Figure 2
Now the result of Buffer1 and Buffer2 are not same. The result obtained in the Buffer2 is expected one.
Please help me how I can take care the status of ASTAT register when I am doing the 32bit subtraction, so that I will get the expected result.



Thanks
regards
rajhere
 

In the following an example of 32 bit subtraction in ADSP 2181

// 32 bit subtraction [Mx0, AR] = [AY1, AX0] - [MR1,AY0]
DIS AR_SAT;
AR = AX0 - AY0, AX0 = AY1; // subtract LSBs
AY0 = MR1;
MX0 = AR; //move in MX0 the MSBs
AR = AX0 - AY0 + C - 1; // here is the LSBs

Hope will help you.
Regards
Mowgli
 

    rajhere

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top