CSE-221 Digital Logic Design (DLD)
description
Transcript of CSE-221 Digital Logic Design (DLD)
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
1
CSE-221Digital Logic Design (DLD)
Lecture-2: Logic Operations & Digital
Logic Gates
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
2
Analog: values vary over a broad range continuously
Digital: only discrete values
+5
V
–5
1 0 1
Time
+5 V
–5
Time
Analog vs. Digital
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
3
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&E-221,TLDD2)
4
Analog systems:
Limited precision, errors accumulate, drift
Interface circuits (i.e., sensors & actuators) often analog
Analog vs. Digital Systems
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&E-221,TLDD2)
5
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 startAND Operator
Truth Table
0 0 0A B Output
0 1 01 0 01 1 1
• 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&E-221,TLDD2)
6
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:
For digital logic:
True = 1 is 5 voltsFalse = 0 is 0 volts
AInputs
B
Output
• Practice with the Excel spreadsheet
• 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
OR Operator
0 0 0A B Output
0 1 11 0 11 1 1
OR OperatorTruth Table
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
7
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 electrical schematic:
0 0 0A B Output
0 1 11 0 11 1 0
A
InputsOutput
B
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
8
Multi-Input AND Gate• AND gates can be built with any number of inputs• Consider the symbol for the 4-input AND gate
• 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
ABCD
F
• All digital computers are built using only three gate types: AND, OR, and NOT
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
9
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
• The number of inputs could be increased by using more and more AND gates
AND
AND
AND 1
1
1
1
1
1
1
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
10
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?
AND
AND
AND
1
11
1
1
1
1
0
0
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
11
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
12
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 12) 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.
13
6/16/2004 P.B-Dr M.A.kashem(CS&E-221,TLDD2)
14