XOR Gate & XNOR Gates: Truth Table, Boolean Expression

An exclusive-OR (XOR) gate is a digital logic gate that produces a true output (1) when exactly one of its inputs is true, and a false output (0) when both inputs are true or both inputs are false.

Truth Table

The following table shows the truth table for an XOR gate:

Input 1Input 2Output
000
011
101
110

Symbol

The following is the symbol for an XOR gate:

XOR Gate
XOR Gate

Boolean Expression

The Boolean expression for an XOR gate is as follows:

A ⊕ B = (A + B) ⋅ (A' + B')

where:

  • A and B are the inputs to the XOR gate
  • A’ and B’ are the complements of A and B, respectively
  • The symbol ⊕ represents the XOR operation

Applications

XOR gates are used in a variety of digital circuits, including:

  • Adders and subtractors
  • Comparators
  • Parity generators and checkers
  • Encoders and decoders

XNOR Gate

An exclusive-NOR (XNOR) gate is a digital logic gate that produces a true output (1) when both of its inputs are true or both of its inputs are false, and a false output (0) when exactly one of its inputs is true.

Truth Table

The following table shows the truth table for an XNOR gate:

Input 1Input 2Output
001
010
100
111

Symbol

The following is the symbol for an XNOR gate:

XNOR Gate
XNOR Gate

Boolean Expression

The Boolean expression for an XNOR gate is as follows:

A ≢ B = (A + B)'

where:

  • A and B are the inputs to the XNOR gate
  • The symbol ≢ represents the XNOR operation

Applications

XNOR gates are used in a variety of digital circuits, including:

  • Parity generators and checkers
  • Encoders and decoders
  • Code converters
  • Arithmetic circuits

Example

One common example of the use of XOR and XNOR gates is in parity generators and checkers. Parity generators are used to add a parity bit to a digital signal to detect errors. Parity checkers are used to check the parity bit of a digital signal to detect errors.

The following is a diagram of a parity generator circuit:

The parity generator circuit has three inputs, A, B, and C, and one output, Parity. The Parity output is a 1 if the number of 1s in the inputs is even, and a 0 if the number of 1s in the inputs is odd.

The XOR gates in the parity generator circuit are used to calculate the Parity output. The Parity output is equal to a 1 if any of the inputs are equal to 1, and 0 otherwise.

Leave a Comment