Lec 02
Lec 02
University of Khartoum
Department of Electrical and Electronic
Engineering
COMPUTER ARCHITECTURE
Lecture 2
1
20/1/2020
Interrupt
Normal execution of programs may be preempted if
some device requires urgent servicing.
For example, a monitoring device in a computer-
controlled industrial process may detect a dangerous
condition.
In order to deal with the situation immediately, the
normal execution of the current program must be
interrupted. To do this, the device raises an interrupt
signal.
2
20/1/2020
Bus structure
There are many ways to connect different parts
inside a computer together.
A group of lines that serves as a connecting path
for several devices is called a bus.
Speed Issue
Different devices have different transfer/operate
speed.
If the speed of bus is bounded by the slowest
device connected to it, the efficiency will be very
low.
A common approach is to include buffer registers
with the devices to hold the information during
transfers.
3
20/1/2020
Software
System software must be in the memory in order for a
user to enter and run an application program on a
computer.
System software is a collection of programs that are
executed as needed to perform functions such as:
Receiving and interpreting user commands
Entering and editing application programs and storing them as
files in secondary storage device
Managing the storage and retrieval of files in secondary
storage devices
4
20/1/2020
OS Routine Example
Example: one processor, one disk, and one printer.
Program is stored on disk
Transfer program into memory
Execute program
Calculation
Print results
5
20/1/2020
OS Routine Example
Performance
The most important measure of a computer is how
quickly it can execute programs.
Three factors affect performance:
Hardware design
Instruction set
Compiler
6
20/1/2020
Performance
Processor time to execute a program depends on the
hardware involved in the execution of individual machine
instructions.
Performance
The processor and a relatively small cache memory
can be fabricated on a single integrated circuit
chip.
The internal speed of performing the basic steps of
instruction processing on such chips is very high and
is considerably faster than the speed at which
instructions and data can be fetched from the main
memory.
7
20/1/2020
Processor Clock
Processor circuits are controlled by a timing signal called
a clock.
The clock defines regular time intervals, called clock
cycles.
To execute a machine instruction, the processor divides the
action to be performed into a sequence of basic steps,
such that each step can be completed in one clock cycle.
The length P of one clock cycle is an important parameter
that affects processor performance.
Its inverse is the clock rate, R =1/P, which is measured in
cycles per second (Hz).
8
20/1/2020
How to improve T ?
We must emphasize that N, S, and R are not
independent parameters; changing one may affect
another.
9
20/1/2020
Clock Rate
Increase clock rate:
Improve the integrated-circuit (IC) technology to make the
circuits faster
Reduce the amount of processing done in one basic step
(however, this may increase the number of basic steps
needed)
10
20/1/2020
Compiler
A compiler translates a high-level language program
into a sequence of machine instructions.
To reduce N, we need a suitable machine instruction
set and a compiler that makes good use of it.
Goal –reduce N×S
A compiler may not be designed for a specific
processor; however, a high-quality compiler is usually
designed for, and with, a specific processor.
Input/output organization.
11
20/1/2020
12
20/1/2020
Single Bus
13
20/1/2020
I/O Interfacing
The next figure illustrates the hardware required to
connect an I/O device to the bus.
14
20/1/2020
I/O Mechanisms
Program-controlled I/O
Interrupt
Direct Memory Access (DMA)
15
20/1/2020
Program-Controlled I/O
I/O devices operate at speeds that are vastly different
from that of the processor.
16
20/1/2020
DATAIN
DATAOUT
7 6 5 4 3 2 1 0
17
20/1/2020
End of Lecture 2
18