Compression Digest
compression/_posts/2015-10-07-logicgate.md
XOR Logic Gate Notes
[Literal] Post summarizes exclusive OR (XOR) for cryptography and parity. [AI Synthesis] Treat XOR as the bridge between bitwise ops and modular arithmetic.
Key points
- [Literal] XOR lets you flip bits with a mask in a reversible operation—useful in cryptography.
- [Literal] p₁ ⊕ p₂ ⊕ … ⊕ pₙ is true when an odd number of inputs are 1 (associative).
- [Literal] XOR equals addition modulo 2; only 1-bits contribute to the sum.
- [Literal] Parity check uses XOR as a checksum to detect flipped bits.
Patterns / reminders
- [AI Synthesis] When you need reversible masking or even/odd detection, reach for XOR before inventing custom logic.
Sources
- (Source: raw/_posts/2015-10-07-logicgate.md)