elec1111 11 digital logic
DESCRIPTION
.TRANSCRIPT
1
Electrical Engineering & Telecommunications
Lecturer:Ted Spooner
Lecture -Introduction to Digital Logic
Elec1111Elec1111
Rm 124A EE email: [email protected]
Book
• Katz and Borriello, “Contemporary Logic Design”, Prentice Hall, 2nd ed, 2005
• alternative:– Wakerly, “Digital Design: principles and
practices”, Prentice Hall, 4th ed, 2005
Typical electronic systems Analogue and digital signals
• Analogue– continuous– physical
• Digital– discrete– “symbolic”
2
Noise in analogue signals
• Loose information below noise level• Linear, accurate systems expensive
– minimise use
Noise in digital signals
• Can be regenerated error-free(usually)• Accuracy arbitrary (number of levels / bits)• Exact computations
Two-level logic
• Almost universal• Voltage encoding• • Level values:
– technology dependant
– power supply dependant
Two-level logic II
• Transfer fun. + gap:• – ensures good noise
margin• Notation:
– Highlow (voltage)– Truefalse (Boolean)– 1-0 (binary digit)
3
Why use digital?• Good noise reject.• High reliability• Low drift• High accuracy• Predictable• Low power• Ease of design• Design tools
Why not to use– generates noise– D/A interface costly
Disrete digital components
• Quad 2input NOR 74LS02
Digital technologies
• Discrete– CMOS, TTL, ECL
• FPGA• ASIC
– CMOS, GaAs
Combinational / sequential
• Combinational– output is logic
• function of inputs– no memory
• Sequential– output is logic
• function of inputs and state– memory
4
Truth tables
• Exhaustive description of output for all possible inputs
• Example– Phone rings (R=1) if power
on (P=1) and incoming call (C=1)
2N combinations forN inputs
Assigning logic variables
• Assign logic variable to precise statement• Example: David’s purchase
– He buys if he wants an item and has cash or if he needs it and has cash or card
– David needs item (N=1)– David wants item (W=1)– David has sufficient cash for purchase (C=1)– David has brought his EFTPOS card (E=1)– David buys the item (B=1)
David’ s purchase truth table
• N: needs• W: wants• C: cash• E: eftpos• B: buys
Primitive gates
• A logic gate:– implements a
combinational logic function
• – 22^N possible functions of N variables
• – All can be described using primitive gates
• Two-input gates– and (2 input)– or– not– xor– nand, nor, xnor– also other types
(16)
5
Logical AND operation
YX
Z
AND gate
Z X Y= ⋅Z XY=
Z=1 if both X and Y are 1
0 0 00 1 01 0 01 1 1
X Y Z
AND truth table
Logicalmultiplication
Z = X and Y
Logical OR operation
Z X Y= +
Z=1 if X or Y or both are 1
0 0 00 1 11 0 11 1 1
X Y Z
OR truth table
Logicaladdition
Y
XZ
OR gate
Z = X or Y
NOT operation(negation, complement)
Z X=
0 11 0
X Z
NOT truth table
X Z
NOT gate (inverter)
(also X’, /X or \X)
Z = not X
Also called Inversion, Negation, Complement
NAND function (not AND)
YX
Z
NAND gate
Z=1 if X is 0 or Y is 0
0 0 10 1 11 0 11 1 0
X Y Z
NAND truth table
)'(
.
XYZXYZ
YXZ
XandYZ
==
=
=
6
Drawing conventions
XY
X.YX.Y X
YX.Y
Bubbles invert signal
X
Y
X
YX+Y
Inverted input signified by a bubble on the input….eg:
NOR function (not OR)
Z=1 if both X and Y are 0
0 0 10 1 01 0 01 1 0
X Y Z
NOR truth table
Y
XZ
NOR gate
)'( YXZYXZ
XorYZ
+=+=
=
XOR function (exclusive OR)
Z=1 if X has a different value from Y
0 0 00 1 11 0 11 1 0
X Y Z
XOR truth table
Y
XZ
XOR gate
YXZYZ
⊕== xor X
XNOR function (NOT exclusive OR)
Z=1 if X and Y are the same
0 0 00 1 11 0 11 1 0
X Y Z
XNOR truth table
Y
XZ
XNOR gate
)'(
xnor X
YXZYXZ
YZ
⊕=⊕=
=
7
Gates with more than 2 inputs
T X Y Z= + +YX
Z
3-input NOR gate
T
BA
Z
4-input AND gate
CD
Z A B C D= ⋅ ⋅ ⋅
Combining primitive gatesExample XOR
ABBABA ).( +=⊕–as truth tables are identical
Combining primitive gates II
• Primitive gates can implement any logic function
• – 2 input nand can!
David’ s purchase logic
• B = N(C+E)+WC
8
Necessary logic operators• Any function expressed by NOT, AND & OR
C
CB.
Example
• Draw the logic diagram represented by:
CBAZ .+=
CBAZ .+=
Draw a truth table for the logic:
111011101001110010100000
MXCBA