A logic gate is a fundamental building block of digital electronic circuits. It is a physical device or an electronic circuit that performs a logical operation on one or more binary inputs and produces a single binary output based on its internal logic function. The inputs and output of a logic gate can take two possible states: high (1) or low (0), representing true or false, respectively.
There are several types of logic gates, each with its specific logic function. Here are some common types of logic gates along with their symbols and truth tables:
AND Gate:
Symbol: & (sometimes also shown as •)
Truth table:
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate:
Symbol: + (sometimes also shown as ∨)
Truth table:
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1
NOT Gate:
Symbol: ¬ (sometimes also shown as ~ or ' )
Truth table:
A NOT A
0 1
1 0
XOR Gate (Exclusive OR):
Symbol: ⊕
Truth table:
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
NAND Gate (NOT AND):
Symbol: ↑ (sometimes also shown as ⋀)
Truth table:
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
NOR Gate (NOT OR):
Symbol: ↓ (sometimes also shown as ⋁)
Truth table:
A B A NOR B
0 0 1
0 1 0
1 0 0
1 1 0
These logic gates can be combined in various ways to create more complex logic functions and implement arithmetic, memory, and control circuits, forming the basis for digital computers and other digital systems.