rajhere
Junior Member level 3
![Junior Member level 3](/styles/images/ranks/clevel3.gif)
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.
![](https://obrazki.elektroda.pl/16_1260427929_thumb.jpg)
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.
![](https://obrazki.elektroda.pl/39_1260427953_thumb.jpg)
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
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.
![](https://obrazki.elektroda.pl/16_1260427929_thumb.jpg)
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.
![](https://obrazki.elektroda.pl/39_1260427953_thumb.jpg)
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