Logic circuits

When is the output of a two-input XOR (exclusive OR) gate 1?

  1. AWhen both inputs are 1
  2. BWhen the two inputs are different
  3. CWhen both inputs are 0
Show answer and explanation

Answer: B. When the two inputs are different

XOR outputs 1 when its two inputs differ and 0 when they match: A⊕B = A·¬B + ¬A·B. It can also be seen as "invert the other input if one input is 1, pass it unchanged if 0," making it a controlled inverter. It computes the sum in a half adder and is used in comparators (equality detection with XNOR), parity generation, stream ciphers and CRC calculation.