1

Reason: In an LR35902 (the processor in the Game Boy) assembly program of mine, I'm trying to figure out what bits have changed to 1's when comparing A with B, which would need a bitwise operation that I'm about to ask for.

Question: is there a name for the following bitwise operation?

*-*-*-*
|A|B|O|
*-*-*-*
|0|0|0|
*-*-*-*
|0|1|1|
*-*-*-*
|1|0|0|
*-*-*-*
|1|1|0|
*-*-*-*

A = first input, B = second input and O = output.
0

2 Answers 2

5

Converse nonimplication. It's not very common though.

P.S. you can quickly find common names of binary logic operators here

3

There is no well-known binary operation with that specific map.

What you have described is (NOT A) AND B.

3
  • And the opposite (0 0 = 1, 0 1 = 0, 1 0 = 1, 1 1 = 0), as I discovered by inverting your logic, is A AND (NOT B), AKA a & !b. Isn't binary logic beautiful? ;-) Commented Jul 26, 2016 at 17:40
  • @wolfboyft Except of course, it's A OR (NOT B), since AND changes to OR under negation. (This is also known as converse implication)
    – Ordous
    Commented Jul 26, 2016 at 17:42
  • I would be tempted to call it "0100". :)
    – Vatine
    Commented Jul 27, 2016 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.