LMD Async Tutoring

I got xor above: (x + y) mod 2.

Okay. Another remainder one. I can try.

So 1 mod x checks if x is greater than 1. In this configuration it functions as a ‘greater than’ comparator that outputs 0 or 1.

In my solution for xor, x mod 2 functions as an even number checker, checking if x is even.

or(x, y): (x + y + xy) mod 2

1, 1: (1 + 1 + (1 * 1)) mod 2 = 1
1, 0: (1 + 0 + (1 * 0)) mod 2 = 1
0, 1: (0 + 1 + (0 * 1)) mod 2 = 1
0, 0: (0 + 0 + (0 * 0)) mod 2 = 0

This is like the remainder xor expression, but it makes the case where both inputs are 1 sum to an odd number by adding xy (which equals 1 only when the inputs are both 1)