Download Gate - UUOOI

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

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

Document related concepts

Signal-flow graph wikipedia , lookup

Ground loop (electricity) wikipedia , lookup

Electronic engineering wikipedia , lookup

Heterodyne wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Control system wikipedia , lookup

Buck converter wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Flexible electronics wikipedia , lookup

Transistor wikipedia , lookup

Power MOSFET wikipedia , lookup

Schmitt trigger wikipedia , lookup

Flip-flop (electronics) wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Regenerative circuit wikipedia , lookup

Integrated circuit wikipedia , lookup

TRIAC wikipedia , lookup

Rectiverter wikipedia , lookup

CMOS wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
Hardware Layer
Lecture 4: Gates and Circuits
Layers of Computing Systems
Communications
Applications
Operating Systems
Programming
Hardware
Information
Hardware
Background
• What are Computers?
–electronic devices;
–the most fundamental hardware
elements of a computer control the
flow of electricity.
• 87
Agenda
• Explore how computers use electric
signals to represent and manipulate those
binary values
– Electronic signal
– Basic hardware
– Boolean algebra
Electronic signal, 0s and 1s
• Any given electronic signal has a level of
voltage.
voltage level 0 to 2 volts
“low”
voltage level 2 to 5 volts
“high”
binary 0
binary 1
• Signals in a computer are constrained to be
within one range or the other.
Basic hardware
• Gate - A device that
performs a basic operation
on electrical signals,
accepting one or more
input signals and producing
a single output signal
– There are six most
fundamental types
– Each type of gate
performs a particular
logical function.
Basic hardware
• Circuit - A combination of interacting gates
designed to accomplish a specific logical
function
– circuits can be designed to perform arithmetic
and to store values.
– the output value of one gate often serves as
an input value for one or more other gates.
– The flow of electricity through a circuit is
controlled by the carefully designed logic of
the interacting gates.
Gates and Circuits:
Notational methods
• There are three different, but equally
powerful, notational methods for describing
the behavior of gates and circuits:
1. Boolean expressions
2. Logic diagrams
3. Truth tables
1. Boolean algebra
Boolean expressions
• An English mathematician named George
Boole invented a form of algebra in which
variables and functions take on only one of
two values (0 and 1).
• Specific operations and properties in Boolean
algebra allow us to define and manipulate
circuit logic using a mathematical notation.
• OR gate boolean expression: X=A+B
2. Logic diagram
• …is a graphical representation of a circuit.
Each type of gate is represented by a specific
graphical symbol.
• By connecting those symbols in various ways
we can visually represent the logic of an entire
circuit.
• OR gate logic diagram:
3. Truth table
• defines the function of a gate by listing all
possible input combinations that the gate
could encounter, and the corresponding
output.
• OR gate truth table:
OR gate
1. X=A+B
2.
3.
6 most fundamental gate types
•
•
•
•
•
•
NOT
AND
OR
XOR
NAND
NOR
6 most fundamental gate types
NOT gate inverts its single input value.
AND gate produces 1 if both input values are 1.
6 most fundamental gate types
OR gate produces 1 if one or the other or both input
values are 1.
XOR gate produces 1 if one or the other (but not both)
input values are 1.
6 most fundamental gate types
NAND gate produces the opposite results of an
AND gate.
NOR gate produces the opposite results of an
OR gate.
Let’s practice!
Symbol
Boolean Expression Q = A.B
Truth Table
A
B
Q
0
0
0
0
1
0
1
0
0
1
1
1
Read as A AND B gives Q
Let’s practice!
Symbol
Boolean Expression Q = A+B
Truth Table
A
B
Q
0
0
0
0
1
1
1
0
1
1
1
1
Read as A OR B gives Q
Let’s practice!
Symbol
Boolean Expression Q = NOT A or A
Truth Table
A
Q
0
1
1
0
Read as inversion of A gives Q
Let’s practice!
Symbol
Boolean Expression Q = (A .B)’
Truth Table
A
B
Q
0
0
1
0
1
1
1
0
1
1
1
0
Read as A AND B gives NOT-Q
Let’s practice!
Symbol
Boolean Expression Q = (A+B)’
Truth Table
A
B
Q
0
0
1
0
1
0
1
0
0
1
1
0
Read as A OR B gives NOT-Q
Let’s practice!
Symbol
Boolean Expression Q = A
Truth Table
B
A
B
Q
0
0
0
0
1
1
1
0
1
1
1
0
Gates with more inputs
• Same rules apply but now to three inputs
ABC
Constructing gates
• Gate uses one or more transistors to establish how the
input values map to the output value
• A transistor is a device that acts, depending on the
voltage level of an input signal, either as a wire that
conducts electricity or as a resistor that blocks the flow of
electricity.
– A transistor has no moving parts, yet acts like a switch.
– Transistor can switch states in a few nanoseconds.
Constructing gates
Transistor NOT gate video
• Videos
Evolution of microprocessors
• Video
Basic principles of electricity
• An electrical signal has a source, such as a
battery or an outlet in your wall.
• If the electrical signal is grounded, it is
allowed to flow through an alternative route
to the ground (literally) where it can do no
harm. A grounded electrical signal is pulled
down, or reduced, to 0 volts.
• Video
The connections of a transistor
• Three terminals: a source, a base, and
an emitter. The emitter is connected
to a ground wire.
• Source produces approx. 5 volts.
• Base value regulates a gate that
determines whether the connection
between the source and ground is
made.
– If the source signal is grounded, it is pulled
down to 0 volts.
– If the base does not ground the source
signal, it stays high (approx. 5 volts)
Emitter
Circuits
• Combinational circuit - A
circuit whose output is
solely determined by its
input values
• Sequential circuit – A
circuit whose output is a
function of input values
and the current state of the
circuit
– Normally used for storage
Combinatorial circuit:
• Gates are combined into circuits by using gate
output as an input to another gate
Combinatorial circuit: Example 1
Logic diagram
Boolean expression
X = (AB + AC)
Truth table
Combinatorial circuit: Example 2
• Represent
A(B + C) using logic diagram and truth table
as good as possible…
• When we build a combinatorial circuit from some kind
of specification, we always try to make it as good as
possible.
• In some applications, we simply want to minimize the
number of gates (or the number of transistors, really).
• In other, we might be interested in as short
a delay (the time it takes a signal to traverse the
circuit) as possible, or in as low power consumption as
possible.
• In general, a mixture of such criteria must be applied.
Circuit equivalence
• Circuit equivalence - The same output for
each corresponding input value combination
for two circuits
• A(B+C) = AB + AC
properties of Boolean algebra
?
What is the most basic operation of a
computer?
Add two numbers! Duuh
• At digital logic level the addition is performed
in binary
• Special circuits are used to carry out this
operation - adders
Half Adders
• Half adder – A circuit that computes the sum
of two bits and produces the correct carry bit
– Half adder is fine for adding two single digits, but
it cannot be used as is to compute the sum of two
binary values with multiple digits each
Full Adders
• A circuit called a full adder takes the carry-in
value into account.
– use two half adders to make a full adder
Multiplexers
• A multiplexer (a.k.a. mux) is a general circuit that produces
a single output signal.
• The output is equal to one of several input signals to the
circuit.
• The multiplexer selects which input signal is used as an
output signal based on the value represented by a few
more input signals, called select signals or select control
lines.
CPU chips
• CPU is an advanced circuit with input and
output lines
Homework
• Dale, Computer Science Illuminated, Chapter
4, end of the book exercises