Download CSE-221 Digital Logic Design (DLD)

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CSE-221
Digital Logic Design (DLD)
Lecture-2: Logic Operations
& Digital Logic Gates
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
1
Analog vs. Digital
V
V
+5
+5
1
0
1
Time
–5
Analog: values vary
over a broad range
continuously
6/16/2004
Time
–5
Digital: only discrete
values
P.B-Dr M.A.kashem(CS&E221,TLDD2)
2
Analog vs. Digital
• Analog devices process signal that can assume any value across a
continuous range and produce results that are also in continuous
form.
• Digital devices process signals that take on only two discrete
values such as 0 and 1 and produces output that can be
represented by 0 and 1.
• Examples
 Analog Devices: solid-state devices TV (except for digital TV),
Audio amplifier etc.
 Digital Devices: Computer, CD player, digital TV, digital cellular
phone, electronic calculator, and digital camera.
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
3
Analog vs. Digital Systems
Analog systems:

Limited precision, errors accumulate, drift

Interface circuits (i.e., sensors & actuators) often
analog
Digital systems:

More accurate and reliable

Readily available as self-contained, easy to cascade
building blocks

Computers use digital circuits internally
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
4
AND Operator
• Let’s look at the relationship between the semantic
and logical operator known as the AND operator
• Consider:
If the car is fueled AND the engine works,
then the engine will start
• AND means that both conditions
must be true in order for the
conclusion to be true
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
AND Operator
Truth Table
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
5
Digital AND
• We can build an electrical device that performs the logical AND
operation on voltage equivalents of logic values
• An AND gate has the electrical schematic:
A
Inputs
Output
B
• Practice with the Excel spreadsheet
OR Operator
• Another basic operator is the OR
• Consider:
If I have cash OR a credit card,
then I can pay the bill
• OR works such that the output is true, if
either of the two inputs is true
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
For digital logic:
True = 1 is 5 volts
False = 0 is 0 volts
OR Operator
Truth Table
A B Output
0
0
0
0
1
1
1
0
1
1
1
1
6
XOR (Exclusive OR) Operator
•
•
Let’s look at the relationship between the semantic and logical operator
known as the XOR operator
Consider a biological example:
If gender A XOR gender B,
then reproduction is possible
•
•
XOR works such that output is activated (equal to one) if both inputs are
of a different value
Try the Excel spreadsheet exercise
• We can build an electrical device that performs the logical XOR
operation on voltage equivalents of logic values
• An XOR gate has the
A B Output
electrical schematic:
A
Output
Inputs
B
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
0
0
1
1
0
1
0
1
0
1
1
0
7
Multi-Input AND Gate
• AND gates can be built with any number of inputs
• Consider the symbol for the 4-input AND gate
A
B
C
D
F
• F is true only when all the inputs are true (1’s)
• Using the Excel workbook “EE-WISE-Digital Lab”,
open the “Digital Locks” worksheet, and test this
circuit
• All digital computers are built using only three gate
types: AND, OR, and NOT
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
8
Digital Combination Lock
• Using 3 two-input AND gates, we could build a
combination lock that requires a four-digit code,
specifically: 1 1 1 1
1
AND
1
1
AND
1
1
AND
1
1
• The number of inputs could be increased by using
more and more AND gates
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
9
Digital Combination Lock
• We could build a combination lock that only uses the AND gate, but
that would be of little use since everyone would know our combination,
namely 1 1 1 1
• To build a more interesting combination lock, we will utilize the NOT
(inverter) gate
0
1
•
•
Let’s build a combination lock whose input (key code) combination is 0 1 1 0
Is there any other combination that works?
0
1
AND
1
1
1
AND
AND
0
6/16/2004
1
1
1
P.B-Dr M.A.kashem(CS&E221,TLDD2)
10
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
11
Each of the functions in Table 2-8 is listed with an
accompanying name and a comment that explains the
function in some way. The 16 functions listed can be
subdivided into three categories:
1) Two functions that produce a constant 0 or 1
2) Four functions with unary operations:
complement and transfer.
3) Ten functions with binary operators that
define eight different operations. AND, OR,
NAND, NOR, exclusive-OR, equivalence,
inhibition, and implication.
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
12
13
6/16/2004
P.B-Dr M.A.kashem(CS&E221,TLDD2)
14
Related documents