What is XOR operation? XOR is a logical, boolean, operator to let you get ‘1’ if either of values but not both is ‘1’, and ‘1’ is representing a true value. Now imagine XOR in its simplest way like this.
You are in your elementary class. Your teacher are very happy because you can do the question very well. He then asked you “Are you a local student OR international student?”.”I am international student”. Now think, “OR” there is really an “OR”? Guess true, it is not. OR operation let us get ‘1’ if either is ‘1’ and we can’t be international and local student at the same time, do we?
Now don’t ask about the possibility of elementary class that have international student. Yes it is possible 😀 The same story is like: your friend ask you “Hi bro. What city are you born in?” And you said “I was born in Jakarta” and you can’t say “I was born in Jakarta and Tokyo” or “I was born in Jakarta or Tokyo” but you do can “I was born in Jakarta exclusive-or Tokyo”. The last answer supposed to give meaning that you want to sound more smarter than him.
Now compare again to “Hi bro, what did you eat this morning? You smell so bad!”. And you can said “I ate semanggi” or “I ate pizzas and dodotiros” or “I ate pizzas or dodotiros“.
The last answer, yes, if you want to sound smarter.
Now. That is how XOR work. You understand XOR not?