Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr. Ameria Eldosoky Discrete mathematics

Similar presentations


Presentation on theme: "Dr. Ameria Eldosoky Discrete mathematics"— Presentation transcript:

1 Dr. Ameria Eldosoky Discrete mathematics

2 Basic Logic Gates

3 Basic Logic Gates and Basic Digital Design
NOT, AND, and OR Gates NAND and NOR Gates DeMorgan’s Theorem Exclusive-OR (XOR) Gate Multiple-input Gates

4 Introduction to Basic Logic Gates
Hardware consists of a few simple building blocks These are called logic gates AND, OR, NOT, … NAND, NOR, XOR, … Logic gates are built using transistors NOT gate can be implemented by a single transistor AND gate requires 3 transistors Transistors are the fundamental devices Pentium consists of 3 million transistors Compaq Alpha consists of 9 million transistors Now we can build chips with more than 100 million transistors

5 Basic Gates Simple gates
AND OR NOT Functionality can be expressed by a truth table A truth table lists output for each possible input combination

6 AND Gate AND X Y Z X Z Y Z = X + Y

7 OR Gate OR X Y Z X Z Y Z = X | Y

8 NOT X ~X ~~X = X X ~X ~~X

9 NOT Gate -- Inverter X Y 1 1

10 Additional useful gates
NAND NOR XOR NAND = AND + NOT NOR = OR + NOT XOR implements exclusive-OR function NAND and NOR gates require only 2 transistors AND and OR need 3 transistors!

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

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

13 NOR Gate NOR X Y Z 0 0 1 0 1 0 X 1 0 0 Z 1 1 0 Y Z = ~(X | Y)
X Z Y Z = ~(X | Y) nor(Z,X,Y)

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

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

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

17 NOR Gate X X Z Z Y Y Z = ~(X | Y) Z = ~X & ~Y X Y Z X Y ~X ~Y Z 0 0 1
X Y ~X ~Y Z

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

19 De Morgan’s 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

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

21 Exclusive-NOR Gate XNOR X Y Z X Z 0 0 1 Y 0 1 0 1 0 0 1 1 1 Z = X ~^ Y
0 0 1 Y 0 1 0 Z = ~(X ^ Y) Z = X ~^ Y xnor(Z,X,Y) 1 0 0 1 1 1


Download ppt "Dr. Ameria Eldosoky Discrete mathematics"

Similar presentations


Ads by Google