Searching \ for '[PIC] detecting overflow without using 24bits' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'detecting overflow without using 24bits'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] detecting overflow without using 24bits'
2004\09\22@144112 by T C

picon face
I thought I saw an app note/article/design idea/or somethin'
that discussed how to detect if a resulting value
outside -32768 -> 32767
would occur with:

i16_op1 - i16_op2
or
i16_op1 - u16_op2 (u16 might be 0-32767 only)

Trying to avoid using 24 bits.

Anyone see the doc? ... any ideas?
TIA

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\09\22@174153 by Andrew Warren

flavicon
face
T C <spam_OUTpiclistTakeThisOuTspammit.edu> wrote:

> I thought I saw an app note/article/design idea/or somethin'
> that discussed how to detect if a resulting value
> outside -32768 -> 32767
> would occur with:
>
> i16_op1 - i16_op2
> or
> i16_op1 - u16_op2 (u16 might be 0-32767 only)
>
> Trying to avoid using 24 bits.
>
> Anyone see the doc? ... any ideas?

TC:

Overflow only occurs when you add two numbers of the same sign, so if
you're adding a positive number to a negative number, overflow cannot
occur.

When overflow occurs, the sign of the result is different from the
sign of the two inputs: if both inputs are negative and the result is
positive, or if both inputs are positive and the result is negative,
an overflow has occurred.

-Andy

=== Andrew Warren -- .....aiwKILLspamspam@spam@cypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...