BIC 10503: COMPUTER ARCHITECTURE

Slides:



Advertisements
Similar presentations
Computer Architecture and Organization
Advertisements

CSCI 4717/5717 Computer Architecture
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Computer System Overview
1 Computer System Overview OS-1 Course AA
Computer System Overview
Chapter 3 System Buses.
TECH CH03 System Buses Computer Components Computer Function
Computer Organization and Assembly language
CS-334: Computer Architecture
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
THE COMPUTER SYSTEM. Lecture Objectives Computer functions – Instruction fetch & execute – Interrupt Handling – I/O functions Interconnections Computer.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Top Level View of Computer Function and Interconnection.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
2 nd Year - 1 st Semester Asst. Lect. Mohammed Salim Computer Architecture I 1.
COMPUTER ORGANIZATIONS CSNB123. COMPUTER ORGANIZATIONS CSNB123 Expected Course Outcome #Course OutcomeCoverage 1Explain the concepts that underlie modern.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
EEE440 Computer Architecture
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
Chapter 6: Computer Components Dr Mohamed Menacer Taibah University
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
Lecture 1: Review of Computer Organization
Overview von Neumann Architecture Computer component Computer function
Chapter 3 : Top Level View of Computer Functions Basic CPU function, Interconnection, Instruction Format and Interrupt.
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
Structure and Role of a Processor
1 Computer Architecture. 2 Basic Elements Processor Main Memory –volatile –referred to as real memory or primary memory I/O modules –secondary memory.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
Computer Architecture. Top level of Computer A top level of computer consists of CPU, memory, an I/O components, with one or more modules of each type.
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
1 Computer System Overview Chapter 1. 2 Operating System Exploits the hardware resources of one or more processors Provides a set of services to system.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Chapter 1 Computer System Overview
CHAPTER 4 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
William Stallings Computer Organization and Architecture
William Stallings Computer Organization and Architecture 7th Edition
Computer System Overview
Chapter 3 Top Level View of Computer Function and Interconnection
Chapter 15 Control Unit Operation
Computer System Overview
William Stallings Computer Organization and Architecture 8th Edition
ECEG-3202 Computer Architecture and Organization
Processor Organization and Architecture
MARIE: An Introduction to a Simple Computer
William Stallings Computer Organization and Architecture 7th Edition
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Computer System Overview
Chapter 1 Computer System Overview
Computer System Overview
A Top-Level View Of Computer Function And Interconnection
William Stallings Computer Organization and Architecture 7th Edition
Presentation transcript:

BIC 10503: COMPUTER ARCHITECTURE Chapter 2 Bus System

Overview 2.1 Components of a computer 2.2 Functions of a computer 2.3 Interrupts

2.1 Components of a Computer

Program Concept Hardwired program are inflexible Hardwired program is a configuration of logic components which is constructed to perform a particular computation. General purpose hardware can do different tasks, given correct control signals Instead of rewiring, supply a new set of control signals xxxx

Hardware and Software Approaches How to implement this arithmetic operation using hardwire and software X=pow(2,3); //

For each step, an arithmetic or logical operation is done What is a program? A sequence of steps For each step, an arithmetic or logical operation is done For each operation, a different set of control signals is needed xxxx

2.2 Functions of a Computer

Function of Control Unit For each operation a unique code is provided e.g. ADD, MOVE A hardware segment accepts the code and issues the control signals xxxx

Data and instructions need to get into the system and results out 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 Main memory xxxx

Computer Components: Top Level View xxxx

How Instruction is Executed? What is instruction? Instruction specify the action that the processor is suppose to take. The processing required for a single instruction is called an instruction cycle. Instruction cycle are made of these two steps: Fetch (processor reads from memory and also referred to as fetch cycle) Execute (Also referred to as execute cycle) xxxx

Program Counter (PC) holds address of next instruction to fetch 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) Processor interprets instruction and performs required actions xxxx

Execute Cycle An instruction’s execution (execute cycle) may involve one or a combination of these actions Processor-memory data transfer between CPU and main memory Processor I/O Data transfer between CPU and I/O module Data processing Some arithmetic or logical operation on data Control Alteration of sequence of operations xxxx

Instruction Format Assume both instructions and data are 16 bits long. The instruction format provides 4 bits for the opcode, so that there can be as many as 24 = 16 different opcodes and 12 bits for the address , so that up to 212 words of memory can be directly addressed. Instruction format Integer format Figure 3.4 Characteristics of a Hypothetical Machine

Example of Program Execution Internal CPU Registers PC (Program Counter) AC (Accumulator) – a data register IR (Instruction Register) Program to be executed: Adds the content of the memory word at address 940 to the content of the memory word address 941 and stores the result in latter location. Figure 3.5 Example of Program Execution xxxx

(cont.) Example of Program Execution Requires 3 fetch and 3 execute cycles. {1st Fetch cycle} The PC contains 300, the address of the first instruction. This instruction (the value 1940 in hexadecimal) is loaded into the instruction register IR and the PC is incremented. Note that this process involves the use of a memory address register (MAR) and a memory buffer register (MBR). For simplicity these intermediate registers are ignored. xxxx

(cont.) Example of Program Execution {1st Execute cycle} The first 4 bits (first hexadecimal digit) in the IR indicate that the AC is to be loaded. The remaining 12 bits (3 hexadecimal digits) specify the address (940) from which data are to be loaded. xxxx

(cont.) Example of Program Execution {2nd Fetch cycle} The next instruction (5941) is fetched from location 301 and the PC is incremented. xxxx

(cont.) Example of Program Execution {2nd Execute cycle} The old content of the AC and the content of location 941 are added and the result is stored in the AC. xxxx

(cont.) Example of Program Execution {3rd Fetch cycle} The next instruction (2941) is fetched from location 302 and the PC is incremented. xxxx

(cont.) Example of Program Execution {3rd Execute cycle} The content of AC is stored in location 941. xxxx

Instruction Cycle State Diagram The upper part involve an exchange between the processor and memory or between processor and I/O module. States in the lower part of the diagram only internal processor operations. xxxx

2.3 Interrupts

Why Use Interrupts? Other modules (e.g. I/O, memory) may interrupt the processor’s normal sequence of processing. Interrupts are provided primarily as way to improve processing efficiency. The processor can be used for processing something else (e.g. open and edit a Word document) while I/O operation (e.g. printing) is in progress. xxxx

Classes of Interrupts Program Timer I/O Hardware failure e.g. due to overflow, division by zero Timer Generated by internal processor timer Used in pre-emptive multi-tasking (do certain function in regular basis e.g. data backup) I/O from I/O controller to signal normal completion or error conditions. Hardware failure e.g. power failure, memory parity error

Program Flow Control X – interrupt occurs during course of execution of user program xxxx

(cont.) Program Flow Control The user program perform a series of WRITE calls interleaved (berselang-seli) with processing. Code segment 1, 2 and 3 refer to sequences of instructions that do not involve I/O. The WRITE calls are to an I/O program that is a system utility and that will perform the actual I/O operation. The I/O program consists of 3 sections: Label 4: sequence of instructions to prepare for actual I/O. The actual I/O (Processor WAIT for this to finish). Label 5: sequence of instructions to complete the I/O operation. May include setting flag indicating success or fail.

Interrupt Cycle Added to instruction cycle (NOW Instruction Cycle = Fetch Cycle + Execute Cycle + Interrupt Cycle) Processor checks for interrupt Indicated by an interrupt signal User program does not have to contain special code for handling interrupt The processor and operating system are responsible for suspending user program If no interrupt, fetch next instruction If interrupt pending: Suspend execution of current program Save context (save next instruction address and other data relevant to processor’s current activity) Set program counter (PC) to start address of interrupt handler routine Process interrupt Restore context and continue interrupted program xxxx

Transfer of Control via Interrupts When the interrupt handler routine is completed, the processor can resume execution of the user program at the point of interruption.

Instruction Cycle with Interrupts If no interrupts are pending, processor proceeds with the fetch cycle and fetches the next instruction of the current program. If interrupt is pending, the processor will do the followings: It suspends execution of the current program and saves its context (save next instruction address and other data relevant to processor’s current activity). Sets the program counter to the starting address of an interrupt handler routine. Interrupt handler program is generally part of operating system.

Program Timing: Short I/O Wait Program Timing with Short I/O Wait For the system using interrupts, the time required for the I/O operation is relatively short: less than the time to complete the execution of instructions between 2 WRITE operations in the user program. Thus, with interrupt (Figure b) no waiting time by the processor.

Program Timing: Long I/O Wait Program Timing with Long I/O Wait For WRITE I/O operation taking longer wait time, longer than the time to complete the execution of instructions between 2 WRITE operations in the user program. The first WRITE I/O need to be completed first before the second WRITE can be processed.

Instruction Cycle (with Interrupts) - State Diagram (Compare with “Instruction Cycle State Diagram” in slide 26) xxxx

Multiple Interrupts Approaches to Deal with Multiple Interrupts Disable interrupts Processor will ignore further interrupts whilst processing one interrupt Interrupts remain pending and are checked after first interrupt has been processed Interrupts handled in sequence as they occur Used in Multiple Interrupt - Sequential Define priorities Low priority interrupts can be interrupted by higher priority interrupts When higher priority interrupt has been processed, processor returns to previous interrupt Used in Multiple Interrupt - Nested xxxx

Multiple Interrupts - Sequential Disable Interrupt Approach xxxx

Disable Interrupt Approach Advantage Nice and simple Disadvantage Does not take into account relative priority and time-critical needs.

Multiple Interrupts – Nested Define Priorities Approach xxxx

Time Sequence of Multiple Interrupts

(cont.) Time Sequence of Multiple Interrupts

Interrupt - Exception No interrupt is required for operation not involving processor e.g. DMA (Direct Memory Access). In some cases, I/O devices can operate directly with memory without depending on processor. When processor is bypassed (not using processor), then interrupt is not needed. Direct memory access (DMA) can be used for data exchanges between I/O device and memory (not controlled by processor).

Exercise 1 Due date: Next week

THANK YOU