Basic Structure of Computer Architecture
Basic Structure of Computer Architecture
COMPUTERS
What is a computer?
Simply put, a computer is a sophisticated electronic
calculating machine that:
Accepts input information,
Processes the information according to a list of internally
stored instructions and
Produces the resulting output information.
Functions performed by a computer are:
Accepting information to be processed as input.
Storing a list of instructions to process the information.
Processing the information according to the list of
instructions.
Providing the results of the processing as output.
What are the functional units of a computer?
1
Input
Output
I/O
Output unit sends
results of processing:
To a monitor display,
To a printer
Memory
Arithmetic
Instr1
Instr2
Instr3
Data1
Data2
& Logic
Stores
information:
Instructions,
Data
Control
Processor
Numbers,
Encoded characters.
Input unit
Binary information must be presented to a computer in a specific format. This
task is performed by the input unit:
- Interfaces with input devices.
- Accepts binary information from the input devices.
- Presents this binary information in a format expected by the computer.
- Transfers this information to the memory or processor.
Real world
Computer
Memory
Keyboard
Audio input
Input Unit
Processor
Memory unit
Memory unit stores instructions and data.
Output unit
Computers represent information in a specific binary form. Output units:
- Interface with output devices.
- Accept processed results provided by the computer in specific binary form.
- Convert the information in binary form to a form understood by an
output device.
Computer
Memory
Output Unit
Real world
Printer
Graphics display
Speakers
Processor
10
Control unit
Operation of a computer can be summarized as:
Accepts information from the input units (Input unit).
Stores the information (Memory).
Processes the information (ALU).
Provides processed results through the output units (Output
unit).
11
Execution of an instruction
Recall the steps involved in the execution of an instruction
by a processor:
Several issues:
Where is the address of the memory location from which the
present instruction is to be fetched?
Where is the present instruction stored while it is executed?
Where and what is the address of the memory location from
which the data is fetched?
......
MAR
MDR
Control
PC
R0
General purpose
registers
R1
IR
Instruction that is
currently being
executed
ALU
R(n-1)
-
n general purpose
registers
Processor
13
Input
Output
Memory
Processor
Bus
Functional units may be connected by a group of parallel wires.
The group of parallel wires is called a bus.
Each wire in a bus can transfer one bit of information.
The number of parallel wires in a bus is equal to the word length of
a computer
14
Control
Path
MAR
MDR
Memory
execution
Data
Path
ALU
GPR
Processor
16
Fetch/Execute cycle
Execution of an instruction takes place in two phases:
Instruction fetch.
Instruction execute.
Instruction fetch:
Fetch the instruction from the memory location whose address
is in the Program Counter (PC).
Place the instruction in the Instruction Register (IR).
Instruction execute:
Memory organization
Recall:
Information is stored in the memory as a collection of bits.
Collection of bits are stored or retrieved simultaneously is
called a word.
Number of bits in a word is called word length.
18
19
Byte 2 -1
20
Byte 0
Byte 1
Byte 2
Word #1
Word #?
Byte 3
Byte 4
Byte 65532
Byte 65533
Byte 65534
Byte 65535
21
Word #0
Byte 2
Byte 3
Byte 4
MAR
MAR register
contains the
address of the
memory location
addressed
Addr 65532
Byte 65532
Byte 65533
Byte 65534
Byte 65535
Word #1
MDR
Word #16383
MDR contains either the
data to be written to that
address or read from that
address.
22
Memory operations
Memory read or load:
Place address of the memory location to be read from into
MAR.
Issue a Memory_read command to the memory.
Data read from the memory is placed into MDR automatically
(by control logic).
23
Instruction types
Computer instructions must be capable of performing 4
types of operations.
Data transfer/movement between memory and processor
registers.
Branch instructions
24
25
26
27
28
Instruction types
Instructions can also be classified based on the number of
operand addresses they include.
3, 2, 1, 0 operand addresses.
29
Problems
List the steps needed to execute the machine instruction Add
LOCA, R0 in terms of transfer between the components shown in Fig
A
31
Repeat the above problem for the machine instruction Add R1, R2, R3
32
Give a short sequence of machine instructions for the task: Add the
contents of memory location A to those of location B and place the
answer in location C.
a) Only Load LOC, Ri and Store Ri, LOC are available
b) Suppose that Move and Add instructions are available with the
format
Move/Add Location1, Location2, is it possible to use fewer
instructions to accomplish the task in Part a? If yes, give the
sequence
33
Performance
The speed with which a computer executes programs is
affected by the design of its hardware and its machine
language instructions.
Because programs are usually written in a high-level
language, performance is also affected by the compiler that
translates programs into machine language.
For best performance, it is necessary to design the
compiler, the machine instruction set and the hardware in a
coordinated way.
Just as the elapsed time for the execution of a program
depends on all units in a computer system, the processor
time depends on the hardware involved in the execution of
individual machine instructions.
This hardware comprises the processor and the memory,
which are usually connected by a bus as shown in Fig.
34
Main
memory
Cache
memory Processor
Bus
Why is the access time of the cache memory lesser than the
access time of the main memory?
35
Processor Clock
36
Performance Measurement
Computer performance can be measured using benchmark programs.
To make comparisons possible, standardized programs must be used.
The performance measure is the time it takes a computer to
execute a given benchmark.
A nonprofit organization called System Performance Evaluation
Corporation (SPEC) selects and publishes representative application
programs for different application domains, together with test results
for many commercially available computers.
The selected program is compiled for the computer under test and
the running time on a real computer is measured.
The same program is also compiled and run on one computer selected
as a reference. The SPEC rating is computed as follows:
38
The test is repeated for all the programs in the SPEC suite, and
the geometric mean of the results is computed. Let
be the rating for program I in the suite. The overall SPEC rating
for the computer is given by
39
40
41
42
43
44
45
46
47
48
49
50
51
52