Introduction to DLD

XOR Gate Truth Table for 2, 3, 4, 5 Inputs

An XOR gate is a digital logic gate that provides the output HIGH (1) when an odd number of inputs are HIGH (1). The output will be LOW (0) when an even number of inputs are HIGH (1).

A suitable heading would be ## XOR Gate Output Rule. You can place this section near the beginning, before the truth tables:

XOR Gate Output Rule

The output of an XOR gate depends on whether the number of HIGH (1) inputs is odd or even:

  • Odd number of 1s → Output = 1 (HIGH)
  • Even number of 1s → Output = 0 (LOW)
For example, with 3 inputs:

  • 1 one → Output = 1
  • 2 ones → Output = 0
  • 3 ones → Output = 1
  • 0 ones → Output = 0

Truth Tables of XOR Gate for Various Inputs

The following table shows the number of input combinations and the output behavior of XOR gates with different numbers of inputs:

XOR Gate Number of Inputs Possible Combinations
2-Input XOR 2 4
3-Input XOR 3 8
4-Input XOR 4 16
5-Input XOR 5 32

Let’s explain the truth tables of XOR gates with different numbers of inputs.

XOR Gate Truth Table for 2 Inputs

The following diagram shows the XOR Gate Truth Table for 2 Inputs.

 

Let’s explain the truth table of a 2-input XOR logic gate.

  • A = 0, B = 0: Both inputs are LOW, so the output is 0 (LOW).
  • A = 0, B = 1: Only input B is HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0: Only input A is HIGH, so the output is 1 (HIGH).
  • A = 1, B = 1: Both inputs are HIGH, so the output is 0 (LOW).

XOR Gate Truth Table for 3 Inputs

The following diagram shows the XOR Gate Truth Table for 3 Inputs.

 

Let’s explain the truth table of a 3-input XOR logic gate.

  • A = 0, B = 0, C = 0: No input is HIGH, so the output is 0 (LOW).
  • A = 0, B = 0, C = 1: Only input C is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 0: Only input B is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 0, C = 0: Only input A is HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0, C = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 1: All three inputs are HIGH, so the output is 1 (HIGH).

XOR Gate Truth Table for 4 Inputs

The following diagram shows the XOR Gate Truth Table for 4 Inputs.

 

Let’s explain the truth table of a 4-input XOR logic gate.

  • A = 0, B = 0, C = 0, D = 0: No input is HIGH, so the output is 0 (LOW).
  • A = 0, B = 0, C = 0, D = 1: One input is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 0, C = 1, D = 0: One input is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 0, C = 1, D = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 1, C = 0, D = 0: One input is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 0, D = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 1, C = 1, D = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 1, C = 1, D = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0, C = 0, D = 0: One input is HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0, C = 0, D = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 0, C = 1, D = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 0, C = 1, D = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 1, C = 0, D = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 0, D = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 1, C = 1, D = 0: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 1, C = 1, D = 1: Four inputs are HIGH, so the output is 0 (LOW).

XOR Gate Truth Table for 5 Inputs

The following diagram shows the XOR Gate Truth Table for 5 Inputs.

 

Let’s explain the truth table of a 5-input XOR logic gate.

  • A = 0, B = 0, C = 0, D = 0, E = 0: No input is HIGH, so the output is 0 (LOW).
  • A = 0, B = 0, C = 0, D = 0, E = 1: One input is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 0, C = 0, D = 1, E = 0: One input is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 0, C = 0, D = 1, E = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 0, C = 1, D = 0, E = 0: One input is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 0, C = 1, D = 0, E = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 0, C = 1, D = 1, E = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 0, C = 1, D = 1, E = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 0, D = 0, E = 0: One input is HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 0, D = 0, E = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 1, C = 0, D = 1, E = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 1, C = 0, D = 1, E = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 1, D = 0, E = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 0, B = 1, C = 1, D = 0, E = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 1, D = 1, E = 0: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 0, B = 1, C = 1, D = 1, E = 1: Four inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 0, C = 0, D = 0, E = 0: One input is HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0, C = 0, D = 0, E = 1: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 0, C = 0, D = 1, E = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 0, C = 0, D = 1, E = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0, C = 1, D = 0, E = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 0, C = 1, D = 0, E = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0, C = 1, D = 1, E = 0: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 0, C = 1, D = 1, E = 1: Four inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 0, D = 0, E = 0: Two inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 0, D = 0, E = 1: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 1, C = 0, D = 1, E = 0: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 1, C = 0, D = 1, E = 1: Four inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 1, D = 0, E = 0: Three inputs are HIGH, so the output is 1 (HIGH).
  • A = 1, B = 1, C = 1, D = 0, E = 1: Four inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 1, D = 1, E = 0: Four inputs are HIGH, so the output is 0 (LOW).
  • A = 1, B = 1, C = 1, D = 1, E = 1: All five inputs are HIGH, so the output is 1 (HIGH).