Logic Gates

From Mech
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Digital circuits use Boolean logic to perform operations. Everything is in either one of two states: 1 (true) or 0 (false). Depending on your hardware, 1 usually corresponds to a high voltage and 0 corresponds to a low voltage.

AND Gate

The symbol for the AND gate:AND gate symbol.gif

Pins 1 and 2 are inputs, and pin 3 is the output.

The AND gate will will output 1 if both inputs are also 1.

Truth Table for AND Gate
Inputs Output
0 0 0
0 1 0
1 0 0
1 1 1

OR Gate

Symbol for the OR gate: OR gate symbol.gif

The OR gate will output 1 if any one or both of its inputs are 1.

Truth Table for OR Gate
Inputs Output
0 0 0
0 1 1
1 0 1
1 1 1

Inverter (NOT) Gate

Symbol for the inverter: Inverter gate symbol.gif

This is a NOT gate, but in digital circuits it is usually called an inverter.

The OR gate will output 1 if its single input is 0.

Truth Table for OR Gate
Input Output
0 1
1 0

NAND Gate

The symbol for the NAND gate:NAND gate symbol.gif

The NAND gate is simply an AND gate with an inverter at the output. Notice the "bubble" at the output node of the symbol; this bubble indicates an inverted output.

Truth Table for NAND Gate
Inputs Output
0 0 1
0 1 1
1 0 1
1 1 0

NOR Gate

Symbol for the NOR gate: NOR gate symbol.gif

Similarly, the NOR gate is just an inverted OR gate. t will output 1 if neither of its inputs are 1.

Truth Table for NOR Gate
Inputs Output
0 0 1
0 1 0
1 0 0
1 1 0

XOR

Symbol for the XOR gate: XOR gate symbol.gif

The XOR (Exclusive OR) gate will output 1 if either of its inputs are 1, but not if both of its inputs are 1.

Truth Table for NOR Gate
Inputs Output
0 0 0
0 1 1
1 0 1
1 1 0

XNOR

Symbol for the XNOR gate': XNOR gate symbol.gif

The XNOR gate is an inverted NOT gate; it will output 1 if neither of its inputs are 1, or if both of its inputs are 1.

Truth Table for XNOR Gate
Inputs Output
0 0 1
0 1 0
1 0 0
1 1 1