XOR Gate: Difference between revisions
Appearance
Lawrziepan (talk | contribs) m Changed timing scenario to correct definition of only one input is on |
m use auto truth table |
||
Line 6: | Line 6: | ||
== Logic == | == Logic == | ||
The XOR gate's output will only be active if '''one''' of its inputs are '''ON'''.{{Truth table | The XOR gate's output will only be active if '''one''' of its inputs are '''ON'''. | ||
{{Truth table auto | |||
|inputs=2 | |||
|outputs=1 | |||
|caption=XOR Gate Truth Table | |||
|expr1=a b ^ | |||
}} | |||
Below are alternative XOR definitions.<br> | Below are alternative XOR definitions.<br> | ||
The XOR gate's output will only be {{on}}: | The XOR gate's output will only be {{on}}: |
Revision as of 12:13, 8 September 2025
![]() 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 basic digital logic component whose output will be ON if only 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.
Logic
The XOR gate's output will only be active if one of its inputs are ON.
Input 1 | Input 2 | Output |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Below are alternative XOR definitions.
The XOR gate's output will only be ON:
- if inputs are not equal.
- Helpful to compare values.
- if number of ON inputs is odd.
- Helpful for XOR's with multiple inputs.
Timing

The XOR gate has a latency of 1 tick, so in the instance when one input is ON, the output will become active 1 tick later. As demonstrated in the example on the right.
Configurability
The XOR gate cannot have its number of inputs changed, but can have its output position flipped by pressing 'F' on it. The bottom XOR gate in the image on the right has had its output flipped.