From WikiChip
Difference between revisions of "logic gate"

(Created page with "{{confuse|ideal logic gate}} A '''logic gate''' is a simple device that gives a discrete output of either 0 or 1 based on the input condition. Logic gates implement Boolean...")
 
m (Reverted edits by 88.230.129.253 (talk) to last revision by 73.222.215.36)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{confuse|ideal logic gate}}
 
{{confuse|ideal logic gate}}
A '''logic gate''' is a simple device that gives a discrete output of either 0 or 1 based on the input condition. Logic gates implement [[Boolean function]]s and are the fundamental building blocks of all digital systems. Logic gates can be implemented using discrete components such as [[resistor]]s, [[diode]]s, and [[transistor]]s.
+
A '''logic gate''' is a simple device that gives a discrete output of either 0 or 1 based on the input condition. Logic gates implement [[Boolean function]]s and are the fundamental building blocks of all digital systems. Logic gates can be implemented using discrete components such as [[resistor]]s, [[diode]]s, and [[transistor]]s.  
  
 +
Sometimes a combination of logic gates may be more efficiently implemented as a single device. Those devices are known as [[compound logic gate]].
 +
 +
==Symbology==
 +
There are many different symbols that can be used to represent basic logic gates. Some areas of the world may be required to follow a specific standard. The four main standards that attempt to provide a uniform method of describing complex logic functions are:
 +
* [[ANSI/IEEE Std 91-1984]] (MIL/ANSI)
 +
* [[IEC 60617-12]] / [[BS 3939]] (British)
 +
* [[DIN 40700]] (German)
 +
* [[NEMA ICS 19-2002]]
 +
Note that the [[inversion bubble]] is used across most of those standards. In this article, the ANSI symbols are used.
 +
 +
==Gates==
 +
===Buffer===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! Q
 +
|-
 +
| 0 || 0
 +
|-
 +
| 1 || 1
 +
|}
 +
{{main|buffer gate|l1=Buffer}}
 +
[[File:buffer gate (ansi).svg|100px]] A '''Buffer''' is a gate that outputs the very same input it is given. Its primarily used to regenerate the input into either a strong LOW or a strong HIGH. In some cases this gate might be used to simply show that the output from some component is not degraded.
 +
 +
This gate implements the following Boolean function: <math>Q = A</math>
 +
{{clear}}
 +
 +
===Tri-state Buffer===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! EN !! A !! Q
 +
|-
 +
| 0 || [[don't care|X]] || [[high impedance|Z]]
 +
|-
 +
| 1 || A || A
 +
|}
 +
{{main|tri-state buffer gate|l1=Tri-state Buffer}}
 +
[[File:tri-state buffer gate (ansi).svg|100px]] A '''Tri-state Buffer''' is a gate that outputs the very same input it is given only when the control signal allows it. When the control signal is off, the output is at [[high impedance]]. This gate forms the basis for [[buses]], by controlling which devices is allow to generate output to a shared [[bus]].
 +
{{clear}}
 +
===NOT Gate===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! Q
 +
|-
 +
| 0 || 1
 +
|-
 +
| 1 || 0
 +
|}
 +
{{main|NOT gate}}
 +
[[File:not gate (ansi).svg|100px]] The '''NOT gate''' or an '''inverter''' produces an output that's the opposite to its input - if the input is HIGH, the output is LOW, and conversely when the input is LOW, the output is HIGH.
 +
 +
This gate implements the following Boolean function: <math>Q = \bar{A} = \neg A</math>
 +
{{clear}}
 +
===AND Gate===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! B !! Q
 +
|-
 +
| 0 || 0 || 0
 +
|-
 +
| 0 || 1 || 0
 +
|-
 +
| 1 || 0 || 0
 +
|-
 +
| 1 || 1 || 1
 +
|}
 +
{{main|AND gate}}
 +
[[File:and gate (ansi).svg|100px]] An '''AND gate''' outputs a HIGH only when both inputs are HIGH, otherwise it outputs a LOW. The Boolean AND operation is equivalent to the Boolean multiplication operation.
 +
 +
The AND gate implements the following Boolean function: <math>Q = AB = A \and B = A \& B = A \cdot B</math>
 +
{{clear}}
 +
===OR Gate===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! B !! Q
 +
|-
 +
| 0 || 0 || 0
 +
|-
 +
| 0 || 1 || 1
 +
|-
 +
| 1 || 0 || 1
 +
|-
 +
| 1 || 1 || 1
 +
|}
 +
{{main|OR gate}}
 +
[[File:or gate (ansi).svg|100px]] The '''OR gate''' outputs a HIGH if any of its inputs are HIGH, otherwise it outputs a LOW. This function is equivalent to the Boolean addition function.
 +
 +
The OR gate implements the following Boolean function: <math>Q = A + B = A \or B</math>
 +
{{clear}}
 +
===XOR Gate===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! B !! Q
 +
|-
 +
| 0 || 0 || 0
 +
|-
 +
| 0 || 1 || 1
 +
|-
 +
| 1 || 0 || 1
 +
|-
 +
| 1 || 1 || 0
 +
|}
 +
{{main|XOR gate}}
 +
[[File:xor gate (ansi).svg|100px]] The '''XOR gate''' ('''Exclusive-OR gate''') outputs a HIGH when both inputs differ, otherwise it outputs a LOW. That is, the output is HIGH when one of the inputs are HIGH exclusively.
 +
 +
The XOR gate implements the following Boolean function: <math>Q = A \underline{\lor} B = A \oplus B = (A \neq B)</math>
 +
{{clear}}
 +
===NAND Gate===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! B !! Q
 +
|-
 +
| 0 || 0 || 1
 +
|-
 +
| 0 || 1 || 1
 +
|-
 +
| 1 || 0 || 1
 +
|-
 +
| 1 || 1 || 0
 +
|}
 +
{{main|NAND gate}}
 +
[[File:nand gate (ansi).svg|100px]] The '''NAND gate''' (NOT AND) outputs a HIGH so long both inputs are not HIGH, otherwise it outputs a LOW.
 +
 +
This gate implements the following Boolean function: <math>Q = \overline{A \wedge B} = A \overline{\wedge} B = \overline{A\,B} = A|B</math>
 +
{{clear}}
 +
===NOR Gate===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! B !! Q
 +
|-
 +
| 0 || 0 || 1
 +
|-
 +
| 0 || 1 || 0
 +
|-
 +
| 1 || 0 || 0
 +
|-
 +
| 1 || 1 || 0
 +
|}
 +
{{main|NOR gate}}
 +
[[File:nor gate (ansi).svg|100px]] The '''NOR gate''' outputs a HIGH only when both inputs are LOW, otherwise it outputs a LOW.
 +
 +
This gate implements the following Boolean function: <math>Y = \overline{A \vee B} = A \overline{\vee} B = \overline{A + B} = A - B</math>
 +
{{clear}}
 +
 +
===XNOR Gate===
 +
{| class="wikitable" style="float: right;"
 +
|-
 +
! A !! B !! Q
 +
|-
 +
| 0 || 0 || 1
 +
|-
 +
| 0 || 1 || 0
 +
|-
 +
| 1 || 0 || 0
 +
|-
 +
| 1 || 1 || 1
 +
|}
 +
{{main|XNOR gate}}
 +
[[File:xnor gate (ansi).svg|100px]] The '''XNOR gate''' (Exclusive-NOR") outputs a HIGH when both inputs are the same, otherwise it outputs a LOW.
 +
 +
This gate implements the following Boolean function: <math>Y = \overline{A \underline{\lor} B} = A \overline{\underline{\lor}} B = \overline{A \oplus B} = A \odot B</math>
 +
{{clear}}
 +
 +
== See also ==
 +
* [[compound logic gate]]s
  
{{stub}}
 
 
[[Category:logic gates]]
 
[[Category:logic gates]]

Latest revision as of 10:19, 10 February 2020

Not to be confused with ideal logic gate.

A logic gate is a simple device that gives a discrete output of either 0 or 1 based on the input condition. Logic gates implement Boolean functions and are the fundamental building blocks of all digital systems. Logic gates can be implemented using discrete components such as resistors, diodes, and transistors.

Sometimes a combination of logic gates may be more efficiently implemented as a single device. Those devices are known as compound logic gate.

Symbology[edit]

There are many different symbols that can be used to represent basic logic gates. Some areas of the world may be required to follow a specific standard. The four main standards that attempt to provide a uniform method of describing complex logic functions are:

Note that the inversion bubble is used across most of those standards. In this article, the ANSI symbols are used.

Gates[edit]

Buffer[edit]

A Q
0 0
1 1
Main article: Buffer

buffer gate (ansi).svg A Buffer is a gate that outputs the very same input it is given. Its primarily used to regenerate the input into either a strong LOW or a strong HIGH. In some cases this gate might be used to simply show that the output from some component is not degraded.

This gate implements the following Boolean function: Equation upper Q equals upper A

Tri-state Buffer[edit]

EN A Q
0 X Z
1 A A
Main article: Tri-state Buffer

tri-state buffer gate (ansi).svg A Tri-state Buffer is a gate that outputs the very same input it is given only when the control signal allows it. When the control signal is off, the output is at high impedance. This gate forms the basis for buses, by controlling which devices is allow to generate output to a shared bus.

NOT Gate[edit]

A Q
0 1
1 0
Main article: NOT gate

not gate (ansi).svg The NOT gate or an inverter produces an output that's the opposite to its input - if the input is HIGH, the output is LOW, and conversely when the input is LOW, the output is HIGH.

This gate implements the following Boolean function: Equation upper Q equals upper A overbar equals normal not-sign upper A

AND Gate[edit]

A B Q
0 0 0
0 1 0
1 0 0
1 1 1
Main article: AND gate

and gate (ansi).svg An AND gate outputs a HIGH only when both inputs are HIGH, otherwise it outputs a LOW. The Boolean AND operation is equivalent to the Boolean multiplication operation.

The AND gate implements the following Boolean function: Equation upper Q equals upper A upper B equals upper A logical-and upper B equals upper A ampersand upper B equals upper A dot upper B

OR Gate[edit]

A B Q
0 0 0
0 1 1
1 0 1
1 1 1
Main article: OR gate

or gate (ansi).svg The OR gate outputs a HIGH if any of its inputs are HIGH, otherwise it outputs a LOW. This function is equivalent to the Boolean addition function.

The OR gate implements the following Boolean function: Equation upper Q equals upper A plus upper B equals upper A logical-or upper B

XOR Gate[edit]

A B Q
0 0 0
0 1 1
1 0 1
1 1 0
Main article: XOR gate

xor gate (ansi).svg The XOR gate (Exclusive-OR gate) outputs a HIGH when both inputs differ, otherwise it outputs a LOW. That is, the output is HIGH when one of the inputs are HIGH exclusively.

The XOR gate implements the following Boolean function: Equation upper Q equals upper A ModifyingBelow logical-or With bar upper B equals upper A circled-plus upper B equals left-parenthesis upper A not-equals upper B right-parenthesis

NAND Gate[edit]

A B Q
0 0 1
0 1 1
1 0 1
1 1 0
Main article: NAND gate

nand gate (ansi).svg The NAND gate (NOT AND) outputs a HIGH so long both inputs are not HIGH, otherwise it outputs a LOW.

This gate implements the following Boolean function: Equation upper Q equals ModifyingAbove upper A logical-and upper B With bar equals upper A ModifyingAbove logical-and With bar upper B equals ModifyingAbove upper A upper B With bar equals upper A vertical-bar upper B

NOR Gate[edit]

A B Q
0 0 1
0 1 0
1 0 0
1 1 0
Main article: NOR gate

nor gate (ansi).svg The NOR gate outputs a HIGH only when both inputs are LOW, otherwise it outputs a LOW.

This gate implements the following Boolean function: Equation upper Y equals ModifyingAbove upper A logical-or upper B With bar equals upper A ModifyingAbove logical-or With bar upper B equals ModifyingAbove upper A plus upper B With bar equals upper A minus upper B

XNOR Gate[edit]

A B Q
0 0 1
0 1 0
1 0 0
1 1 1
Main article: XNOR gate

xnor gate (ansi).svg The XNOR gate (Exclusive-NOR") outputs a HIGH when both inputs are the same, otherwise it outputs a LOW.

This gate implements the following Boolean function: Equation upper Y equals ModifyingAbove upper A ModifyingBelow logical-or With bar upper B With bar equals upper A ModifyingAbove ModifyingBelow logical-or With bar With bar upper B equals ModifyingAbove upper A circled-plus upper B With bar equals upper A circled-dot upper B

See also[edit]