PPT - ECE/CS 352 On

Download Report

Transcript PPT - ECE/CS 352 On

ECE/CS 352: Digital System Fundamentals
Lecture 4 – Binary Logic
and Logic Gates
Based on slides by:Charles Kime & Thomas Kaminski
© 2004 Pearson Education, Inc.
Outline





Binary Logic and Variables
Logical Operations
Truth Tables
Logic Implementation
Logic Gates
Chapter 1
2
Binary Logic and Gates
 Binary variables take on one of two values.
 Logical operators operate on binary values and
binary variables.
 Basic logical operators are the logic functions
AND, OR and NOT.
 Logic gates implement logic functions.
 Boolean Algebra: a useful mathematical system
for specifying and transforming logic functions.
 We study Boolean algebra as foundation for
designing and analyzing digital systems!
Chapter 1
3
Binary Variables
 Recall that the two binary values have
different names:
• True/False
• On/Off
• Yes/No
• 1/0
 We use 1 and 0 to denote the two values.
 Variable identifier examples:
• A, B, y, z, or X1 for now
• RESET, START_IT, or ADD1 later
Chapter 1
4
Logical Operations
 The three basic logical operations are:
• AND
• OR
• NOT
 AND is denoted by a dot (·).
 OR is denoted by a plus (+).
 NOT is denoted by an overbar ( ¯ ), a
single quote mark (') after, or (~) before
the variable.
Chapter 1
5
Notation Examples
 Examples:
• Y = A ×B is read “Y is equal to A AND B.”
• z = x + y is read “z is equal to x OR y.”
• X = A is read “X is equal to NOT A.”
 Note: The statement:
1 + 1 = 2 (read “one plus one equals two”)
is not the same as
1 + 1 = 1 (read “1 or 1 equals 1”).
Chapter 1
6
Operator Definitions
 Operations are defined on the values
"0" and "1" for each operator:
AND
0·0=0
0·1=0
1·0=0
1·1=1
OR
NOT
0+0=0
0+1=1
1+0=1
1+1=1
0=1
1=0
Chapter 1
7
Truth Tables
 Truth table - a tabular listing of the values of a
function for all possible combinations of values on its
arguments
 Example: Truth tables for the basic logic operations:
X
0
0
1
1
AND
Y Z = X·Y
0
0
1
0
0
0
1
1
X
0
0
1
1
Y
0
1
0
1
OR
Z = X+Y
0
1
1
1
NOT
X
0
1
Z=X
1
0
Chapter 1
8
Logic Function Implementation
 Using Switches
Switches in parallel => OR
• For inputs:
 logic 1 is switch closed
 logic 0 is switch open
• For outputs:
 logic 1 is light on
 logic 0 is light off.
Switches in series => AND
• NOT uses a switch such
Normally-closed switch => NOT
C
 logic 1 is switch open
 logic 0 is switch closed
that:
Chapter 1
9
Logic Function Implementation (Continued)
 Example: Logic Using Switches
B
C
A
D
 Light is on (L = 1) for
L(A, B, C, D) = A ((B C') + D) = A B C' + A D
and off (L = 0), otherwise.
 Useful model for relay circuits and for CMOS
gate circuits, the foundation of current digital
logic technology
Chapter 1
10
Logic Gates
 In the earliest computers, switches were opened
and closed by magnetic fields produced by
energizing coils in relays. The switches in turn
opened and closed the current paths.
 Later, vacuum tubes that open and close
current paths electronically replaced relays.
 Today, transistors are used as electronic
switches that open and close current paths.
Chapter 1
11
Logic Gates (continued)
 Implementation of logic gates with transistors (See
Reading Supplement - CMOS Circuits)
+V
+V
•
•
•
•
••
•
F
X
Y
•
•
X
G = X +Y
•
•
X .Y
•
X
•
+V
•
X
Y
•
•
•
(a) NOR
(b) NAND
(c) NOT
 Transistor or tube implementations of logic functions are
called logic gates or just gates
 Transistor gate circuits can be modeled by switch circuits
Chapter 1
12
Logic Gate Symbols and Behavior
 Logic gates have special symbols:
X
Z 5 X ·Y
Y
X
Z5 X1 Y
Y
X
NOT gate or
inverter
OR gate
AND gate
Z5 X
(a) Graphic symbols
 And waveform behavior in time as follows:
X
0
0
1
1
Y
0
1
0
1
X ·Y
0
0
0
1
(OR)
X1 Y
0
1
1
1
(NOT)
X
1
1
0
0
(AND)
(b) Timing diagram
Chapter 1
13
Logic Diagrams and Expressions
Truth Table
XYZ
000
001
010
011
100
101
110
111
F = X + Y ×Z
0
1
0
X
0
1
Y
1
1
Z
1
Equation
F = X +Y Z
Logic Diagram
F
 Boolean equations, truth tables and logic diagrams describe
the same function!
 Truth tables are unique; expressions and logic diagrams are
not. This gives flexibility in implementing functions.
Chapter 1
14
Summary





Binary Logic and Variables
Logical Operations
Truth Tables
Logic Implementation
Logic Gates
Chapter 1
15
Terms of Use
 © 2004 by Pearson Education,Inc. All rights reserved.
 The following terms of use apply in addition to the standard
Pearson Education Legal Notice.
 Permission is given to incorporate these materials into classroom
presentations and handouts only to instructors adopting Logic and
Computer Design Fundamentals as the course text.
 Permission is granted to the instructors adopting the book to post
these materials on a protected website or protected ftp site in
original or modified form. All other website or ftp postings,
including those offering the materials for a fee, are prohibited.
 You may not remove or in any way alter this Terms of Use notice
or any trademark, copyright, or other proprietary notice,
including the copyright watermark on each slide.
 Return to Title Page
Chapter 1
16