Computer Architecture 2 nd year (computer and Information Sc.) haboulenien@hotmail.com.

Post on 20-Jan-2016

216 views 0 download

Tags:

transcript

Computer Architecture2nd year (computer and Information Sc.)

haboulenien@hotmail.com

Grading

Assessment Grade Final Exam

50 Mid-Term Exam

25 Class Work

10 Other Activities and/or exams 15

Contents Computer Function and Interconnection Instruction Sets

Characteristics and Functions Addressing modes

Cache and internal Memory CPU and Control unit operation Input/Output Multiprocessor and alternative

architectures Performance enhancement

References

Computer Organization and Architecture, 8th Ed., (or Later)

W. Stallings

Computer Organization and Design4th Ed., (or Later)

D. Pattarson and J. Hennessy

WHY STUDY COMPUTER ARCHITECTURE?

The IEEE/ACM Computer Curricula lists computer architecture as one of the core subjects that should be in the curriculum of all students in computer science and computer engineering. The report says the following: “The computer lies at the heart of computing.

Without it most of the computing disciplines today would be a branch of theoretical mathematics. To be a professional in any field of computing today,

one should not regard the computer as just a black box that executes programs by magic. All students of computing should acquire some understanding and appreciation of a computer system’s functional components, their characteristics, their performance, and their interactions. There are practical implications as well. Students need to understand computer architecture in order to structure a program so that it runs more efficiently on a real machine. In selecting a system to use, they should be able to understand the tradeoff among various components, such as CPU clock speed vs. memory size.”

Computer Architecture (definition)

Computer architecture describes the main attributes of a system visible to a programmer, that have direct impact on logical execution of a program. Examples of architectural attributes include

instruction set, the number of bits used to represent various data types (e.g., numbers, characters), I/O mechanisms, and techniques for addressing memory.

Architecture & Organization 1 it is an architectural design issue

whether a computer will have a multiply instruction.

It is an organizational issue whether that instruction will be implemented by a special multiply unit or by a repeated use of the add unit of the system.

Architecture & Organization 2 All Intel x86 family share the same basic

architecture The IBM System/370 family share the

same basic architecture This gives code compatibility (at least

backwards) Organization differs between different

versions (different price and performance characteristics)

Structure & Function A computer is a complex system. How can

one clearly describe it? The key is to recognize the hierarchical nature

of most complex systems, including the computer.

A hierarchical system is a set of interrelated subsystems, each of the latter, in turn, hierarchical in structure

Structure is the way in which components relate to each other

Function is the operation of individual components as part of the structure

A functional viewof the computer

Function

Computer functions are: Data processing Data storage Data movement Control

Structure - Top Level

Computer

Main Memory

Input /Output

SystemInterconnection

Peripherals

Communicationlines

CentralProcessing Unit

Computer

Function (CPU or processor): Controls the

operation of the computer and performs its data processing functions

Main memory: Stores data I/O: Moves data between the computer

and its external environment System interconnection (system bus):

provides mechanism for communication among CPU, main memory, and I/O

Structure - The CPU

Computer Arithmeticand Login Unit

ControlUnit

Internal CPUInterconnection

Registers

CPU

I/O

Memory

SystemBus

CPU

Function

Control unit: Controls the operation of the CPU and hence the computer.

ALU: Performs the computer’s data processing functions.

Registers: Provides storage internal to the CPU.

CPU interconnection: provides mechanism for communication among the control unit, ALU, and registers

Structure - The Control Unit

CPU

ControlMemory

Control Unit Registers and Decoders

SequencingLogic

ControlUnit

ALU

Registers

InternalBus

Control Unit

von Neumann architecture

Data and instructions are stored in a single read–write memory.

The contents of this memory are addressable by location, without regard to the type of data contained there.

Execution occurs in a sequential fashion (unless explicitly modified) from one instruction to the next.

What is a program? A sequence of steps For each step, an arithmetic or logical

operation is done For each operation (e.g. ADD, MOVE) a

unique code is provided For each operation, a different set of

control signals is needed A hardware segment accepts the code

and issues the control signals

Program Concept

Components The Control Unit and the Arithmetic and

Logic Unit constitute the Central Processing Unit

Data and instructions need to get into the system and results out Input/output

Temporary storage of code and results is needed (stored-program concept) Main memory

Software and hardware:Hierarchical view

Below your program

Computer Components:Top Level View

Registers 1 Memory buffer register (MBR): Contains

the data to be written into memory or receives the data read from memory

Memory address register (MAR): Specifies the address in memory for the next read or write

Similarly, an I/O address register (I/OAR) and an I/O buffer register (I/OBR) are used between I/O module and the CPU

Registers 2

Instruction register (IR): Contains the instruction being executed

Program counter (PC): Contains the address of the next instruction to be fetched from memory

CPU Operation The processor executes the program by

reading (fetching) it from memory, instruction by instruction, and executing each instruction.

These steps are known as: the instruction cycle

1.Read (fetch) the next instruction from memory

2. Execute the instruction

Instruction CycleFetchExecute

Fetch Cycle Program Counter (PC) holds address of

next instruction to fetch Processor fetches instruction from

memory location pointed to by PC Increment PC (Unless told otherwise) Instruction loaded into Instruction

Register (IR)

Execute Cycle 1

Processor interprets instruction and performs required actions. In general these action falls into:

Processor - memory data transfer between CPU and main

memory Processor - I/O

Data transfer between CPU and I/O module

Execute Cycle 2 Data processing

Some arithmetic or logical operation on data

Control Alteration of sequence of operations e.g.

jump (branch)

Example of Program Execution 1

Example of Program Execution 2

RQ: 1.2, 1.3, 1.4, 1.5, 3.1

P:3.1, 3.2, 3.3, 3.4

Chapter 1Chapter 3 up to page 72