What is a logic gate? Provide examples.

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.