Download Computers: Inside and Out Questions Computer Components

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

Stream processing wikipedia , lookup

Abstraction (computer science) wikipedia , lookup

Parallel computing wikipedia , lookup

ILLIAC IV wikipedia , lookup

Transcript
Questions
Computers: Inside and Out
Computer Components
To store binary information the most
basic components of a computer must
exist in two states
State # 1 = 1
State # 2 = 0
What does it mean when we say that a
computer represents information in
binary form?
What does this imply about the most
basic components of a computer?
Vacuum Tubes
Early computers used
vacuum tubes to
represent binary
information.
How could a vacuum
tube do this?
Triode
1
Vacuum Tubes
If grid is positive, the plate
can attract electrons –
current flows
Negative grid repels
electrons – current doesn’t
flow
Transistors
Computers now use transistors
Small solid-state devices
Several advantages
Small
Don’t burn out
Don’t generate as much heat
What problems would vacuum tubes
have for use in computers?
Deep Inside: Transistors
Deep Inside: Transistors
Most basic component of a computer
Key active component in all modern
electronics, including computers
Probably one of the greatest inventions
in modern history
2
Transistors
“Solid-state” because
made of a solid, usually
slightly impure silicon
Field effect transistor
shown here
Controls the flow of
current
Transistors can be combined to do sophisticated
operations
What kind of Boolean operator does the combination
below represent?
Integrated Circuits
This is an AND gate
Current flowing = “on”
No current = “off”
Transistors
Transistors
Both “A” and “B” must be true for the
current to flow
How would you make an OR gate?
3
Integrated Circuits
Decrease magnification of our
imaginary microscope a bit
We see that transistors are part of small
chips called “integrated circuits.”
What is the “big idea” discussed in your
text that makes integrated circuits so
revolutionary?
Integrated Circuits
Fabricate in layers
Each layer contains millions
of “wires” and transistor
pieces
Chip made of millions of
transistors and other
components
Integrated Circuits
Small transistors are not useful if they
are separate parts that must be wired
together by hand or machines.
The “big idea”: Manufacture the entire
circuit in layers, laying down transistors,
wires, etc. at the same time
Integrated Circuits
Many ICs fabricated at once
in a wafer
Formed by photolithography
Cover silicon with a pattern
Remove part of silicon not under pattern
Remove pattern
Repeat process for next layer
4
Photolithography 1
Moore’s Law
Attributed to
Gordon Moore
Co-founder of
Intel
1. http://bmrc.berkeley.edu/courseware/ICMfg92/images/gif/photolith.gif
Moore’s Law
The complexity of ICs per dollar
doubles about every 24 months
Every two years you will be able to get
about twice the computing power for
the same amount of money
Integrated Circuits
Can this go on forever?
5
Integrated Circuits
Central Processing Unit (CPU)
May reach physical limits eventually
May get too small for photolithography
Quantum effects may cause “leakage”
of electrons within transistors
Cost of fabrication plants are climbing
May need other technologies
CPU
The CPU is an Integrated Circuit
Also called “processor” or
“microprocessor”
Memory
Contains Arithmetic and Logic Unit (ALU) and
Control Unit
Shown here with other components of
computer
Peripherals
Divided into 8-bit (1-byte) locations
Each location stores one 8-bit binary
number such as 00110010
Each location has an address
6
CPU
Look at CPUs that conform to the Von
Neumann architecture
Named after John Von Neumann
Instructions and data stored together in
memory
Retrieved in the same way by the CPU
Fetch/Execute Cycle
Instructions and data both are stored in
RAM
Beginning: All the CPU knows is the
memory address for the next instruction
What would be the general process for
executing that instruction?
Use the Fetch/Execute cycle
Fetch/Execute Cycle
General process is the following:
Get instructions from memory
Get data needed by instructions from
memory
Operate on data according to instructions
Put resulting data back into memory
Fetch/Execute Cycle
Actually this takes place in five steps
Fetch instructions
Decode instructions
Fetch data
Execute instructions
Return results
7
Fetch/Execute Cycle
Controlled by the Control Unit
Next few slides will follow example in
text
Step 1: Instruction Fetch
pp 236 – 239
Fetch/Execute Cycle
Fetch/Execute Cycle
Step 2: Decode Instructions
Fetch/Execute Cycle
Step 3: Fetch Data
8
Fetch/Execute Cycle
Step 4: Execute Instructions
Fetch Execute Cycle
Computer’s operations are all like the
one illustrated
Very simple in general
Basic arithmetic: Add, multiply, divide
Tests: Are two things both true? Is one of
them?
Move data and instructions around
Fetch/Execute Cycle
Step 5: Return results
What Computers Cannot Do
Computers are deterministic.
What does this mean?
What does this imply about how
computers are not like people?
Computer does these over and over and
over
9
What Computers Cannot Do
See p. 228 of your text
Computers are not creative
They have no intuition
They are literal – no sense of humor or
irony
They are not purposeful.
Central Clock
Instruction Pipelines
The Fetch/Execute cycle is wasteful
Example: During Execute Instructions
step, the Fetch data hardware is idle
Computer’s clock controls rate of
Fetch/Execute cycle
Fast clock means more instructions can
be accomplished
2 GHz clock speed => 2 billion
instructions per second
Need pipelining to accomplish this
Instruction Pipelines
Want to keep all units busy as much as
possible
Use clock to start an instruction
Then pass instruction off to other
components
10
Instruction Pipelines
Instruction Pipelines
Tick 1
Tick 2
Tick 3
Tick 4
Tick 5
Fetch Inst 1
Decode 1
Fetch Data 1
Execute 1
Return
Fetch Inst 2
Decode 2
Fetch Data 2
Execute 2
etc
Program Branches
Illustrate with IF . . . THEN . . .
statement from higher level language
Suppose A = 6. What will this
statement do?
IF A < 10
THEN Print “Yes”
ELSE Print “No”
Pentium 4 processor has a 20-stage
pipeline
Long pipelines allow many instructions
to be executed simultaneously
Downside of long pipeline – program
branches
Program Branches
Results of branches cannot be predicted
When program branches, processor must
wait for result
Can’t do anything else until it knows result.
Loses advantage of pipelining
Office software (such as word processing)
Many branches.
Lose some of efficiency of pipelining
Increase in processor power does not necessarily
translate into a proportional increase in
performance.
11
Software
Software is the set of instructions that
tell the computer what to do
At the computer level, these all are in
binary form
Sequence of binary digits
10001111 10010100 00000011 01110100
10001111 10011000 00000001 10101100
Programming Languages
Computers process instructions in binary
Humans find it hard to work directly in binary
Need some other way of developing the
instructions
Operating Systems
Humans develop instructions using programming
language
Computer translates programming language into
binary.
Basically, its “personality”
What are common operating systems in
use today?
Implementation #1: Compilation
Use a two-step process
Software that controls and manages the
computer’s hardware
Provides foundation for application
software to run
Our interface with the machine
Humans write instructions using a
programming language
Computer translates entire set of instructions
into binary
Done with a program called a “compiler”
Computer runs compiled binary code
Advantage: Faster running
Disadvantage: Harder to develop
12
Implementation #2: Interpretation
Humans write instructions using a
programming language
Computer reads these instructions
without prior translation
Interpreter in the computer translates
instructions into binary “on the fly”
Advantage: Easier to develop
Disadvantage: Slower
Programming Languages
High level languages
FOR I = 1 to 10
X = 2*I
PRINT X
First programming language was called
“assembly language”
One line of code for each computer
instruction
Example statement: ADD 20, 20, 24
Still hard to use
Application Software
Code is condensed and easier to read
Example
Programming Languages
Software that makes it possible for
ordinary people to use computers
Word processors, spreadsheets, etc.
Users no longer need be programmers
NEXT I
Easier to use, but still need training
Examples: C++, Python, Perl, PHP
13