XOR Gate: Difference between revisions
m Fix casing |
mNo edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Infobox component|title=XOR Gate|id=MHG.XorGate|caption=XOR gate|configurable=0|io.minInputs=2|io.maxInputs=2|io.outputs=1|io.propagationDelay=1}} | {{Infobox component | ||
|title=XOR Gate | |||
|id=MHG.XorGate | |||
|caption=XOR gate | |||
|configurable=0 | |||
|io.minInputs=2 | |||
|io.maxInputs=2 | |||
|io.outputs=1 | |||
|io.propagationDelay=1 | |||
}} | |||
The '''XOR | 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 | 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}}. | |||
== | {{Truth table auto | ||
| inputs=2 | |||
| outputs=1 | |||
| caption=XOR Gate Truth Table | |||
| expr1=a ^ b | |||
}} | |||
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.<br> | |||
The XOR | 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 [[Circuit Board]] square or on top of a [[Mount]]. | |||
An XOR Gate can be [[Flipping|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". | |||
{{Navbox components}} | |||
[[Category:Vanilla components]] | [[Category:Vanilla components]] | ||
[[Category:Circuitry components]] | [[Category:Circuitry components]] |
Latest revision as of 22:53, 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 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 Circuit 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".