PDA

View Full Version : help with my calculator project



loayaouad
- 15th May 2005, 21:43
I am currently working on a calculator project using the PIC16F84 and I need help with the overflow error detection when adding two 16 bit numbers

Also I am facing problems with the multiplying of two 16 bit numbers

Darrel Taylor
- 17th May 2005, 07:42
To determine if the addition has overflowed... If the result is smaller than either of the original numbers, then it overflowed.
V1 VAR WORD
V2 VAR WORD
Result VAR WORD

Result = V1 + V2
if Result < V1 then OverFlowed

What problem are you having with Multiplying???

Darrel