ECE 561 Computer Systems
Download
Report
Transcript ECE 561 Computer Systems
ECE 456 Computer Architecture
Lecture #2 - Architecture & Organization
Instructor: Dr. Honggang Wang
Administrative Issues (9/18/13)
• Project team set-up due Wednesday, Sept. 25
• If you missed the first class, go to the course website
for syllabus and 1st lecture.
www.faculty.umassd.edu/honggang.wang/teaching.html
• My office hours:
– M./W. 11 am -12pm, Fri. 12:00 -2:00 pm
Dr. Wang
Lecture #2
2
Agenda
• Review Lecture #1
• Lecture #2
Dr. Wang
Lecture #2
3
Review of Lecture #1
In the first lecture, we covered the
• Course syllabus & operational details
• Introduction to computer systems
– History of computers (a number of Firsts…...)
– Evolution of Intel family
– The evolution of computers has been characterized by
increasing processor speed/memory capacity/I/O
capacity & speed and decreasing component size
– Performance balancing is a critical issue in computer
system design
Dr. Wang
Lecture #2
4
The First
• The first general-purpose electronic digital
computer
• The first computer to use the “Stored Program”
concept
• The first computer bug
• The first transistor
• The first chip (integrated circuit)
• The first minicomputer
• The first microprocessor
Dr. Wang
Lecture #2
5
The first general-purpose electronic
digital computer
•
•
•
•
•
•
•
•
ENIAC (Electronic Numerical Integrator And Computer)
designed by Mauchly & Eckert at the U. Pennsylvania
started 1943, finished 1946
disassembled 1955
18,000 vacuum tubes
30 tons
30 feet × 50 feet
140 kw power consumption
Dr. Wang
Lecture #2
6
The first computer to use the “Stored
Program” concept
• IAS computer: named for the Institute for Advanced
Study at Princeton University
• Began 1946, completed 1952
• The prototype of all subsequent
general-purpose computers
• Structure
• Von Neumann machines
Dr. Wang
Lecture #2
7
The first computer bug
• Grace Hopper found a
moth stuck in a relay
responsible for a
malfunction
• An error in a computer
program that prevents
it from working
correctly or produces
an incorrect result
http://www.jamesshuggins.com/h/tek1/first_computer_bug.htm
Dr. Wang
Lecture #2
8
The first transistor
• Invented at Bell labs in
1947
• Won a Nobel prize
• Uses Silicon
• Advantages
http://www.cedmagic.com/history/transistor-1947.html
William Shockley (seated at Brattain's laboratory bench), John
Bardeen (left) and Walter Brattain (right)
Dr. Wang
Lecture #2
http://en.wikipedia.org/wiki/Transistor
9
The first chip
• Invented by Jack Kilby at Texas Instruments in 1958
• Integrated Circuits are transistors, resistors, and capacitors
integrated together into a single “chip”
• Won a Nobel prize
Dr. Wang
Lecture #2
10
The first minicomputer - 1964
• DEC PDP-8
– Small enough to sit on a lab bench
– Embedded applications
– Flexible bus structure
Console
controller
CPU
Main
memory
I/O...
module
I/O
module
Omnibus
Dr. Wang
Lecture #2
11
The first microprocessor – 1971
• The Intel 4004 had 2,250 transistors
• four-bit
• 108Khz
• Called “Microchip”
The Pioneer 10 spacecraft used the 4004
microprocessor. It was launched on March
2, 1972 and was the first spacecraft and
microprocessor to enter the Asteroid Belt.
Dr. Wang
Lecture #2
12
Lecture #2 Topics
• Concept of computer architecture & computer
organization
• Contemporary computer architecture is
– von Neumann architecture, plus
– Interrupts
Dr. Wang
Lecture #2
13
What is Computer Architecture?
• Term coined by IBM System/360 group in 1964
“The structure of a computer that a machine language
programmer must understand to write a correct program
for a machine”
– cited from Advanced Computer Architecture: A Design
Space Approach, by D. Sima et al, Addison-Wesley 1997
– attributes visible to a programmer: registers, instruction
set, instruction formats, addressing modes, etc
– example: “Is there a multiply instruction?”
Dr. Wang
Lecture #2
14
What is Computer Organization?
“The operational units and their interconnections
that realize the architectural specifications”
– about how features are implemented
– hardware details transparent to programmers: control
signals, interfaces, memory technology
– example: “Will the multiply instruction be implemented
by a hardware multiply unit or repeated addition?”
Dr. Wang
Lecture #2
15
Architecture & Organization
• A particular architecture can span many years and
encompass a number of different computer models
(organizations)
– all Intel x86 family share the same basic architecture
– IBM System/370 family share the same basic architecture
– organization, thus price and performance differ between
different models
– this gives code compatibility
Dr. Wang
Lecture #2
16
Agenda
• Concept of computer architecture &
computer organization
• Contemporary computer architecture is
– von Neumann architecture, plus
– Interrupts
Dr. Wang
Lecture #2
17
Von Neumann Architecture
• General structure of von Neumann machines (the
IAS computer)
Dr. Wang
Lecture #2
18
The IAS Computer
(prototype of modern computers)
Chapter 2.1
Dr. Wang
Lecture #2
19
Memory of IAS
• Memory: 1000 words /storage locations
– 40 binary bits per word
– both data and instructions can be stored
– memory format for a number
0 1
39
Sign bit
– memory format for instructions
0
8
Opcode
20
Address
28
Opcode
Address
Right instruction
Left instruction
Dr. Wang
39
Lecture #2
20
Instruction Set of IAS
• 21 instructions
– data transfer between memory and registers or
between two registers
– unconditional branch
– conditional branch
– arithmetic
– address modify
Dr. Wang
Lecture #2
21
Table 2.1
The IAS
Instruction Set
Dr. Wang
Lecture #2
22
IAS Registers
•
•
•
•
•
•
Memory Buffer Register (MBR):
contains a word to be stored in memory
or sent to I/O, or is used to receive a
word from memory or I/O
Accumulator (AC) & Multiplier
Quotient (MQ): employed to hold
temporarily operands and results of ALU
operations.
Memory Address Register (MAR):
specifies the memory address for the
word to be written from or read into
MBR.
Instruction Register (IR): contains the 8bit opcode of the instruction being
executed
Instruction Buffer Register (IBR):
employed to hold temporarily the righthand instruction from a word in memory
Program Counter (PC): contains the
address of the next instruction-pair to be
fetched from memory
Dr. Wang
Lecture #2
23
Operation of
IAS
Instruction cycle
• Fetch
– Opcode IR
– Address MAR
• Execute
Dr. Wang
Lecture #2
24
Von Neumann Architecture –
Key Characteristics
• Memory with addressable locations
• Data and instructions are stored in a single
read-write memory
• Basic sequential execution (unless explicitly
modified)
Dr. Wang
Lecture #2
25
Administrative Issues (9/23/13, Monday.)
• Project Team
– due Wednesday, Sep 25
• Homework #1
– Assigned today, please go to the course website to download
problems
• Today’s topic
– Finish Lecture #2 (Interrupt)
Dr. Wang
Lecture #2
26
Agenda
• Concept of computer architecture &
computer organization
• Contemporary computer architecture is
– von Neumann architecture, plus
– interrupts
Dr. Wang
Lecture #2
27
Interrupts
• All contemporary computers provide a mechanism
by which other modules may interrupt the normal
processing of the processor
• Contemporary computer architecture =
von Neumann architecture + interrupts
Chapter 3.2
Dr. Wang
Lecture #2
28
Common Classes of Interrupts
• Program interrupt
– division by zero, using undefined instructions, memory
protection violations, arithmetic overflow
• Timer interrupt
– generated by an internal processor timer
• I/O interrupt
• Programmer-requested interrupt
• Hardware failure
– power failure, hardware malfunctions
Dr. Wang
Lecture #2
29
Why Interrupts? (1)
• Program flow of control without
interrupts
• Code segments
–
–
–
–
1,2,3: do not involve I/O
4: prepare for actual I/O operation
Actual I/O command
5: complete I/O operation
Dr. Wang
Lecture #2
30
Why Interrupts? (2) -- Program Control flow & Timing: No Interrupts
• I/O devices are much slower than processor -- a very wasteful
use of processor
• At the point of each WRITE call, processor must pause and
remain idle
Dr. Wang
Lecture #2
31
Why Interrupts? (3)
• With interrupts, the processor can be engaged
in executing other instructions while an I/O
operation is in progress
– improved processing efficiency
– concurrency
Dr. Wang
Lecture #2
32
Illustration: Short I/O Wait
• Time required for the I/O operation is less
than the time to complete the execution of
instructions between write calls in the user
program.
Dr. Wang
Lecture #2
33
Why Interrupts? (4) -- Program Control Flow & Timing with Interrupts: Short I/O Wait
concurrency
gain in efficiency
Dr. Wang
Lecture #2
34
Illustration: Long I/O Wait
• Time required for the I/O operation is more
than the time to complete the execution of
instructions between write calls in the user
program.
Dr. Wang
Lecture #2
35
Why Interrupts? (5) -- Program Control Flow & Timing with Interrupts: Long I/O Wait
concurrency
gain in efficiency
Dr. Wang
Lecture #2
36
Summary
• With the use of interrupts, concurrent
execution of user program and I/O
operation is made possible!
• Improved CPU processing efficiency!
Dr. Wang
Lecture #2
37
Transfer of Control via Interrupts
Execution suspended
with context saving
Execution resumed
with context recovery
Dr. Wang
Lecture #2
38
Multiple Interrupts
• Various interrupt sources
multiple interrupts
• How to deal with multiple interrupts?
Dr. Wang
Lecture #2
39
How to deal with multiple
interrupts?
• Can an interrupt be interrupted while it is being
processed?
– NO: sequential interrupt processing
– YES: which interrupt should the CPU service?
priorities and nested interrupt processing
Dr. Wang
Lecture #2
40
Sequential Interrupt Processing (1)
• Disable interrupt (DI) while processing an interrupt, enable interrupt
(EI) before resuming the use program
DI
EI
EI
Dr. Wang
Lecture #2
41
Sequential Interrupt Processing (2)
• Advantages:
– simple: all interrupts are handled in strict sequential order
• Disadvantages
– without considering relative priority or time-critical needs
Dr. Wang
Lecture #2
42
Nested Interrupt Processing (1)
Dr. Wang
Lecture #2
43
Nested Interrupt Processing (2): Example
• A system has three I/O devices
– a printer with priority 2
– a disk with priority 4
– a communication line with priority 5
Increasing
priority
• Multiple interrupts (each takes 10 time units)
0
10
printer
interrupt
Dr. Wang
15
20
communication
line interrupt
25
time
disk
interrupt
Lecture #2
44
Time Sequence of Example Multiple Interrupts
0
10
15
printer
Interrupt (2)
1
20
25
time
disk
Interrupt (4)
comm. line
Interrupt (5)
2
3
4
6
5
Dr. Wang
Lecture #2
45
Nested Interrupt Processing (4)
• Advantages:
– taking into account relative priority or time-critical needs
• Disadvantages
– complex: defining priorities, saving information
Dr. Wang
Lecture #2
46
Summary of Lecture #2
• Basic concept of computer architecture and
organization
• Von Neumann architecture (3 key concepts)
• Interrupts and multiple interrupts
• Contemporary computer architecture is von Neumann
architecture, plus interrupts
Dr. Wang
Lecture #2
47
Next Topics
• Computer function & structure
Things To Do
• Find your partners for the class project
– email me the team information
• Check out the class website about
– lecture notes
– reading assignments
– the project
Dr. Wang
Lecture #2
48