ITEC255 Chapter3 (Part1) With Explanations
ITEC255 Chapter3 (Part1) With Explanations
ITEC255
Computer Organization
ITEC255 - Computer Organization & Architecture
& Architecture
2
Key Points
• The most popular means of interconnection is the use of a
shared system bus consisting of multiple lines.
3
Computer Components
• Virtually all contemporary computer designs are based on
concepts referred to as von Neumann architecture.
memory.
Contents of this memory are addressable by location,
without regard to the type of data contained there.
Execution occurs in a sequential fashion from one
instruction to the next.
4
Computer Components
5
Computer Components
data.
6
Computer Components
• Programming is now much easier. Instead of rewiring the
hardware for each new program, all we need to do is provide
a new sequence of codes.
• Each code is an instruction and part of the hardware
interprets each instruction and generates control signals.
ITEC255 - Computer Organization & Architecture
7
Computer Components
8
Computer Components
9
Computer Components
• Figure shows top-level components and suggests the
interactions among them.
ITEC255 - Computer Organization & Architecture
10
Computer Components
11
Computer Components
12
Computer Function
13
Computer Function
• Program execution consists of repeating the process of
instruction fetch and instruction execution. The instruction
execution may involve several operations and depends on the
nature of the instruction.
• The processing required for a single instruction is called an
ITEC255 - Computer Organization & Architecture
instruction cycle.
• Program execution halts only if the machine is turned off,
some sort of unrecoverable error occurs, or a program
instruction that halts the computer is encountered.
14
Computer Function
• At the beginning of each instruction cycle, the processor
fetches an instruction from memory.
• In a typical processor, a register called the program counter
(PC) holds the address of the instruction to be fetched next.
• The processor always increments the PC after each
ITEC255 - Computer Organization & Architecture
15
Computer Function
16
Computer Function
Example:
• Consider a simple example using a hypothetical machine that
includes the characteristics shown below.
Main Memory
16 bits
ITEC255 - Computer Organization & Architecture
Instruction
4 12
0000 …
CPU …
0001 LOAD
0110 …
… …
17
Computer Function
CPU
PC 300
Example:
IR
• The processor contains a single data register, called an
AC
accumulator (AC).
• Both instructions and data are 16 bits long. 4 HEXA digits Memory Main
addresses Memory
• The instruction format provides 4 bits for the opcode and
…
12 bits for the memory address. 1 for opcode, 3 for address
ITEC255 - Computer Organization & Architecture
22
Computer Function
• From the point of view of the user program, an interrupt is just an
interruption of the normal sequence of execution.
• When the interrupt processing is completed, execution resumes.
Thus, the user program does not have to contain any special code to
accommodate interrupts; the processor and the operating system
are responsible for suspending the user program and then resuming
ITEC255 - Computer Organization & Architecture
23
Computer Function
24
Computer Function
• If an interrupt is pending, the processor does the following:
It suspends execution of the current program being executed
and saves its context on the system stack – a special place in
memory.
It sets the program counter to the starting address of an
interrupt handler routine.
ITEC255 - Computer Organization & Architecture
25
Computer Function
• The processor now proceeds to the fetch cycle and fetches the
first instruction in the interrupt handler program, which will
service the interrupt.
ITEC255 - Computer Organization & Architecture
26
Computer Function
Example:
• The user program performs a series of WRITE calls
interleaved with processing.
• Code segments 1, 2, and 3 refer to sequences of
instructions that do not involve I/O.
ITEC255 - Computer Organization & Architecture
27
Computer Function
Example:
Solution
(Short I/O wait)
I/O program
ITEC255 - Computer Organization & Architecture
• Code segment 4
• Actual I/O operation
• Code segment 5
28
Computer Function
Example:
Solution
(Long I/O wait)
ITEC255 - Computer Organization & Architecture
I/O program
• Code segment 4
• Actual I/O operation
• Code segment 5
29