EE203 02 Logic Gates

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

EE203 Digital Design

2. Logic Gates

Instructor: Dr. Abdulkadir Köse


EE203 Digital Design
Logic Gates

 Inverter

 AND

 OR

 NAND  AB

 NOR  A B

X  A  B  AB  A B
 XOR
EE203 Digital Design 2
Inverter

Input Output

Inversion

 Inversion, complementation
 Not circuit
 Changes 1 to 0 and 0 to 1.

EE203 Digital Design 3


 Boolean algebra
 Mathematical theory of logic
 English mathematician George Boole, 1854
 Logic expression of an inverter
“A bar” or “Not A”

 Example application: 1’s complement

EE203 Digital Design 4


AND Gate

 Multiple inputs and one output Three-input AND gate


 Output is 1 only when all of the
inputs are 1.
 Any of the inputs is 0  output is 0.

Two-input
AND gate

EE203 Digital Design 5


 AND: Boolean multiplication
 Logic expression
X = A • B or X = AB

 Application example
 Masking. E.g. Clear right four bits.
 Mask: 11110000
 Input: 10100101
 ‘Mask’ (bitwise) AND ‘Input’  10100000

EE203 Digital Design 6


Bitwise Mask Example
11000000 10101000 00000001 00000010
AND
11111111 11111111 11111111 00000000
-------------------------------------------------------
11000000 10101000 00000001 00000000
 192.168.1.0

EE203 Digital Design 7


AND Gate Example
- Seatbelt alarm circuit
Example: Suppose that we want to design a simple
automobile seat belt alarm system by using AND gate. The
system shall activate an audible alarm to remind the driver
when the ignition switch is on for 30 s the seat belt is
unbuckled.

EE203 Digital Design 8


AND Gate Example
- Seatbelt alarm circuit

EE203 Digital Design 9


OR Gate

 Multiple inputs and one output


Three-input OR gate
 Output is 1 if any of the inputs is 1.
 Only when all inputs are 0, output is 0.

1
1
1
1
Two-input 1
OR gate 1

EE203 Digital Design 10


 OR: Boolean addition
 Logic expression
X=A+B

 Application example
 Masking. E.g. Setting right four bits.
 Mask: 00001111
 Input: 10100101
 ‘Mask’ (bitwise) OR ‘Input’  10101111

EE203 Digital Design 11


OR Gate Example
- Intrusion detection system
Example: Assume a simplified portion of an intrusion detection and
alarm system. This system could be used for one room in a home—a
room with two Windows and a door. The sensors are magnetic switches
that produce a HIGH output when open and a LOW output when closed.

When one of the windows or the door is opened, it then activates and
latches an alarm circuit to warn of the intrusion.

EE203 Digital Design 12


OR Gate Example
- Intrusion detection system

EE203 Digital Design 13


Timing Diagram

EE203 Digital Design 14


NAND Gate
 AB

• Output is 0 only when all inputs are 1.


• If any of the inputs is 0, output is 1. Three-input NAND gate
• Universal gate

1
1
1
Two-input 1
NAND gate 1
1
1
0

EE203 Digital Design 15


Negative-OR is equal to NAND

00 1 0  0 1
0 1  1 0  1 1
1 0  1 1  0 1
1 1  0 11 0

EE203 Digital Design 16


Universal Application of NAND Gate

EE203 Digital Design 17


EE203 Digital Design 18
NAND Gate Example
- Tank level indicator system

EE203 Digital Design 19


NOR Gate

 A B

• Output is 0 if any of the inputs is 1.


• Only when all inputs are 0, output is 1. Three-input NOR gate
• Universal gate

1
0
0
Two-input 0
0
NOR gate
0
0
0
EE203 Digital Design 20
Negative-AND is equal to NOR

0 0 1 00 1
0 1  0 01  0
1 0  0 10  0
11  0 11  0

EE203 Digital Design 21


Universal Application of NOR Gate

EE203 Digital Design 22


EE203 Digital Design 23
NOR Gate Example
- Landing gear indicator system

EE203 Digital Design 24


Exclusive-OR (XOR) Gate

X  A  B  AB  A B

• Two inputs and one output.


• Output is 1 only when two inputs are different.
• Output is 0 if two inputs are the same.
• Adder without a carry bit.

EE203 Digital Design 25


Exclusive-NOR (XNOR) Gate

X  A  B  AB  A B

• Two inputs and one output.


• Output is 1 only when two inputs are the same.
• Output is 0 if two inputs are different.

EE203 Digital Design 26


Design Example 1
 Automatic outdoor lighting (A) is on (high) when
 Outdoor light sensor (O) indicates dark (low) AND
 Power saving mode (B) is off (low)
OR
 Outdoor light switch (S) is on (high)

A = f(O, B, S)

EE203 Digital Design 27


Design Example 2
 A lamp (L) is on (high) when an odd number of switches are on
(high). There are three switches (A, B, and C) in the room.

L = f(A, B, C)

EE203 Digital Design 28


THANK YOU

ANY QUESTIONS?

Acknowledgment: Slides adapted from Dr. Dooyoung Hah’s lecture notes.

EE203 Digital Design 29

You might also like