0% found this document useful (0 votes)
146 views43 pages

Presentation On Gates

1) Basic logic gates such as NOT, AND, OR, NAND, NOR, XOR and XNOR gates are used in digital circuits and systems. Their functions are defined by truth tables. 2) De Morgan's theorems can be used to transform logic gate expressions between sum of products and product of sums form. For example, ~(A&B) = ~A | ~B and ~(A|B) = ~A & ~B. 3) NOR and NAND gates can be used as universal gates to build other logic gate types. For example, a NOT gate can be built using a two input NOR gate by connecting both inputs together.

Uploaded by

Vikrant Bhaskar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views43 pages

Presentation On Gates

1) Basic logic gates such as NOT, AND, OR, NAND, NOR, XOR and XNOR gates are used in digital circuits and systems. Their functions are defined by truth tables. 2) De Morgan's theorems can be used to transform logic gate expressions between sum of products and product of sums form. For example, ~(A&B) = ~A | ~B and ~(A|B) = ~A & ~B. 3) NOR and NAND gates can be used as universal gates to build other logic gate types. For example, a NOT gate can be built using a two input NOR gate by connecting both inputs together.

Uploaded by

Vikrant Bhaskar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

Basic Logic Gates

Discussion D5.1 Section 8.6.2 Sections 13-3, 13-4

Basic Logic Gates and Basic Digital Design


NOT, AND, and OR Gates NAND and NOR Gates DeMorgans Theorem Exclusive-OR (XOR) Gate Multiple-input Gates

What is a gate?
Combination of transistors that perform binary logic So called because one logic state enables or gates another logic state For each gate, the symbol, the truth table, and the formula are shown
44

45

Truth Table
Logic diagram: a graphical representation of a circuit
Each type of gate is represented by a specific graphical symbol

Truth table: defines the function of a gate by listing all possible input combinations that the gate could encounter, and the corresponding output
46

NOT Gate -- Inverter


NOT X Y = ~X Y

X 0 1

Y 1 0

NOT
Y = ~X Y = !X Y = not X Y = X Y = X Y = X not(Y,X) (Verilog) (ABEL) (VHDL)

(textook) (Verilog)

NOT
X ~X ~~X = X

X ~X ~~X 0 1 0 1 0 1

AND Gate
AND X Z Y Z = X & Y X 0 0 1 1 Y 0 1 0 1 Z 0 0 0 1

AND
X & Y (Verilog and ABEL) X and Y (VHDL) X Y X Y X * Y XY (textbook) and(Z,X,Y) (Verilog)
U V

OR Gate
OR X Y Z = X | Y Z X 0 0 1 1 Y 0 1 0 1 Z 0 1 1 1

OR
X | Y X # Y X or Y X + Y X V Y X U Y or(Z,X,Y) (Verilog) (ABEL) (VHDL) (textbook)

(Verilog)

Basic Logic Gates and Basic Digital Design


NOT, AND, and OR Gates NAND and NOR Gates DeMorgans Theorem Exclusive-OR (XOR) Gate Multiple-input Gates

NAND Gate
NAND X Z Y Z = ~(X & Y) nand(Z,X,Y) X 0 0 1 1 Y 0 1 0 1 Z 1 1 1 0

NAND Gate
NOT-AND
X W Y W = X & Y Z = ~W = ~(X & Y) Z X 0 0 1 1 Y 0 1 0 1 W 0 0 0 1 Z 1 1 1 0

NOR Gate
NOR X Y Z X 0 0 1 1 Y 0 1 0 1 Z 1 0 0 0

Z = ~(X | Y) nor(Z,X,Y)

NOR Gate
NOT-OR X Y W = X | Y Z = ~W = ~(X | Y) W Z X 0 0 1 1 Y 0 1 0 1 W 0 1 1 1 Z 1 0 0 0

Basic Logic Gates and Basic Digital Design


NOT, AND, and OR Gates NAND and NOR Gates DeMorgans Theorem Exclusive-OR (XOR) Gate Multiple-input Gates

NAND Gate
X Y Z = ~(X & Y) X 0 0 1 1 Y 0 1 0 1 W 0 0 0 1 Z 1 1 1 0 Z =

X
Y Z = ~X | ~Y X 0 0 1 1 Y ~X ~Y 0 1 1 1 1 0 0 0 1 1 0 0 Z 1 1 1 0

De Morgans Theorem-1
~(X & Y) = ~X | ~Y
NOT all variables Change & to | and | to & NOT the result

NOR Gate
X
Y Z X Z Y

Z = ~(X | Y) X 0 0 1 1 Y 0 1 0 1 Z 1 0 0 0

Z = ~X & ~Y
X 0 0 1 1 Y ~X ~Y 0 1 1 1 1 0 0 0 1 1 0 0 Z 1 0 0 0

De Morgans Theorem-2
~(X | Y) = ~X & ~Y
NOT all variables Change & to | and | to & NOT the result

De Morgans Theorem
NOT all variables Change & to | and | to & NOT the result -------------------------------------------~X | ~Y = ~(~~X & ~~Y) = ~(X & Y) ~(X & Y) = ~~(~X | ~Y) = ~X | ~Y ~X & !Y = ~(~~X | ~~Y) = ~(X | Y) ~(X | Y) = ~~(~X & ~Y) = ~X & ~Y

Basic Logic Gates and Basic Digital Design


NOT, AND, and OR Gates NAND and NOR Gates DeMorgans Theorem Exclusive-OR (XOR) Gate Multiple-input Gates

Exclusive-OR Gate
XOR X Z Y Z = X ^ Y xor(Z,X,Y)

X Y
0 0 1 1 0 1 0 1

Z
0 1 1 0

XOR
X ^ Y X $ Y X @ Y
X Y

(Verilog) (ABEL)
(textbook)

xor(Z,X,Y)

(Verilog)

Exclusive-NOR Gate
XNOR X Y
Z = ~(X ^ Y)

X Y
Z 0 0 1 1 0 1 0 1

Z
1 0 0 1

Z = X ~^ Y xnor(Z,X,Y)

XNOR
X ~^ Y !(X $ Y) X @ Y
X Y

(Verilog) (ABEL)

xnor(Z,X,Y)

(Verilog)

Basic Logic Gates and Basic Digital Design


NOT, AND, and OR Gates NAND and NOR Gates DeMorgans Theorem Exclusive-OR (XOR) Gate Multiple-input Gates

Multiple-input Gates
Z1 Z2

Z3

Z4

Multiple-input AND Gate


Z1

Output Z 1 is HIGH only if all inputs are HIGH An open input will float HIGH

Multiple-input OR Gate
Z2

Output Z 2 is LOW only if all inputs are LOW

Multiple-input NAND Gate


Z3

Output Z 3 is LOW only if all inputs are HIGH

Multiple-input NOR Gate


Z4

Output Z 4 is HIGH only if all inputs are LOW

How to use
B

NOR gate to build a NOT gate?


Truth Table

A B C Q
Q

A
C

0 0 0 1
1 1 1 0

Hint! Link inputs B & C together (to a same source).


436

When A = 0, B = C = A = 0 When A = 1, B = C = A = 1

How to use
NOR A B

NOR gates to build an OR gate?


Truth Table NOT C D Q E

A 0 0 1 1

B 0 1 0 1

C 1 0 0 0

D 1 0 0 0

E 1 0 0 0

Q 0 1 1 1

Hint 1 : Use 2 NOR gates Hint 2 : From a NOR gate, build a NOT gate
437

Hint 3 : Put this NOT gate after a NOR gate

How to use
A

NOR gates to build an AND gate?


Truth Table C Q

B Hint 1 : Use 3 NOR gates

A 0 0 1 1

B 0 1 0 1

C 1 1 0 0

D 1 0 1 0

Q 0 0 0 1

Hint 2 : From 2 NOR gates, build 2 NOT gates Hint 3438 : Each NOT gate is an input to the 3rd NOR gate

How to use
A C D

NOR gates to build a NAND gate?


E Truth Table

Hint 1 : Use 4 NOR gates Hint 2 : Use 3 NOR gates to build a NAND gate
(previous lesson)

A 0 0 1 1

B 0 1 0 1

C 1 1 0 0

D 1 0 1 0

E 0 0 0 1

Q 1 1 1 0

Hint 3 : Use the 4th NOR gate to build a NOT gate Hint 4 : Insert NOT gate after NAND gate

Hint 5 : NOT-NAND = AND

439

How to use
B A C

NAND gates to build a NOT gate?


Truth Table

A
Q

B 0 1

C 0 1

Q 1 0

0 1

Hint! Link inputs B & C together (to a same source).


440

When A = 0, B = C = A = 0 When A = 1, B = C = A = 1

How to use
NAND A B

NAND gates to build an AND gate?


Truth Table B 0 1 0 1 1 1 NOT C A 0 0 Q 1 C Q 0 0 0

Hint 1 : Use 2 NAND gates Hint 2 : From a NAND gate, build a NOT gate Hint 3 : Put this NOT gate after a NAND gate Hint 4 441 : NOT-NAND = AND

How to use
A B

NAND gates to build an OR gate?


Truth Table B 0 1 0 C 1 1 0 C Q D A 0 0 1 D 1 0 1 Q 0 1 1

Hint 1 : Use 3 NAND gates Hint 2 : Use 2 NAND gates to build 2 NOT gates Hint 3 : Put the 3rd NAND gate after the 2 NOT gates 442

How to use
A B C D

NAND gates to build a NOR gate?


Truth Table C 1 1 0 0 D 1 0 1 0 E Q A 0 0 1 1 B 0 1 0 1 E 0 1 1 1 Q 1 0 0 0

Hint 1 : Use 4 NAND gates Hint 3 : Use a NOR gate to build a NOT gate Hint 4 443 the NOT gate after OR gate : Put

Hint 2 : Use 3 NAND gates to build an OR gate

You might also like