Logical XOR
Logical XOR is a binary operation that produces true when exactly one operand is true and false when both operands have the same truth value.
Math and Architectures of Deep Learning
A Boolean operation that outputs true when exactly one of its two binary inputs is true.
- How it is used
- Uses XOR to express exclusive conditions and motivate multilayer perceptrons beyond single-perceptron linear boundaries.
- How deep it goes
- Explains truth assignments, geometric nonseparability, and an MLP decomposition into complemented conjunctions, stopping short of learned parameter values.
- Examples
- Uses a rock-music friendship rule, four binary input points, a truth table, and a two-layer perceptron construction.
- What you can do after
- Build it from scratch by expressing XOR as two conjunction terms and combining their perceptron outputs in an MLP.
Read how Math and Architectures of Deep Learning explains logical XOR →
The Well-Grounded Rubyist, Fourth Edition
Bitwise XOR is a binary operation that produces 1 where exactly one corresponding input bit is 1 and produces 0 where both corresponding input bits are equal.
- How it is used
- Applies bitwise XOR to string bytes and demonstrates reversible obfuscation with a repeating key.
- How deep it goes
- Explains bit-level behavior, a numeric calculation, reversibility, and Ruby implementation with cycling keys.
- Examples
- Uses 97 ^ 35, a repeating-key string obfuscation example, and a reversible Ruby String#^ method.
- What you can do after
- Apply via Ruby to XOR string bytes with a repeating key and recover the original by repeating the operation.
Read how The Well-Grounded Rubyist, Fourth Edition explains logical XOR →
Classic Computer Science Problems in Swift: Essential techniques for practicing programmers
The exclusive-or operation that returns true for exactly one true operand and false when both operands have the same truth value.
- How it is used
- Uses XOR to combine original bytes with dummy data and reconstruct the original through one-time pad encryption.
- How deep it goes
- Defines Boolean and bitwise behavior, demonstrates reversibility, and applies it in Swift encryption functions.
- Examples
- Demonstrates random OTP keys, encryptOTP(), decryptOTP(), and encrypting “¡Vamos Swift!” as byte sequences.
- What you can do after
- Apply XOR through Swift’s ^ operator to combine and reverse byte sequences in a one-time pad implementation.
Related concepts
- boolean operationkind of · A Boolean operation combines or transforms truth-valued inputs according to logical rules to produce a truth-valued result.
- CNOT gateimplemented by · A CNOT gate is a two-qubit controlled-NOT gate that flips a target qubit when its control qubit is one.
- conditional logicequivalent to · Conditional logic is a programming technique that selects execution paths, actions, or result values according to evaluated conditions.
- perceptroncontrasts with · A perceptron is a single-layer computational model and linear classifier that combines weighted inputs with a bias and applies a threshold or activation rule.
- one-time padused by · A one-time pad is a symmetric encryption technique that combines plaintext with a truly random, equally long secret key that is never reused.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


