MAX MIN vs IF


Closed Thread
Results 1 to 2 of 2

Thread: MAX MIN vs IF

  1. #1

    Default MAX MIN vs IF

    Hi Guys

    I had couple of minutes to investigate the MAX and MIN and ways around them as the syntax seems upside down TO ME. Here is the result.
    I know it isn't much of a difference but why use something that is less clear and less efficient?
    Attached Images Attached Images  

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: MAX MIN vs IF

    Quote Originally Posted by netstranger.nz View Post
    Hi Guys

    as the syntax seems upside down TO ME.?
    Just understand it as MIN or MAX of the two values ...

    BTW ... your use here seems a bit strange ... @ the speed you run Why not make use of a Hardware comparator or an ADC measure ???

    the 1.5v trip limit of the inputs is ... not so precise ( absolute value ) ... especially if some capacitive circuitry around ... added to the high slew-rate of your signals, the result is quite predictable ...

    The difference in time you see is due to the different working values comparing macros ... just have a look to the produced .asm, and you'll understand that ...

    AND .. YES, MIN and MAX commands are slower than IF-THEN ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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