Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 26

Basic Logic Gates

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

NOT GATE

~X

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

A NOT gate is sometimes ~~X=X referred to as an inverter because it inverts the input value

AND Gate

OR Gate

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 W Y W = X & Y Z = ~W = ~(X & Y) Z NOT-AND

NOR Gate

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

You might also like