help with my calculator project


Closed Thread
Results 1 to 2 of 2
  1. #1
    loayaouad's Avatar
    loayaouad Guest

    Default help with my calculator project

    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

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    To determine if the addition has overflowed... If the result is smaller than either of the original numbers, then it overflowed.
    Code:
    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

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts