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.
Input 1 | Input 2 | Output |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
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 placed 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.
Trivia
- "XOR" is a short form of "Exclusive OR".