So, you are saying that I can just use a flat ADD_24 through byte carries reguard of the fact that one might be positive and one negative; and the result would be the same as, I illustrated before? All of my values will be positive until I try to subtract x1 from x2. This cause it to go to negative. Let me show you what my algorithm looks like in c: What is know is that x1,y1 and x2,y2 will always be positive. Let x1 and y1 be the current position. void MoveTo(x2,y2) { int y1,y2 int deltax =3D x2-x1; int deltay =3D y2-y1; //incredment or decrement direction of motion. bool bIncX,bIncY; if(deltax > 0)bIncX =3D true; else bIncX =3D false; if(deltay > 0)bIncY =3D true; else bIncY =3D false; if(deltax < 0) deltax =3D -deltax; if(deltay < 0) deltay =3D -deltay; int ax =3D << deltax; int ay =3D << deltay; int decx,decy; //Now begin Bresenham Move if(deltay > deltax) { for(decy=3Day-deltax;/**/;decy +=3Day) { if(bIncX) x1++; else x1--; StepXY(x1,y1); if(x1=3D=3Dx2) break; if(decy >=3D 0) { decy -=3D ax; if(bIncY)y1++; else y1--; } } } else { for(decx=3Dax-deltay;/**/;decx +=3Dax) { if(bIncY) y1++; else y1--; StepXY(x1,y1); if(y1=3D=3Dy2) break; if(decx >=3D 0) { decx -=3D ay; if(bIncY)x1++; else x1--; } } } -----Original Message----- From: Bob Ammerman [mailto:RAMMERMAN@PRODIGY.NET] Sent: Sunday, April 01, 2001 7:37 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]:How to do 24bit Signed Addition/Substration Fixed point. Your problem is that you are using a sign+magnitude representation for the numbers. Nearly all modern computers use a twos-complement notation for integers. Twos-complement has the advantage that you can ignore the signs of the numbers and just treat them as positive. (as long as you don't overflow the range of representable values). (tho' sign+magnitude+exponent is the method of choice for floating point) Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu