Minecraft Wiki
mAucun résumé des modifications
(Suppression des liens rouges en anglais)
 
(10 versions intermédiaires par 6 utilisateurs non affichées)
Ligne 2 : Ligne 2 :
 
{{Autre|les circuits de redstone|les autres utilisations de la redstone|redstone}}
 
{{Autre|les circuits de redstone|les autres utilisations de la redstone|redstone}}
   
  +
Un circuit logique (ou porte logique) est un circuit qui fonctionne avec des ''états logiques''. C'est à dire que les ''entrées'' et les ''sortie'' du système ne peuvent prendre que deux valeurs possible : ''vrai'', ''alimenté'' et ''1'', pour le premier état ou bien ''faux'', ''éteint'' et ''0'' pour le second. Dans la suite de la page, nous utiliseront les termes ''alimenté'' et ''éteint''.
A logic gate can be thought of as a simple device that will return a number of ''outputs'', determined by the pattern of ''inputs and rules'' that the logic gate follows. For example, if both inputs in an [[#AND Gate (∧)|AND]] gate are in the 'true'/'on'/'powered'/'1' state, then the gate will return 'true'/'on'/'powered'/'1'.
 
   
  +
Les portes logiques, qui suivent, sont dite combinatoire. En d'autres termes, chaque porte suit une ''règle'' et toutes ses ''sorties'' peuvent être déterminées en fonction de cette ''règle'' et de ses ''entrées''. Par exemple si les deux ''entrées'' d'une porte ET sont ''alimentées'' alors la ''sortie'' est alimentée''.
There are many different kinds of logic gate, each of which can be implemented with many different designs. Each design has various advantages and disadvantages, such as size, complexity, speed, maintenance overhead, or cost. The various sections will give many different designs for each gate type.
 
  +
  +
Il existe plusieurs types de ''portes logiques'', chacune pouvant être créer avec différents designs. Chaque design a ses avantages et ses inconvénients comme la taille, la complexité, la vitesse, ou encore le coût. Les sections qui suivent fournissent plusieurs designs pour chaque type de ''porte logique''.
   
 
== Concepts ==
 
== Concepts ==
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
|+ Logic Gate Outputs<br>
+
|+ Sorties des portes logiques<br />
<span style="font-weight: normal;">Shows the output (red) of each gate, for each combination of inputs A and B (green).</span>
+
<span style="font-weight: normal;">Montre les sorties, en rouge, de chaque porte, pour chaque combinaison des entrées, en vert.</span>
 
! A
 
! A
! {{tc|in!}} !! {{tc|in!}} !! {{tc|in}} !! {{tc|in}}
+
! {{ct|entrée !}} !! {{ct|entrée !}} !! {{ct|entrée}} !! {{ct|entrée}}
 
! rowspan="2" | Question Answered
 
! rowspan="2" | Question Answered
 
|-
 
|-
 
! B
 
! B
! {{tc|in!}} !! {{tc|in}} !! {{tc|in!}} !! {{tc|in}}
+
! {{ct|entrée !}} !! {{ct|entrée}} !! {{ct|entrée !}} !! {{ct|entrée}}
 
|-
 
|-
  +
| NON A
| [[#NOT Gate|NOT A]]
 
| {{tc|out}} || {{tc|out}} || {{tc|out!}} || {{tc|out!}}
+
| {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie !}} || {{ct|sortie !}}
| style="text-align: left;" | Is A off?
+
| style="text-align: left;" | A est ''éteint''?
 
|-
 
|-
| [[#OR Gate|A OR B]]
+
| A OU B
| {{tc|out!}} || {{tc|out!}} || {{tc|out!}} || {{tc|out}}
+
| {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie}}
| style="text-align: left;" | Is either input on?
+
| style="text-align: left;" | Il y a t-il au moins une entrée ''alimentée''?
 
|-
 
|-
| [[#NOR Gate|A NOR B]]
+
| A NON OU B
| {{tc|out}} || {{tc|out}} || {{tc|out}} || {{tc|out!}}
+
| {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie !}}
| style="text-align: left;" | Are both inputs off?
+
| style="text-align: left;" | Les entrées sont elles toutes les deux ''éteintes''?
 
|-
 
|-
| [[#AND Gate|A AND B]]
+
| A ET B
| {{tc|out!}} || {{tc|out}} || {{tc|out}} || {{tc|out}}
+
| {{ct|sortie !}} || {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie}}
| style="text-align: left;" | Are both inputs on?
+
| style="text-align: left;" | Les entrées sont elles toutes les deux ''alimentées''?
 
|-
 
|-
| [[#NAND Gate|A NAND B]]
+
| A NON ET B
| {{tc|out}} || {{tc|out!}} || {{tc|out!}} || {{tc|out!}}
+
| {{ct|sortie}} || {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie !}}
| style="text-align: left;" | Is either input off?
+
| style="text-align: left;" | Il y a t-il au moins une entrée ''éteinte''?
 
|-
 
|-
| [[#XOR Gate|A XOR B]]
+
| A XOR B
| {{tc|out}} || {{tc|out!}} || {{tc|out!}} || {{tc|out}}
+
| {{ct|sortie}} || {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie}}
| style="text-align: left;" | Are the inputs different?
+
| style="text-align: left;" | Les entrées sont elles différentes?
 
|-
 
|-
| [[#XNOR Gate|A XNOR B]]
+
| A XNOR B
| {{tc|out!}} || {{tc|out}} || {{tc|out}} || {{tc|out!}}
+
| {{ct|sortie !}} || {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie !}}
| style="text-align: left;" | Are the inputs the same?
+
| style="text-align: left;" | Les entrées sont elles identiques?
 
|-
 
|-
  +
| A IMPLIQUE B
| [[#IMPLIES Gate|A IMPLIES B]]
 
| {{tc|out!}} || {{tc|out}} || {{tc|out!}} || {{tc|out!}}
+
| {{ct|sortie !}} || {{ct|sortie}} || {{ct|sortie !}} || {{ct|sortie !}}
| style="text-align: left;" | If A is on, is B also on?
+
| style="text-align: left;" | si A est ''alimenté'', B l'est il également ?
 
|}
 
|}
   
The output of each logic circuit reflects the state of its inputs at all times (though possibly with some delay incurred by the circuit).
+
La sortie de chaque circuit logique reflète l'état de ces entrées à tous moments (Bien que du délai puisse apparaître du aux éléments du circuit).
   
  +
;Permuter les entrées
;Swapping inputs
 
   
  +
:Les entrées A et B de toutes les portes peuvent être permutées sans modifier la sortie. Mise à part pour la porte IMPLIQUE et la porte NON qui n'a qu'une seule entrée.
:For most of these gates, you can swap A and B without changing the output.
 
   
  +
;Multiplier les entrées
:Swapping the inputs of the IMPLIES gate ''will'' affect its output, and the NOT gate has only one input.
 
   
  +
:Les portes ET, OU et XOR peuvent être assemblées afin de réaliser leurs opérations avec plus de deux entrées. En combinant un résultat d'une première avec une nouvelle entrée. Pour ces trois portes, l'ordre des entrées n'a pas d'importance. A noter que lorsqu'une porte XOR est assemblée de cette manière, sa sortie sera ''alimentée'' lorsque le nombre d'entrée ''alimenté'' est impair.
;Stacking inputs
 
   
  +
;Comment choisir une porte logique ?
:The AND, OR, and XOR gates can each be used in arrays to perform their operation on more than two inputs, by combining two inputs at a time, then combining the results with each other and/or other inputs. For these gates, the order in which the inputs are combined doesn't matter.
 
   
  +
:Lorsque vous n'êtes pas sur de la porte logique à utiliser, essayez de construire un tableau comme celui de droite avec une seule ligne de sorties. Ajoutez y les entrées connues ainsi que les différents niveaux logiques (''alimenté'' et ''éteint'') qu'elles peuvent prendre. Pour chaque combinaison écrivez la valeur de la sortie souhaitée. Enfin comparez votre tableau avec celui de droite afin de trouver quelle porte correspond avec les sorties souhaitées.
:When an XOR gate is combined in this way, its output is on when an ''odd'' number of inputs is on.
 
   
  +
:Si la sortie dois changer alors que les entrées sont stables, ou bien doit être mémorisée alors vous devriez regarder Générateur de pulsations ou Circuit de mémoire.
;Choosing a logic gate
 
 
:When unsure which logic gate to use, try building a table like the one on the right but with just one row of outputs. List the known inputs coming in and the possible combinations of power, and for each combination write down what the output should be for the structure to work. Then compare that to the table on the right and see which gate matches the desired outputs.
 
 
:If the the output needs to change when the input is stable, or needs to be remembered after the input has ended, you may also need to look at [[pulse circuit]]s or [[memory circuit]]s.
 
 
{{-}}
 
{{-}}
   
== Logic gate ==
+
== Porte logique ==
   
A '''logic gate''' is a basic logic circuit.
+
Une '''porte logique''' est un circuit logique basique.
   
=== NOT Gate ===
+
=== Porte NON ===
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ NOT Gate Outputs
 
|+ NOT Gate Outputs
! A || {{tc|in!}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| NOT A || {{tc|out}} || {{tc|out!}}
+
| NOT A || {{ct|sortie}} || {{ct|sortie !}}
 
|}
 
|}
  +
Une '''porte NON''' (ou "inverseur") renvoie un courant alimenté si le courant d'entrée est éteint ou un courant éteint si le courant d'entrée est alimenté.
A '''NOT Gate''' (aka "inverter") turns on if its input is off.
 
   
  +
;Inverseur à torche
;Torch Inverter
 
   
:: ''1-wide, flat (horizontal only), silent, tileable''
+
:: ''1-largeur, plat (horizontal seulement), silencieux, tileable''
:: ''circuit delay: 1 tick''
+
:: ''délai du circuit: 1 tick''
   
  +
: L'inverseur à torche est la porte NON la plus utilisée, en raison de sa petite taille.
: The torch inverter is the most commonly used NOT gate, due to it small size, versatility, and easy construction.
 
   
 
: One drawback of the torch inverter is that it will "burn out" if run on a clock cycle faster than a 3-clock (3 ticks on, 3 ticks off). A burnt out torch inverter will turn back on after a random time, which may produce undesired pulses in a circuit.
 
: One drawback of the torch inverter is that it will "burn out" if run on a clock cycle faster than a 3-clock (3 ticks on, 3 ticks off). A burnt out torch inverter will turn back on after a random time, which may produce undesired pulses in a circuit.
Ligne 133 : Ligne 131 :
 
}}
 
}}
   
=== OR Gate ===
+
=== Porte OU ===
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ OR Gate Outputs
 
|+ OR Gate Outputs
! A || {{tc|in!}} || {{tc|in!}} || {{tc|in}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée}}
 
|-
 
|-
! B || {{tc|in!}} || {{tc|in}} || {{tc|in!}} || {{tc|in}}
+
! B || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| A OR B || {{tc|out!}} || {{tc|out!}} || {{tc|out!}} || {{tc|out}}
+
| A OR B || {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie}}
 
|}
 
|}
   
A device where the output is on when at least one of the inputs are on. Note that since the OR operation is associative and commutative, OR gates can be combined freely: You can compare huge numbers of inputs by using small OR gates to collect groups of inputs, then comparing their results with more OR gates. The result will not depend on the arrangement of the inputs, or on which ones were combined first.
+
A device where the output is on when at least one of the inputs are on. Note that since the OR operation is associative and commutative, OR gates can be combined freely: You can compare huge numbers of inputs by using small OR gates to collect groups of inputs, then comparing their results with more OR gates. The result will not depend on the arrangement of the inputs, or on which ones were combined first.
   
The simplest version of the OR gate is design '''A''': merely a wire connecting all inputs and outputs. However, this causes the inputs to become "compromised", so that they can only be used in this OR gate. The introduction's example, using a solid block instead of wire, does not suffer the same hazard.
+
The simplest version of the OR gate is design '''A''': merely a wire connecting all inputs and outputs. However, this causes the inputs to become "compromised", so that they can only be used in this OR gate. The introduction's example, using a solid block instead of wire, does not suffer the same hazard.
   
If you need to use the inputs elsewhere, the inputs need to be "isolated", by passing them through a block as above, or a device such as a torch or repeater. Torches yield version '''B'''. Note that this is in fact a NOR gate with an inverter on the output.
+
If you need to use the inputs elsewhere, the inputs need to be "isolated", by passing them through a block as above, or a device such as a torch or repeater. Torches yield version '''B'''. Note that this is in fact a NOR gate with an inverter on the output.
   
Version '''C''' isolates the inputs with repeaters. It can be expanded horizontally up to 15 inputs. Besides the isolated inputs, it is one tick faster than '''B'''. Additional repeaters can be used to add new groups of inputs, or to strengthen the output signal. This design is more expensive, as each repeater costs 3 redstone dust to craft (along with smooth stone).
+
Version '''C''' isolates the inputs with repeaters. It can be expanded horizontally up to 15 inputs. Besides the isolated inputs, it is one tick faster than '''B'''. Additional repeaters can be used to add new groups of inputs, or to strengthen the output signal. This design is more expensive, as each repeater costs 3 redstone dust to craft (along with smooth stone).
   
Version '''D''' is a 1-wide version designed for vertical use, such as in walls. The repeater serves to isolate the outputs from the inputs. This version can only take two inputs, though of course the inputs can be stacked with multiple gates.
+
Version '''D''' is a 1-wide version designed for vertical use, such as in walls. The repeater serves to isolate the outputs from the inputs. This version can only take two inputs, though of course the inputs can be stacked with multiple gates.
   
 
Version '''E''' utilizes the properties of light-transparent blocks: [[glowstone]], and upside-down [[stairs]] or [[slab]]s. These send signals up, but not down. It is expandable, like design '''C'''.
 
Version '''E''' utilizes the properties of light-transparent blocks: [[glowstone]], and upside-down [[stairs]] or [[slab]]s. These send signals up, but not down. It is expandable, like design '''C'''.
Ligne 163 : Ligne 161 :
 
}}
 
}}
   
=== NOR Gate ===
+
=== Porte NON-OU ===
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ NOR Gate Outputs
 
|+ NOR Gate Outputs
! A || {{tc|in!}} || {{tc|in!}} || {{tc|in}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée}}
 
|-
 
|-
! B || {{tc|in!}} || {{tc|in}} || {{tc|in!}} || {{tc|in}}
+
! B || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| A NOR B || {{tc|out}} || {{tc|out}} || {{tc|out}} || {{tc|out!}}
+
| A NOR B || {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie !}}
 
|}
 
|}
   
A '''NOR Gate''' turns its output off when at least one of the inputs are on. All logic gates can be made from some combinations of the NOR and NAND gates. In Minecraft, NOR is a basic logic gate, implemented by a torch with two or more inputs. (A torch with 1 input is the NOT gate, and with no inputs is the TRUE gate, that is, a power source.)
+
A '''NOR Gate''' turns its output off when at least one of the inputs are on. All logic gates can be made from some combinations of the NOR and NAND gates. In Minecraft, NOR is a basic logic gate, implemented by a torch with two or more inputs. (A torch with 1 input is the NOT gate, and with no inputs is the TRUE gate, that is, a power source.)
   
A torch can easily accommodate 3 mutually isolated inputs, as in design '''A'''. Design '''B''' goes to greater lengths to squeeze in a fourth input. If more inputs are necessary, it is simplest to use OR gates to combine them, then use an inverter (NOT) at the end. It is also possible to combine OR and NOR gates, by using the inversion of OR gates as inputs to NOR gates.
+
A torch can easily accommodate 3 mutually isolated inputs, as in design '''A'''. Design '''B''' goes to greater lengths to squeeze in a fourth input. If more inputs are necessary, it is simplest to use OR gates to combine them, then use an inverter (NOT) at the end. It is also possible to combine OR and NOR gates, by using the inversion of OR gates as inputs to NOR gates.
 
{{-}}
 
{{-}}
   
Ligne 185 : Ligne 183 :
 
}}
 
}}
   
=== AND Gate ===
+
=== Porte ET ===
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ AND Gate Outputs
 
|+ AND Gate Outputs
! A || {{tc|in!}} || {{tc|in!}} || {{tc|in}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée}}
 
|-
 
|-
! B || {{tc|in!}} || {{tc|in}} || {{tc|in!}} || {{tc|in}}
+
! B || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| A AND B || {{tc|out!}} || {{tc|out}} || {{tc|out}} || {{tc|out}}
+
| A AND B || {{ct|sortie !}} || {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie}}
 
|}
 
|}
An '''AND Gate''' turns the output on when all inputs are on. A 3-input AND gate is shown, but, like OR gates, AND gates can be freely "ganged", combining groups of inputs and then combining the results.
+
An '''AND Gate''' turns the output on when all inputs are on. A 3-input AND gate is shown, but, like OR gates, AND gates can be freely "ganged", combining groups of inputs and then combining the results.
   
 
A typical use for an AND gate would be to build a locking mechanism for a door, requiring both the activating button and the lock (typically a lever) to be on.
 
A typical use for an AND gate would be to build a locking mechanism for a door, requiring both the activating button and the lock (typically a lever) to be on.
   
Many AND gates act similarly to a "tri-state buffer", in which input B acts like a switch, connecting or disconnecting input A from the rest of the circuit. Such designs have one input feeding a circuit, which is opened or closed by a sticky piston driven by the other input. The difference from [[wikipedia:Three-state logic|real-life tri-state buffers]] is that one cannot drive a low current in Minecraft.
+
Many AND gates act similarly to a "tri-state buffer", in which input B acts like a switch, connecting or disconnecting input A from the rest of the circuit. Such designs have one input feeding a circuit, which is opened or closed by a sticky piston driven by the other input. The difference from [[wikipedia:Three-state logic|real-life tri-state buffers]] is that one cannot drive a low current in Minecraft.
 
{{-}}
 
{{-}}
   
Ligne 208 : Ligne 206 :
 
}}
 
}}
   
=== NAND Gate ===
+
=== Porte NON-ET ===
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ NAND Gate Outputs
 
|+ NAND Gate Outputs
! A || {{tc|in!}} || {{tc|in!}} || {{tc|in}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée}}
 
|-
 
|-
! B || {{tc|in!}} || {{tc|in}} || {{tc|in!}} || {{tc|in}}
+
! B || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| A NAND B || {{tc|out}} || {{tc|out!}} || {{tc|out!}} || {{tc|out!}}
+
| A NAND B || {{ct|sortie}} || {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie !}}
 
|}
 
|}
A '''NAND Gate''' turns the output off only when both inputs are on, the reverse of an AND gate. All logic gates can be made from NAND gates. As with NOR, large numbers of inputs are probably best handled by stacking up AND gates, then inverting the result.
+
A '''NAND Gate''' turns the output off only when both inputs are on, the reverse of an AND gate. All logic gates can be made from NAND gates. As with NOR, large numbers of inputs are probably best handled by stacking up AND gates, then inverting the result.
 
{{-}}
 
{{-}}
   
Ligne 227 : Ligne 225 :
 
}}
 
}}
   
=== XOR Gate ===
+
=== Porte OU exclusif ===
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ XOR Gate Outputs
 
|+ XOR Gate Outputs
! A || {{tc|in!}} || {{tc|in!}} || {{tc|in}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée}}
 
|-
 
|-
! B || {{tc|in!}} || {{tc|in}} || {{tc|in!}} || {{tc|in}}
+
! B || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| A XOR B || {{tc|out}} || {{tc|out!}} || {{tc|out!}} || {{tc|out}}
+
| A XOR B || {{ct|sortie}} || {{ct|sortie !}} || {{ct|sortie !}} || {{ct|sortie}}
 
|}
 
|}
 
An '''XOR Gate''' turns on if the inputs are different from each other (one on, the other off).
 
An '''XOR Gate''' turns on if the inputs are different from each other (one on, the other off).
Ligne 241 : Ligne 239 :
 
The XOR gate is useful for controlling a mechanism from multiple locations. When controls (such as levers) are combined in an XOR gate, toggling any control will toggle the XOR gate's output (like a light bulb controlled by [[Wikipedia:Multiway switching|two light switches]]—you can flip either one to turn the light on or off).
 
The XOR gate is useful for controlling a mechanism from multiple locations. When controls (such as levers) are combined in an XOR gate, toggling any control will toggle the XOR gate's output (like a light bulb controlled by [[Wikipedia:Multiway switching|two light switches]]—you can flip either one to turn the light on or off).
   
An XOR gate is a device which activates when the inputs are not the same, when only one is on. XOR is pronounced "zor" or "exor," a shortening of "exclusive or," because each input is mutually exclusive with the output. The output will be on ''only'' when exactly 1 of the inputs is on. Adding or removing a NOT gate to the end will produce an XNOR gate, which activates when the inputs are equal to each other. A useful feature is that an XOR (or XNOR) gate will always change its output when one of its inputs changes. This lets you set up 2 switches, ''either'' of which can always open or close a door, or turn some other device on or off. (In the real world, such arrangements are common for light switches, such as a stairway light with switches at top and bottom.)
+
An XOR gate is a device which activates when the inputs are not the same, when only one is on. XOR is pronounced "zor" or "exor," a shortening of "exclusive or," because each input is mutually exclusive with the output. The output will be on ''only'' when exactly 1 of the inputs is on. Adding or removing a NOT gate to the end will produce an XNOR gate, which activates when the inputs are equal to each other. A useful feature is that an XOR (or XNOR) gate will always change its output when one of its inputs changes. This lets you set up 2 switches, ''either'' of which can always open or close a door, or turn some other device on or off. (In the real world, such arrangements are common for light switches, such as a stairway light with switches at top and bottom.)
   
Like AND and OR gates, XOR gates can freely be "stacked" together, with gates gathering groups of inputs and their outputs being gathered in turn. The result of XORing more than two inputs is called "parity"—the result is 1 if and only if an odd number of inputs are 1.
+
Like AND and OR gates, XOR gates can freely be "stacked" together, with gates gathering groups of inputs and their outputs being gathered in turn. The result of XORing more than two inputs is called "parity"—the result is 1 if and only if an odd number of inputs are 1.
   
 
Design '''D''' is tiny, but only useful if you want the levers to be fixed to the circuit. The shaded block indicates the block the levers and the lit torch are attached to, along with the block that one is resting on.
 
Design '''D''' is tiny, but only useful if you want the levers to be fixed to the circuit. The shaded block indicates the block the levers and the lit torch are attached to, along with the block that one is resting on.
   
Design '''F''' is the most widely used of the torch-only designs, but newer components can do much better. Design '''H''' uses pistons, and is both faster and more compact.
+
Design '''F''' is the most widely used of the torch-only designs, but newer components can do much better. Design '''H''' uses pistons, and is both faster and more compact.
   
Beyond torches and pistons, various diodes can be used to produce fairly compact and cheap XOR gates. Design '''I''' can have its input repeaters coming in from either side or underneath, changing its size accordingly to fit tight spaces. Design '''J''' uses transparent blocks for a cheaper option.
+
Beyond torches and pistons, various diodes can be used to produce fairly compact and cheap XOR gates. Design '''I''' can have its input repeaters coming in from either side or underneath, changing its size accordingly to fit tight spaces. Design '''J''' uses transparent blocks for a cheaper option.
   
 
{{LoadBox
 
{{LoadBox
Ligne 257 : Ligne 255 :
 
}}
 
}}
   
The introduction of the [[comparator]] allows for several variations of a new design, the "Subtraction XOR Gate", which is flat, fast and silent. (Also easy to remember.) The catch in survival mode, is that making comparators requires access to [[Nether Quartz]].
+
The introduction of the [[comparator]] allows for several variations of a new design, the "Subtraction XOR Gate", which is flat, fast and silent. (Also easy to remember.) The catch in survival mode, is that making comparators requires access to [[Nether Quartz]].
   
 
Each input is the same distance to the rear and side of the comparator closest to it, so will suppress its own signal there, but travels farther to get to the side of the further comparator, so won't suppress its signal in the further comparator. Only if both inputs are on will both comparators get suppressed by a side input.
 
Each input is the same distance to the rear and side of the comparator closest to it, so will suppress its own signal there, but travels farther to get to the side of the further comparator, so won't suppress its signal in the further comparator. Only if both inputs are on will both comparators get suppressed by a side input.
Ligne 269 : Ligne 267 :
 
}}
 
}}
   
=== XNOR Gate ===
+
=== Porte NON-OU exclusif ===
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ XNOR Gate Outputs
 
|+ XNOR Gate Outputs
! A || {{tc|in!}} || {{tc|in!}} || {{tc|in}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée}}
 
|-
 
|-
! B || {{tc|in!}} || {{tc|in}} || {{tc|in!}} || {{tc|in}}
+
! B || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| A XNOR B || {{tc|out!}} || {{tc|out}} || {{tc|out}} || {{tc|out!}}
+
| A XNOR B || {{ct|sortie !}} || {{ct|sortie}} || {{ct|sortie}} || {{ct|sortie !}}
 
|}
 
|}
   
In logic, this is commonly referred to as "if and only if," ("iff" for short), "bi-conditional," or "equivalence". An XNOR gate activates only when the inputs are equal to each other—both on, or both off. Like the XOR gate, when either input changes, the output changes.
+
In logic, this is commonly referred to as "if and only if," ("iff" for short), "bi-conditional," or "equivalence". An XNOR gate activates only when the inputs are equal to each other—both on, or both off. Like the XOR gate, when either input changes, the output changes.
   
 
An XNOR gate can be built by inverting either the output, or '''one''' input, of an XOR gate.
 
An XNOR gate can be built by inverting either the output, or '''one''' input, of an XOR gate.
   
Design '''A''' is a pure-torch design. If external input isn't needed, the back-facing torches can be replaced with levers, yielding '''B'''. Design '''F''' is larger but highlights the logic, while '''I''' is an inverted variant of XOR gate '''H'''. Note that the output inverter can also be placed in line with the rest of the gate, or even in a pit attached to one of the output redstone's support blocks.
+
Design '''A''' is a pure-torch design. If external input isn't needed, the back-facing torches can be replaced with levers, yielding '''B'''. Design '''F''' is larger but highlights the logic, while '''I''' is an inverted variant of XOR gate '''H'''. Note that the output inverter can also be placed in line with the rest of the gate, or even in a pit attached to one of the output redstone's support blocks.
 
{{-}}
 
{{-}}
   
Ligne 292 : Ligne 290 :
 
}}
 
}}
   
=== IMPLIES Gate ===
+
=== Porte IMPLIQUER ===
   
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
{| class="wikitable" style="float: right; margin: 0 0 0.5em 0.5em; text-align: center;"
 
|+ IMPLIES Gate Outputs
 
|+ IMPLIES Gate Outputs
! A || {{tc|in!}} || {{tc|in!}} || {{tc|in}} || {{tc|in}}
+
! A || {{ct|entrée !}} || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée}}
 
|-
 
|-
! B || {{tc|in!}} || {{tc|in}} || {{tc|in!}} || {{tc|in}}
+
! B || {{ct|entrée !}} || {{ct|entrée}} || {{ct|entrée !}} || {{ct|entrée}}
 
|-
 
|-
| A IMPLIES B || {{tc|out!}} || {{tc|out}} || {{tc|out!}} || {{tc|out!}}
+
| A IMPLIES B || {{ct|sortie !}} || {{ct|sortie}} || {{ct|sortie !}} || {{ct|sortie !}}
 
|}
 
|}
   
An '''IMPLIES Gate''' turns on either if both inputs are on, or if the first input is off. (Unlike the other gates here, the inputs are not interchangeable.) This represents [[Wikipedia:Material conditional|material implication]] or a conditional statement, "if ''A'' then ''B''", also written '''A → B'''. This is false only if the antecedent ''A'' is true, but the consequent ''B'' is false. It is the logical equivalent of "B or NOT A", and the mathematical equivalent of (A<=B) (less than or equal to).
+
An '''IMPLIES Gate''' turns on either if both inputs are on, or if the first input is off. (Unlike the other gates here, the inputs are not interchangeable.) This represents [[Wikipedia:Material conditional|material implication]] or a conditional statement, "if ''A'' then ''B''", also written '''A → B'''. This is false only if the antecedent ''A'' is true, but the consequent ''B'' is false. It is the logical equivalent of "B or NOT A", and the mathematical equivalent of (A<=B) (less than or equal to).
   
Design '''C''' has a speed of 2 ticks if output is 1, but 1 tick if the output is 0. Similarly, the other designs take 1 tick if the output is 0, but are immediate (and not isolated) if the output is 1. If you must synchronize (or isolate) the output, consider placing a 1-tick repeater in front of the "fast" input (input A for '''C''', input B for the others).
+
Design '''C''' has a speed of 2 ticks if output is 1, but 1 tick if the output is 0. Similarly, the other designs take 1 tick if the output is 0, but are immediate (and not isolated) if the output is 1. If you must synchronize (or isolate) the output, consider placing a 1-tick repeater in front of the "fast" input (input A for '''C''', input B for the others).
 
{{-}}
 
{{-}}
   
Ligne 315 : Ligne 313 :
 
{{-}}
 
{{-}}
   
== Video ==
+
== Vidéo ==
   
  +
{{#ev:youtube|CMC7ckdBcf4}}
{{:Logic circuit/video}}
 
   
== See also ==
+
== Voir aussi ==
   
  +
* [[Wikipédia:Fonction logique]]
[[Wikipedia:Logic gates]]
 
   
 
{{Redstone}}
 
{{Redstone}}
   
[[Category:Redstone circuits|L]]
+
[[Catégorie:Redstone|L]]
   
 
[[de:Redstone-Schaltkreise/Logikgatter]]
 
[[de:Redstone-Schaltkreise/Logikgatter]]

Dernière version du 11 août 2021 à 09:12

Cette page fait partie du projet de mise à jour des pages de redstone 
Sa traduction est en cours, votre aide est la bienvenue.

Un circuit logique (ou porte logique) est un circuit qui fonctionne avec des états logiques. C'est à dire que les entrées et les sortie du système ne peuvent prendre que deux valeurs possible : vrai, alimenté et 1, pour le premier état ou bien faux, éteint et 0 pour le second. Dans la suite de la page, nous utiliseront les termes alimenté et éteint.

Les portes logiques, qui suivent, sont dite combinatoire. En d'autres termes, chaque porte suit une règle et toutes ses sorties peuvent être déterminées en fonction de cette règle et de ses entrées. Par exemple si les deux entrées d'une porte ET sont alimentées alors la sortie est alimentée.

Il existe plusieurs types de portes logiques, chacune pouvant être créer avec différents designs. Chaque design a ses avantages et ses inconvénients comme la taille, la complexité, la vitesse, ou encore le coût. Les sections qui suivent fournissent plusieurs designs pour chaque type de porte logique.

Concepts

Sorties des portes logiques
Montre les sorties, en rouge, de chaque porte, pour chaque combinaison des entrées, en vert.
A ON ON off off Question Answered
B ON off ON off
NON A off off ON ON A est éteint?
A OU B ON ON ON off Il y a t-il au moins une entrée alimentée?
A NON OU B off off off ON Les entrées sont elles toutes les deux éteintes?
A ET B ON off off off Les entrées sont elles toutes les deux alimentées?
A NON ET B off ON ON ON Il y a t-il au moins une entrée éteinte?
A XOR B off ON ON off Les entrées sont elles différentes?
A XNOR B ON off off ON Les entrées sont elles identiques?
A IMPLIQUE B ON off ON ON si A est alimenté, B l'est il également ?

La sortie de chaque circuit logique reflète l'état de ces entrées à tous moments (Bien que du délai puisse apparaître du aux éléments du circuit).

Permuter les entrées
Les entrées A et B de toutes les portes peuvent être permutées sans modifier la sortie. Mise à part pour la porte IMPLIQUE et la porte NON qui n'a qu'une seule entrée.
Multiplier les entrées
Les portes ET, OU et XOR peuvent être assemblées afin de réaliser leurs opérations avec plus de deux entrées. En combinant un résultat d'une première avec une nouvelle entrée. Pour ces trois portes, l'ordre des entrées n'a pas d'importance. A noter que lorsqu'une porte XOR est assemblée de cette manière, sa sortie sera alimentée lorsque le nombre d'entrée alimenté est impair.
Comment choisir une porte logique ?
Lorsque vous n'êtes pas sur de la porte logique à utiliser, essayez de construire un tableau comme celui de droite avec une seule ligne de sorties. Ajoutez y les entrées connues ainsi que les différents niveaux logiques (alimenté et éteint) qu'elles peuvent prendre. Pour chaque combinaison écrivez la valeur de la sortie souhaitée. Enfin comparez votre tableau avec celui de droite afin de trouver quelle porte correspond avec les sorties souhaitées.
Si la sortie dois changer alors que les entrées sont stables, ou bien doit être mémorisée alors vous devriez regarder Générateur de pulsations ou Circuit de mémoire.

Porte logique

Une porte logique est un circuit logique basique.

Porte NON

NOT Gate Outputs
A ON off
NOT A off ON

Une porte NON (ou "inverseur") renvoie un courant alimenté si le courant d'entrée est éteint ou un courant éteint si le courant d'entrée est alimenté.

Inverseur à torche
1-largeur, plat (horizontal seulement), silencieux, tileable
délai du circuit: 1 tick
L'inverseur à torche est la porte NON la plus utilisée, en raison de sa petite taille.
One drawback of the torch inverter is that it will "burn out" if run on a clock cycle faster than a 3-clock (3 ticks on, 3 ticks off). A burnt out torch inverter will turn back on after a random time, which may produce undesired pulses in a circuit.
Subtraction Inverter
flat, silent
circuit delay: 1 tick
The subtraction inverter offers little advantage over the torch inverter except that it can run on a 2-clock cycle without burning out. Faster clocks will not work though -- the comparator simply won't react to them.
Variations: The powered lever can be replaced with another always-on power component (e.g., redstone torch, block of redstone), or with a full container if a power component would be inconvenient in that location.
The repeater is required to ensure the input signal is strong enough to overcome the comparator's rear source, but can be removed in a number of ways. If the input power level is known (because the circuit design is fixed, so it can be calculated), the repeater can be removed by replacing the powered lever with a container which will produce the same power level. Alternatively, the repeater can be removed if the output continues to a length of redstone wire which will reduce the subtracted signal enough that the signal is inverted eventually.
Instant Inverter
instant
circuit delay: 0 ticks
The instant inverter is a basic building block of larger instant circuits.
The "ground" version has the largest volume, but is shorter and fits easily with flatter circuits. The "tall" version (not actually tallest) is the smallest in volume and resources, but has an input and output at inconvenient locations (though not necessarily for "in-the-sky" builds). The "long" version is larger but has input and output at a convenient ground level.
With the "tall" version, it can be tempting to take the output from the lower block below the slabs, but that output is only instant on the input's rising edge.
Behavior (i.e., how it works): An instant inverter has two sticky pistons -- one to move a block to cut off the output, and one to move a block of redstone power source.
When the input is off, the block of redstone powers the output. When the input turns on, the block of redstone is immediately moved, cutting off the output's power (instantly inverting the input). At the same time, the redstone repeater gets powered, but before it can power the output, the other block has moved into place to cut off the output.
While the input is on, the redstone repeater is trying to power the output, but the output is cut off by the moving block. As soon as the output turns off, the block starts to retract, immediately allowing the power through (instantly inverting the input). The repeater will only continue to power the output for 2 tick before it turns off, but by that time the block of redstone has arrived back in its original position to continue powering the output.
Variations: When fitting an instant inverter into a larger build which may require the inputs or outputs to be moved around, there are three components that need to be powered simultaneously: the two sticky pistons and the redstone repeater. Getting the input line to all three can be tricky. The "tall" version solves this problem by placing all three components next to a single input block, while the other versions need to split the input line to reach all components.
In addition, the block of redstone and its sticky piston can be moved around, as long as it is powered without delay by the input, and powers the output wire after the repeater and before the dust-cut in its retracted state only (it shouldn't power anything in the circuit when extended). The three circuits shown below illustrate ways of powering the output line from above, below, and from the side.

Schematic Gallery: NOT Gate

Porte OU

OR Gate Outputs
A ON ON off off
B ON off ON off
A OR B ON ON ON off

A device where the output is on when at least one of the inputs are on. Note that since the OR operation is associative and commutative, OR gates can be combined freely: You can compare huge numbers of inputs by using small OR gates to collect groups of inputs, then comparing their results with more OR gates. The result will not depend on the arrangement of the inputs, or on which ones were combined first.

The simplest version of the OR gate is design A: merely a wire connecting all inputs and outputs. However, this causes the inputs to become "compromised", so that they can only be used in this OR gate. The introduction's example, using a solid block instead of wire, does not suffer the same hazard.

If you need to use the inputs elsewhere, the inputs need to be "isolated", by passing them through a block as above, or a device such as a torch or repeater. Torches yield version B. Note that this is in fact a NOR gate with an inverter on the output.

Version C isolates the inputs with repeaters. It can be expanded horizontally up to 15 inputs. Besides the isolated inputs, it is one tick faster than B. Additional repeaters can be used to add new groups of inputs, or to strengthen the output signal. This design is more expensive, as each repeater costs 3 redstone dust to craft (along with smooth stone).

Version D is a 1-wide version designed for vertical use, such as in walls. The repeater serves to isolate the outputs from the inputs. This version can only take two inputs, though of course the inputs can be stacked with multiple gates.

Version E utilizes the properties of light-transparent blocks: glowstone, and upside-down stairs or slabs. These send signals up, but not down. It is expandable, like design C.

Schematic Gallery: OR Gate

Porte NON-OU

NOR Gate Outputs
A ON ON off off
B ON off ON off
A NOR B off off off ON

A NOR Gate turns its output off when at least one of the inputs are on. All logic gates can be made from some combinations of the NOR and NAND gates. In Minecraft, NOR is a basic logic gate, implemented by a torch with two or more inputs. (A torch with 1 input is the NOT gate, and with no inputs is the TRUE gate, that is, a power source.)

A torch can easily accommodate 3 mutually isolated inputs, as in design A. Design B goes to greater lengths to squeeze in a fourth input. If more inputs are necessary, it is simplest to use OR gates to combine them, then use an inverter (NOT) at the end. It is also possible to combine OR and NOR gates, by using the inversion of OR gates as inputs to NOR gates.

Schematic Gallery: NOR Gate

Porte ET

AND Gate Outputs
A ON ON off off
B ON off ON off
A AND B ON off off off

An AND Gate turns the output on when all inputs are on. A 3-input AND gate is shown, but, like OR gates, AND gates can be freely "ganged", combining groups of inputs and then combining the results.

A typical use for an AND gate would be to build a locking mechanism for a door, requiring both the activating button and the lock (typically a lever) to be on.

Many AND gates act similarly to a "tri-state buffer", in which input B acts like a switch, connecting or disconnecting input A from the rest of the circuit. Such designs have one input feeding a circuit, which is opened or closed by a sticky piston driven by the other input. The difference from real-life tri-state buffers is that one cannot drive a low current in Minecraft.

Schematic Gallery: AND Gate

Porte NON-ET

NAND Gate Outputs
A ON ON off off
B ON off ON off
A NAND B off ON ON ON

A NAND Gate turns the output off only when both inputs are on, the reverse of an AND gate. All logic gates can be made from NAND gates. As with NOR, large numbers of inputs are probably best handled by stacking up AND gates, then inverting the result.

Schematic Gallery: NAND Gate

Porte OU exclusif

XOR Gate Outputs
A ON ON off off
B ON off ON off
A XOR B off ON ON off

An XOR Gate turns on if the inputs are different from each other (one on, the other off).

The XOR gate is useful for controlling a mechanism from multiple locations. When controls (such as levers) are combined in an XOR gate, toggling any control will toggle the XOR gate's output (like a light bulb controlled by two light switches—you can flip either one to turn the light on or off).

An XOR gate is a device which activates when the inputs are not the same, when only one is on. XOR is pronounced "zor" or "exor," a shortening of "exclusive or," because each input is mutually exclusive with the output. The output will be on only when exactly 1 of the inputs is on. Adding or removing a NOT gate to the end will produce an XNOR gate, which activates when the inputs are equal to each other. A useful feature is that an XOR (or XNOR) gate will always change its output when one of its inputs changes. This lets you set up 2 switches, either of which can always open or close a door, or turn some other device on or off. (In the real world, such arrangements are common for light switches, such as a stairway light with switches at top and bottom.)

Like AND and OR gates, XOR gates can freely be "stacked" together, with gates gathering groups of inputs and their outputs being gathered in turn. The result of XORing more than two inputs is called "parity"—the result is 1 if and only if an odd number of inputs are 1.

Design D is tiny, but only useful if you want the levers to be fixed to the circuit. The shaded block indicates the block the levers and the lit torch are attached to, along with the block that one is resting on.

Design F is the most widely used of the torch-only designs, but newer components can do much better. Design H uses pistons, and is both faster and more compact.

Beyond torches and pistons, various diodes can be used to produce fairly compact and cheap XOR gates. Design I can have its input repeaters coming in from either side or underneath, changing its size accordingly to fit tight spaces. Design J uses transparent blocks for a cheaper option.

Schematic Gallery: XOR Gate

The introduction of the comparator allows for several variations of a new design, the "Subtraction XOR Gate", which is flat, fast and silent. (Also easy to remember.) The catch in survival mode, is that making comparators requires access to Nether Quartz.

Each input is the same distance to the rear and side of the comparator closest to it, so will suppress its own signal there, but travels farther to get to the side of the further comparator, so won't suppress its signal in the further comparator. Only if both inputs are on will both comparators get suppressed by a side input.

However, that is only true if the inputs are the same power level (or at least not different by more than 1), otherwise one signal could overwhelm the other's attempt to suppress its signal. If this circuit is sure to receive inputs of the same power level (because the system it's part of has been designed that way), then the "basic" version can be used. Otherwise, some method should be used to ensure the inputs are equal—for example, with repeaters (the "repeated" version) or with torches (the "inverted" version).

Schematic Gallery: Subtraction XOR Gate

Porte NON-OU exclusif

XNOR Gate Outputs
A ON ON off off
B ON off ON off
A XNOR B ON off off ON

In logic, this is commonly referred to as "if and only if," ("iff" for short), "bi-conditional," or "equivalence". An XNOR gate activates only when the inputs are equal to each other—both on, or both off. Like the XOR gate, when either input changes, the output changes.

An XNOR gate can be built by inverting either the output, or one input, of an XOR gate.

Design A is a pure-torch design. If external input isn't needed, the back-facing torches can be replaced with levers, yielding B. Design F is larger but highlights the logic, while I is an inverted variant of XOR gate H. Note that the output inverter can also be placed in line with the rest of the gate, or even in a pit attached to one of the output redstone's support blocks.

Schematic Gallery: XNOR Gate

Porte IMPLIQUER

IMPLIES Gate Outputs
A ON ON off off
B ON off ON off
A IMPLIES B ON off ON ON

An IMPLIES Gate turns on either if both inputs are on, or if the first input is off. (Unlike the other gates here, the inputs are not interchangeable.) This represents material implication or a conditional statement, "if A then B", also written A → B. This is false only if the antecedent A is true, but the consequent B is false. It is the logical equivalent of "B or NOT A", and the mathematical equivalent of (A<=B) (less than or equal to).

Design C has a speed of 2 ticks if output is 1, but 1 tick if the output is 0. Similarly, the other designs take 1 tick if the output is 0, but are immediate (and not isolated) if the output is 1. If you must synchronize (or isolate) the output, consider placing a 1-tick repeater in front of the "fast" input (input A for C, input B for the others).

Schematic Gallery: IMPLIES Gate

Vidéo

Voir aussi