that to see if understood correctly:
- 0 modular 8 always gonna return a remainder of 8, therefore it's always gonna be a multiple of 8
-(*)->
X + Y = multiple of 8
eg. X + Y = {0, 8, 16, 24, ...}
X + Y = 1000(base 2)
Any unsigned binary integer plus its flipped bits will become uhh..full bits (?)
In our case it's 3 bits -> 3 digits -> * * * from 000 to 111
Eg. If X = 001
-> ~X = 110
-> X + ~X
= 001 + 110 = 111 (7 base 10)
which is 1 short of 8,
or 001 short of 1000
-> X + ~X = (0 mod 8) - 1
-> X + ~X + 1 = 0 mod 8 (**)
Since we're looking for
X + Y = 0 mod 8
(**) -> Y = ~X + 1
Correct
Sorry typing on phone I didn't realize it's this long |: But if that correct
Обсуждают сегодня