You are on page 1of 20

CSE-212

Logic Functions
Contents
• What are Logic gates
• Different types of Logic gates
• Universality of universal logic gates
What is Logic gate?
• Logic gates are the basic building blocks of any digital system.

• A circuit that performs a specific logic operation (AND, OR) is


called a logic gate.

• It is an electronic circuit having one or more inputs and only


one output.

• Basic logic gates are AND gate, OR gate, NOT gate etc.
Logic gates
• Primary logic gates
– AND Gate
– OR Gate
– NOT Gate

• Universal gates
– NAND Gate
– NOR Gate

• Special gates
– XOR Gate
– XNOR Gate
AND Gate
A circuit which performs an AND operation. It has n input (n >= 2) and
one output.

Logic diagram Truth Table


OR Gate
A circuit which performs an OR operation. It has n input (n >= 2) and one
output.

Logic diagram Truth Table


NOT Gate
A circuit which performs an NOT operation. It has one input and one
output.

Logic diagram Truth Table


Universal logic gates
A universal gate is a gate which can implement
any Boolean function without need to use any
other gate type. The NAND and NOR gates are
universal gates. In practice, this is advantageous
since NAND and NOR gates are economical and
easier to fabricate(to build-up) and are the
basic(primary) gates used in all IC
digital logic families.
Universal logic gates
• NAND Gate
A NOT-AND operation is known as NAND operation. It has n input (n >= 2)
and one output.

Logic diagram Truth Table


Universal logic gates
• NOR Gate
A NOT-OR operation is known as NOR operation. It has n input (n >= 2) and
one output.

Logic diagram Truth Table


Gate Universality – NAND gate as NOT gate

In one NAND gate when all inputs are same it


woks as NOT gate. Figure shows a NAND gate
working as NOT gate.
X= =
Gate Universality – NAND gate as AND gate

To work as AND gate it requires 2 NAND gates.


Figure shows a NAND gate working as AND gate.
X = = A.B
Gate Universality – NAND gate as OR gate

To work as OR gate it requires 3 NAND gates.


Figure shows a NAND gate working as AND gate.
X = = = A+B
Gate Universality – NOR gate
XOR Gate
XOR or Ex-OR gate is a special type of gate. It can be used in the half
adder, full adder and subtraction. The exclusive-OR gate is abbreviated as
EX-OR gate or sometime as X-OR gate. It has n input (n >= 2) and one
output.

Logic diagram Truth Table


XNOR Gate
XNOR gate is a special type of gate. It can be used in the half adder, full
adder and subtraction. The exclusive-NOR gate is abbreviated as EX-NOR
gate or sometime as X-NOR gate. It has n input (n >= 2) and one output.

Logic diagram Truth Table


Boolean Algebra
A B A+B
0 0 0
0 1 1 A
1 0 1 0 1
1 1 1 1 0

A B A.B
0 0 0
0 1 0
1 0 0
1 1 1
DeMorgan's Theorem
• French mathematician DeMorgan formulated 2
theorems in 1953 & they are known as DeMorgan’s
Theorems.
• For 2 variables A & B,
=
=
• For 3 variables A, B & C
=
=
DeMorgan's Theorem
DeMorgan's Theorem

You might also like