Jump to content

XOR Gate

From Logic World Wiki
Revision as of 22:45, 8 September 2025 by Jimmy (talk | contribs) (Overhaul to new standard component page format)
XOR Gate

XOR gate
Component info
Internal ID MHG.XorGate
Configurable No
Input and output
Input count 2
Output count 1
Propagation delay 1 tick

The XOR Gate is a component used for digital logic. Its output will be ON if exactly one of its inputs are ON.

An XOR Gate is 2 tiles wide and 1 tile tall, and its body is 1 tile long, but its inputs and outputs extend its area to 3 tiles.

Behavior

The XOR Gate's output will be ON if and only if exactly one of its inputs are ON.

XOR Gate Truth Table
Input 1Input 2Output
000
011
101
110

There are a few ways to think about this behavior. Using different approaches can help you see more situations where XOR is useful.Below are alternative XOR definitions.
The XOR Gate's output will only be ON:

  • if exactly one of its inputs are ON.
  • if the inputs are not equal.
  • if the number of inputs in the ON state is odd.

The XOR Gate takes one tick to update the state of its output after a change to the state of its inputs.

Placement

XOR Gates have two attachment points, one for each square covered by the body of the component. These attachment points can be in the center of a board square or on top of a Mount.

An XOR Gate can be flipped upside down. This moves its output to the other side, which is useful when you are space-constrained or when building mirrored circuitry.


TODO: image of different ways XOR Gates can be placed

Trivia

  • "XOR" is a short form of "Exclusive OR".