Chapter 4 Top Level View
Chapter 4 Top Level View
program?
arithmetic or
logical operation
is done
a different set of
control signals is
needed
2
Computer
Components PC =
Central Processing Unit Computer
(CPU) Program
Syste Counter
Main
PC MAR m . IR =
MB Memory
.
IR Bus 0
R Instruction
I/O Instruction 1 Register
Execution 2
AR Instruction MAR = Memory
Unit I/O .
.
BR . . Address
Data . Register MBR =
I/O Data Memory
Module Buffer Register
.
. I/O AR =
. Input/Output
Buffer
Address
s
Register
3
I/O BR =
Instruction
• Two steps Cycle
Fetch cycle
Execute
cycle Fetch Execution
cycle cycle
4
Fetch
Cycle
Progra Instruction
m Processor Processor
Register
Counter
(IR)
(PC) • Fetch • Load the • Interprets
• Holds instruction from instruction instruction
address of memory • Perform
next location pointed required
instruction to to by PC actions
fetch • Increment PC
5
Instruction Cycle: Fetch
Cycle
• Holds address of
Processor • Load the instruction
Processor
next instruction to
• Fetch instruction • Interprets instruction
fetch
from memory • Perform required
location pointed to actions
by PC
• Increment PC
Program Instruction
Counter Register
(PC) (IR)
6
Program Execution -
Example Memory CPU
Registers
Address Instruction Address P
C
Addres Instruction Data A
C
s Instruction Instruction I
Addres R
…
s
Address Data
Address Data
X XX
1 – Move data
from memory to
AC
2 – Move data
from
X
AC to memory
Operatio Memor 5 – Perform
Addition between
n y content in AC and
Code Address memory address
CSNB123 Computer Organization |
1_2017/2018 Systems 10
& Networking | UNITEN
Program Execution –
Example
Fetch Step 1: Program
Cycle Counter (PC) – provide
Memor CPU
address next
y Registers instruction
300 1940
194 300 P
0 C • PC = 300
301 5941 A
C
302 2941 I
R
…
940 0003
941 0002
AC
302 2941 IR 302 000 1940
3
IR
… …
Analysis: Execution:
940 0003 Load data from 940 0003 0003 loaded into
941 0002 940 into AC 941 0002 AC
CSNB123 Computer Organization |
1_2017/2018 Systems 16
& Networking | UNITEN
Program Execution –
Example
Fetch Execution
Cycle Cycle
Memory CPU Registers Memory CPU Registers
300 302 PC
300 1940 301 P 1940 30
301 1
0005 AC
301 5941
594 0003 C 5941 0003
1 A 302
302 2941 5941 IR
5941 2941
… C … Execution:
940 0003 IR 940 0003 0003 + 0002 =
941 0002 0005
941 0002 Analysis: Store result into
Perform ADD AC
operation
between AC and
941
20
Interrupt
• Cycle
Added to instruction
cycle Fetch Execution Interrupt
cycle cycle cycle
Interrupt
s
disabled
Check for
Fetch Next Execute
Star interrupt; process
Instructio Interrupt
t interrupt
Instructio n s
n enabled
Hal
t
21
Interrupt Cycle
• (Cont.)
Processor checks for interrupt
Indicated by an interrupt signal
• If no interrupt, fetch next instruction
• If interrupt pending:
Suspend execution of current program
Save context
Set PC to start address of interrupt handler
routine
Process interrupt
Restore context and continue interrupted
22
program
Interconnection
• Structures
Collection of paths connecting the
various modules
• Modules:
Memory
Processor
I/O module
23
Modules: Major Form of Input
and Output - Memory
• Word of data - Read
from or written into the
memory
Assigned a
unique numerical
address
• Nature of the operation
– indicated by read and
write control signals
• Address – specify the
location for the
operation
24
Modules: Major Form of Input
and Output - Processor
• Reads instruction
and data
• Writes out data
(after processing)
• Sends control signals
to other units
• Receives (& acts
on) interrupts
25
Modules: Major Form of Input
and Output – I/O Module
• Operations;
Read
Write
• Control more than
one external device
• External data path –
input and output of data
• Send interrupt signals
to CPU
26
Modules:
Major Form of Input and
Output
27
Types of
• Memory toTransfers
processor: Processor
reads instruction/data from memory
• Processor to memory: Processor writes data
to memory
• I/O to processor: Processor reads data from
I/O device (via I/O module)
• Processor to I/O: Processor sends data to
I/O device
• I/O to/from memory: allowed to exchange
data using Direct Memory Access (DMA) –
exclude processor
28
Bus
• Interconnection
Communication pathway connecting two
or more devices
• Key characteristic: shared
transmission medium
• Consists of multiple
communication pathways/lines
Lines – transmit signals representing binary 1
and 0 – one data at a time
29
System
• Bus major
A bus that connects
computer components (CPU,
memory, I/O)
• Computer interconnection structures –
use one or more system buses
• Consists of 50 to hundreds of separate
lines
Each line – function. E.g: power
30
Data
• Line
Provide a path for moving data among
system modules
• Collective – data bus
31
Data
• Bus
Collective of data lines
• Width of the data bus - Number of lines;
32, 64, 128 …
Key factor in determining overall
system performance
• Number of data lines – represents number
of data can be transferred at a time
32
Address
• Designate theLines
source or destination of
the data on data bus
33
Address
• Bus lines
Collective of address
• Width of the address bus determines the
maximum possible memory capacity of
the system
34
Control
• Lines
Used to control the access to and the use
of the data and address lines
• Control signals transmit both command
and timing information among system
modules
Command signals – specify operations to
be performed
Timing signals – validity of data and
address information
35
Bus Interconnection
Scheme
36
Operation of the
• Bus
Send data
Obtain the use of the bus
Transfer data via the bus
• Request data
Obtain the use of the bus
Transfer a request to the other module
over appropriate control and address lines
37
System Bus -
Physical
• Number of parallel
electrical conductors
– metal lines on the
circuit board
38
Single Bus -
• Many ofProblem
devices on one bus leads to:
Propagation delays
• Long data paths mean that co-ordination of bus use
can
adversely affect performance
• If aggregate data transfer approaches bus capacity
• Most systems use multiple buses to
overcome these problems
39
Types of
• Dedicated Bus
Separate data & address lines
• Multiplexed
Shared lines
Address valid or data valid control
line
Advantage
• Fewer lines
Disadvantages
• More complex control
• Reduction in performance
40
Bus
• Arbitration
Process of insuring only 1 devices
places information onto the bus at a
time
41
42