Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Question] the opposite of AND

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Habufe
Expert Cheater
Reputation: 0

Joined: 03 Sep 2007
Posts: 149
Location: http://www.SaviourFagFails.com/

PostPosted: Tue Oct 28, 2008 11:35 am    Post subject: [Question] the opposite of AND Reply with quote

what is the opposite of the logical AND? like for example, the opposite of or is xor because 10 or 5 = 15, and 15 xor 5 = 10.

i thought about xnor but it replaces all the bytes in the beginning to 1s and it screws up the number.
Back to top
View user's profile Send private message
Goddess
Expert Cheater
Reputation: 0

Joined: 24 Oct 2008
Posts: 194
Location: Kyoto, Japan

PostPosted: Tue Oct 28, 2008 12:35 pm    Post subject: Reply with quote

Correct me if I'm wrong, but if it's the same as electronics it should be "NAND" (Not/And)


Tables:

-KEY-
Code:

A <operator> B | result


Code:

--AND & NAND--
A AND B | C   A NAND B | C
--------|--   ---------|--
0 AND 0 | 0   0 NAND 0 | 1
0 AND 1 | 0   0 NAND 1 | 1
1 AND 0 | 0   1 NAND 0 | 1
1 AND 1 | 1   1 NAND 1 | 0

--OR & NOR--
A OR B | C   A NOR B | C
-------|--   --------|--
0 OR 0 | 0   0 NOR 0 | 1
0 OR 1 | 1   0 NOR 1 | 0
1 OR 0 | 1   1 NOR 0 | 0
1 OR 1 | 1   1 NOR 1 | 0

--XOR & XNOR--
A XOR B | C   A XNOR B | C
--------|--   ---------|--
0 XOR 0 | 0   0 XNOR 0 | 1
0 XOR 1 | 1   0 XNOR 1 | 0
1 XOR 0 | 1   1 XNOR 0 | 0
1 XOR 1 | 0   1 XNOR 1 | 1

-NOT-
A | C
--|--
0 | 1
1 | 0

_________________
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list


Last edited by Goddess on Tue Oct 28, 2008 12:57 pm; edited 2 times in total
Back to top
View user's profile Send private message AIM Address
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Oct 28, 2008 12:41 pm    Post subject: Reply with quote

XOR is not the opposite of OR:
Code:
5 | 6 = 7
6 ^ 7 = 1
5 ^ 7 = 2

Anyway, just NOT the result.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Tue Oct 28, 2008 1:19 pm    Post subject: Reply with quote

Goddess wrote:
Correct me if I'm wrong, but if it's the same as electronics it should be "NAND" (Not/And)


Well yeah, it's only opposite because the NOT gate inverts it.
Back to top
View user's profile Send private message MSN Messenger
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Tue Oct 28, 2008 2:00 pm    Post subject: Reply with quote

Do you want opposite or inverse? The property you were trying to describe between xor and or (which is not actually true) is that of being the inverse function to the other. In fact, xor is the inverse of itself. (A xor B) xor B = A; (A xor B) xor A = B;

Given "f(X) = X xor C", f(f(X)) = X;

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
92Garfield
I'm a spammer
Reputation: 57

Joined: 20 Dec 2007
Posts: 5871
Location: Banana Republic Germany

PostPosted: Tue Oct 28, 2008 3:41 pm    Post subject: Reply with quote

i think opposite of or is not or and opposite of and is not and

1 and 1 = 1
not (1 and 1) = not 1 = 0

1 or 0 = 1
not (1 or 0) = not 1 = 0

btw xor is

A - B - C (a xor b = c)
1 - 1 - 0
1 - 0 - 1
0 - 1 - 1
0 - 0 - 0

they must be different to make xor return 1

_________________
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Tue Oct 28, 2008 3:50 pm    Post subject: Reply with quote

We need to define opposite better to have this discussion. OP seems to be talking about the inverse operation of given logical operations.

If you define opposite to mean flipped bits / opposite logical result, then NOT(f(x)) gives you that by definition.

For OR and AND, there is no inverse function though, because they are not one-to-one in their domains/ranges.

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Thu Oct 30, 2008 6:24 pm    Post subject: Reply with quote

opposite of AND lets see lol..
AND means checking for 2 pairs of data to be equal to something.. im guessing the opposite of it to check for data thats not equal to something? so it's a matter of changing == to != or !data == something.

I don't think a opposite exists but yah people told yah about the NOT command thats how you do it.

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
SXGuy
I post too much
Reputation: 0

Joined: 19 Sep 2006
Posts: 3551

PostPosted: Fri Oct 31, 2008 3:43 am    Post subject: Reply with quote

AND - NAND

OR - NOR

XOR - XNOR
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri Oct 31, 2008 10:32 am    Post subject: Reply with quote

SXGuy wrote:
AND - NAND

OR - NOR

XOR - XNOR


Suppose this is right because of the NOT
Back to top
View user's profile Send private message MSN Messenger
SXGuy
I post too much
Reputation: 0

Joined: 19 Sep 2006
Posts: 3551

PostPosted: Sat Nov 01, 2008 5:30 am    Post subject: Reply with quote

you would have thought they would have named it NXOR tho wouldnt you Razz lol
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites