Logic Gates - Detailed Notes
The AND Gate
The AND gate is a basic digital logic gate that implements logical conjunction.
It has two or more inputs and one output. The output is HIGH (1) only when all inputs are
HIGH (1).
Truth Table (for 2-input AND):
A|B|Y
0|0|0
0|1|0
1|0|0
1|1|1
Boolean Expression: Y = A · B
The OR Gate
The OR gate implements logical disjunction. It has two or more inputs and one output.
The output is HIGH (1) if at least one input is HIGH (1).
Truth Table (for 2-input OR):
A|B|Y
0|0|0
0|1|1
1|0|1
1|1|1
Boolean Expression: Y = A + B
The Inverter and Buffer
1. Inverter (NOT Gate): The inverter has one input and one output.
It produces the complement of the input signal. If input is HIGH (1), output is LOW (0), and
vice versa.
Boolean Expression: Y = A'
Truth Table:
A|Y
0|1
1|0
2. Buffer: A buffer has one input and one output. It outputs the same logic state as the input.
It is used to strengthen a weak signal without altering its logic level.
Truth Table:
A|Y
0|0
1|1
The NAND Gate
The NAND gate is a universal gate. It is the complement of the AND gate.
The output is LOW (0) only when all inputs are HIGH (1); otherwise, the output is HIGH (1).
Truth Table (for 2-input NAND):
A|B|Y
0|0|1
0|1|1
1|0|1
1|1|0
Boolean Expression: Y = (A · B)'
The NOR Gate
The NOR gate is the complement of the OR gate.
The output is HIGH (1) only when all inputs are LOW (0).
Truth Table (for 2-input NOR):
A|B|Y
0|0|1
0|1|0
1|0|0
1|1|0
Boolean Expression: Y = (A + B)'
The Exclusive OR Gate
The Exclusive-OR (XOR) gate outputs HIGH (1) only when the number of HIGH inputs is
odd.
For a 2-input XOR, the output is HIGH when exactly one input is HIGH.
Truth Table (for 2-input XOR):
A|B|Y
0|0|0
0|1|1
1|0|1
1|1|0
Boolean Expression: Y = A ⊕ B = A'B + AB'
The Exclusive NOR Gate
The Exclusive-NOR (XNOR) gate is the complement of XOR.
It outputs HIGH (1) when the number of HIGH inputs is even (for 2-input XNOR, when both
inputs are equal).
Truth Table (for 2-input XNOR):
A|B|Y
0|0|1
0|1|0
1|0|0
1|1|1
Boolean Expression: Y = (A ⊕ B)' = AB + A'B'
The NAND and NOR Gate as an Universal Gate
NAND and NOR gates are called universal gates because any other logic gate can be
implemented using only NAND or only NOR gates.
1. Using NAND gates:
- NOT gate: A NAND A = A'
- AND gate: (A NAND B) NAND (A NAND B) = A · B
- OR gate: (A NAND A) NAND (B NAND B) = A + B
2. Using NOR gates:
- NOT gate: A NOR A = A'
- OR gate: (A NOR B) NOR (A NOR B) = A + B
- AND gate: (A NOR A) NOR (B NOR B) = A · B
Gates with more than Two Inputs
Logic gates can have more than two inputs. The behavior is an extension of the two-input
case.
- AND gate with 3 inputs: Output is 1 only if all three inputs are 1.
- OR gate with 3 inputs: Output is 1 if at least one input is 1.
- NAND/NOR/XOR/XNOR gates also follow extended truth tables for multiple inputs.
For example, a 3-input XOR outputs 1 if an odd number of inputs are 1.