please, how to use NOT ( logical negation ) ?


Results 1 to 5 of 5

Thread: please, how to use NOT ( logical negation ) ?

  1. #1
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default please, how to use NOT ( logical negation ) ?

    hello all i tried to use NOT :
    ... "not 1" should return 0, but it returns -2
    ... "not 0" should return 1, but it returns -1
    ... "not 0101" should return 1010, but it returns -102

    it seems that "not" is not acting as a logic function, but more like " not [ n ] = - n - 1 "

    i wish to improve the readability of conditional codes; kindly

    Similar Threads:
    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  2. #2
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: please, how to use NOT ( logical negation ) ?

    hy Roger thank you 4 the fast answer; i needed time to get it

    ... decimal : 0 1 2 3 .. +inf
    ... signed decimal : -inf .. -3 -2 -1 0 1 2 3 .. +inf
    ... binary : 0 1 10 11 ... +inf
    ... but what is signed binary ? for mere mortals, nothing but in electronics, etc, stuff like you described appears

    so the argument and the result of the NOT function ( NOT [ argument ] = result ) is a signed binary ( or how is it called ); also showed in image "a" of my 1st post

    but in image "b", the manuals present the function as being able to handle a logical atribute ( boolean; true/false, etc )

    this is contradictory from manuals, i would say that NOT can return both "signed binary" or "boolean" result; from trials, i can say that NOT returns only "signed binary", while i need "boolean"

    is there a way to shift the way NOT behaves ? who needs "signed binary" when writing programs for a cnc ?

    Code:
        V1 = something binary from somewhere
        V2 = decimal [ 01011110 ]
        if [ [ NOT V1 ] EQ  V2 ] then drill else peck_drill :)
    kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  3. #3
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: please, how to use NOT ( logical negation ) ?

    hey Roger i also believe that most codes are linear, and only a fraction* of programers use conditional/logical statements, etc ...

    they add a bit of versatility ( if needed / when needed ) etc ; kindly

    *fraction = the most important fraction

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

please, how to use NOT ( logical negation ) ?

please, how to use NOT ( logical negation ) ?