Download 370 lectures

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
Apps
O/S
Arch
mArch
Logic
Elementary Digital Logic
Digital
Analog
Devices
Physics
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
Variables and Transistors (Switches)
• Digital systems use binary logic
– Two values: 0 and 1 (or false and true if you like)
• Transistors are essentially a switch controlled by a
single binary variable x
x = 0
• A generic symbol for a switch is
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
x = 1
S
x
Dan Ernst
Switches and Functions
Power
supply
S
S
x1
x2
L
logical AND function (series connection)
S
x1
Power
supply
S
L
x2
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
logical OR function (parallel connection)
Dan Ernst
Switches and Functions (2)
• Can do more complex logic, too: L(x1,x2,x3) = (x1 + x2) x3
S
Power
supply
x1
S
S
x3
L
x2
• Don’t get the idea that this is the actual physical way it is done
– This is just an abstraction
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
Seven Common Logic Primitives
•
•
•
•
•
•
•
AND
OR
NOT (complement, inversion)
NAND
NOR
XOR
XNOR
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
How do we make gates?
• These standard logic gates can be implemented in many technologies:
– Relay Switches
• Huge and extremely power-hungry
– Vacuum Tubes
• Still huge, but much faster – prone to burn-out
– “Individually-wrapped” transistors
• Small and fast
– IC packages
• Good for small circuits
– Very Large Scale Integrated circuits (VLSI)
– Legos!
• http://goldfish.ikaruga.co.uk/logic.html
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
Universal Logic Families
Universal Logic Families:
– Any logic function can be designed using one of these sets of gates:
• {AND, OR, NOT}
• {NAND}
• {NOR}
– These are called “universal logic families”
– Actual synthesized circuits are usually designed using either NAND or NOR gates only
• Remember Regularity
– We’ll use {AND, OR, NOT} since it is easier to do “on paper”
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
Digital Design Process
Apps
O/S
Arch
mArch
Logic
• How do you build a digital logic circuit?
– Represent all inputs and outputs in binary
• Create a model / representation for the system
– Formalize the design in a truth table or in an algebraic
expression
• Defines the function of the system
Digital
Analog
– Simplify the description  simplify the algebraic expression
• Ex: X ( X + Y ) = X
Devices
Physics
– Implement the system with available components (gates)
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
XOR
Using only {AND,OR,NOT}
C = AB + AB
A
B
0
0
0
1
1
0
1
1
C
(Boolean algebra representation)
A
C
B
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
Converting Boolean Algebra into Gates
• C = SA + SB
A
C
B
S
• What does this device do?
– When S = 0  C = A
– When S = 1  C = B
• A steering device: S steers/switches A or B onto the output C
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
2x1 MUX (Multiplexor)
•
C = SA + SB
A
C
•
This is a 2x1 MUX
•
“Black box” version is
B
S
A
A
0
A
0
C
C
B
B
1
1
C
B
1
S
S
S
•
0
2 input by 1 bit of data multiplexor (steering device)
– 2 inputs requires a 1 bit selector S
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
MUX Question
• How many selection bits do we need for a:
– 4 input mux?
• 2 bits
– 8 input mux?
• 3 bits
– 6 input mux?
• 3 bits
– N input mux?
• ceil( log2(N))
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
Combinational Logic
• Changes in input values are reflected immediately (subject to the
speed of light and electrical delays) on the outputs
• Each gate has an associated “electrical delay”
• Delays are often ignored for the purpose of the logic design (but
not for the real implementation!)
• As soon as inputs change, the outputs change – no memory of
what happened before
–
(at least conceptually)
CS 352 : Computer Organization and Design
University of Wisconsin-Eau Claire
Dan Ernst
Related documents