Integer Math Tips


Results 1 to 8 of 8

Threaded View

  1. #5
    Join Date
    Jul 2010
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    Bear with me, I am a beginner

    I have read the DIV32 entry from the manual, that's how I learned about DIV32 in the first place. It says it can divide a 31bit number by a 15bit number, that means I could make the numerator very large, but he problem is that since the value of Vout (the denominator) can be as low as 1, then the result would not fit into a WORD variable. Therefore the maximum value for the numerator has to be 65535, which is what I got in my example. (well 65535 is technically 1024*64, but you get the point)

    Vin = 1023 * 64
    temp = Div32 Vout

    Maybe you mean something I am not seeing, if so please let me know, I am new to this stuff.

    Also I am not sure what you mean about my measuring method? All I want is to compute the unknown resistance from a voltage divider. But that should be irrelevant, shouldn't it? I mean, the problem here is just an integer arithmetic one.

    I appreciate your help guys.
    Last edited by dream-; - 26th August 2010 at 17:34.

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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