Structure and Role of a Processor

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

The CPU The Central Presentation Unit What is the CPU?
The Fetch – Execute Cycle
Central Processing Unit
Computer Organization and Architecture
Processor Function Topic 3.
Computer Organization and Architecture
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
1 CSIT431 Introduction to Operating Systems Welcome to CSIT431 Introduction to Operating Systems In this course we learn about the design and structure.
Computer System Overview
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
The Computer Processor
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
Operating Systems and Networks AE4B33OSS Introduction.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Computers Internal Communication. Basic Computer System MAIN MEMORY ALUCNTL..... BUS CONTROLLER Processor I/O moduleInterconnections BUS Memory.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
Fetch-execute cycle.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Computer Systems - Registers. Starter… Discuss in pairs the definition of the following Control Unit Arithmetic and Logic Unit Registers Internal clock.
Computer Studies/ICT SS2
Computer Organization 1 Instruction Fetch and Execute.
Stored Program A stored-program digital computer is one that keeps its programmed instructions, as well as its data, in read-write,
System Unit Working of CPU. The CPU CPU The CPU CPU stands for central processing unit. it is brain of computer It is most important component of the.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Chapter 6: Computer Components Dr Mohamed Menacer Taibah University
Lecture 1: Review of Computer Organization
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.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
1 Computer Architecture. 2 Basic Elements Processor Main Memory –volatile –referred to as real memory or primary memory I/O modules –secondary memory.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
Lec 4-2 Five operations of the machine cycle Fetch- fetch the next program instruction from memory. (PC+1); instruction to IR Decode- decode the instruction.
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
3.1.4 Hardware a. describe the function and purpose of the control unit, memory unit and ALU (arithmetic logic unit) as individual parts of a computer;
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.
Introduction of microprocessor
Chapter 3 Top Level View of Computer Function and Interconnection
Functional Units.
Computer System Overview
ECEG-3202 Computer Architecture and Organization
Processor Fundamentals
MARIE: An Introduction to a Simple Computer
BIC 10503: COMPUTER ARCHITECTURE
THE FETCH-EXECUTE CYCLE.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
GCSE OCR 1 The CPU Computer Science J276 Unit 1
Computer System Overview
CPU Structure and Function
THE FETCH-EXECUTE CYCLE.
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Presentation transcript:

Structure and Role of a Processor

The Registers………….

What are Registers? Special storage locations stored in the circuitry of the processor They hold information temporarily while it is being decoded or manipulated We will look at 6 different registers…….

1. The Program Counter (PC) AKA the sequence control register (SCR) or the sequence register It holds the address of the next instruction to be executed When a sequence of instructions are being executed the program counter will be incremented to point at the next instruction

2. General Purpose Registers Some computers have up to 16, some only have one called an accumulator They perform arithmetic functions an example being: Load contents of 1000 into the accumulator Add contents of 1001 into the accumulator Store contents of accumulator into 1002 Note 1000, 1001 and 1002 are memory locations

The Current Instruction Register (CIR or IR) Contains the operator and operand of the current instruction E.g. Load contents of location 1000 into the accumulator LDA 1000

4. The Memory Address Register (MAR) Holds the address of memory locations from which data will be read or written to Instructions are also held in memory so it will also hold the address of instructions to be fetched Addresses for the next instructions are copied to this register from the Program counter when needed

5. The Memory Data Register (MDR) AKA the Memory Buffer Register (MBR) Data being read from or written to memory is temporarily stored here All transfers to memory to the CPU go via this register to act as a buffer to compensate for the difference in speed between memory and the CPU

5. The Status Register (SR) AKA Program Status Words or PSW Holds information about the result of instructions E.g. one bit will be set if an overflow occurs, another if the last instruction was negative The CPU can use this information to decide whether it needs to branch out of sequence It also hold info on interrupts

Task Read the paragraph – inside the CPU on page 200 Draw the diagram shown on page 200 on A4 paper – landscape and label what each register/unit does using the info on pages 200 and 2001

Fetch Decode Execute

Instruction Register CIR Arithmetic Logic Unit General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC Control Unit Memory Address Register MAR Memory Data Register MDR

Instruction Register CIR Fetch – Step 1 Arithmetic Logic Unit General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC INSTRUCTION 1 ADDRESS Control Unit Memory Address Register MAR Memory Data Register MDR

Instruction Register CIR Fetch – Step 1 Arithmetic Logic Unit General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC INSTRUCTION 1 ADDRESS COPY Control Unit INSRUCTION 1 ADDRESS Memory Address Register MAR Memory Data Register MDR

Instruction Register CIR Fetch – Step 2 Arithmetic Logic Unit General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC INSTRUCTION 1 ADDRESS INSTRUCTION 1 RETRIEVED FROM MEMORY AND COPIED HERE Control Unit INSRUCTION 1 ADDRESS Memory Data Register MDR Memory Address Register MAR

Instruction Register CIR Fetch – Step 2 Arithmetic Logic Unit General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC INSTRUCTION 2 ADDRESS INSTRUCTION INCREMENTED BY 1 INSTRUCTION 1 RETRIEVED FROM MEMORY AND COPIED HERE Control Unit INSRUCTION 1 ADDRESS Memory Data Register MDR Memory Address Register MAR

Instruction Register CIR Fetch – Step 3 Arithmetic Logic Unit INSTRUCTION 1 General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC INSTRUCTION 2 ADDRESS COPY INSTRUCTION 1 Control Unit INSRUCTION 1 ADDRESS Memory Data Register MDR Memory Address Register MAR

Instruction Register CIR Decode – Step 1 INSTRUCTION HELD IN CIR IS DECODED Arithmetic Logic Unit INSTRUCTION 1 General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC INSTRUCTION 2 ADDRESS INSTRUCTION 1 Control Unit INSRUCTION 1 ADDRESS Memory Data Register MDR Memory Address Register MAR

Instruction Register CIR Execute – Step 1 INSTRUCTION HELD IN CIR IS EXECUTED Arithmetic Logic Unit INSTRUCTION 1 General Purpose Registers Current Instruction Register CIR Status Register SR Program Counter PC INSTRUCTION 2 ADDRESS INSTRUCTION 1 Control Unit INSRUCTION 1 ADDRESS Memory Data Register MDR Memory Address Register MAR

No START Any Instructions to Execute Fetch next Instruction Decode Instruction Execute Instruction` Any Interrupts To Process Transfer control to Interrupt Handling Program

Fetch Execute Cycle in Register Transfer Notation MAR [PC] MDR [Memory Location] PC [PC1] + 1 CIR [MDR]

Task Make your own diagram / notes regarding the Fetch – Execute Cycle that you could revise from (use page 202 to help you) Then attempt Q1 on page 202 to ensure you understand it

Task Do question 1 on page 202 Answer below in white: Instruction address 500 in PC copied to MAR Location 1000 contents copied to MDR Instruction address 503 in program counter Location 1000 contents copied from MDR to CIR

What happens if there is an interrupt? There is a special register called a stack pointer If there is an interrupt, the current contents of all the registers are stored on the stack and the stack pointer is updated Stacks can be used instead of general purpose registers to hold intermediate results of arithmetic operations (a return instruction brings results back)

Interrupts When a device seeks the attention of the processor…………. Any program being executed is suspended and control passes over to an interrupt service routine

Types of Interrupt Input / Output (I/O) Timer Interrupt – certain functions are performed at regular intervals Program Check Interrupt – caused by an error in a program e.g. division by zero Machine Check interrupt – machine malfunction There is an Interrupt Register in the CPU and interrupts are assigned different levels of priority. Some interrupts are dealt with immediately, some are not

Interrupt Priorities HARDWARE FAILURE (Machine Check interrupt) Program Check Interrupt Timer Interrupt – certain functions are performed at regular intervals Input / Output (I/O)

Interrupt service routine, or interrupt handler sequence if there is an interrupt: Complete current fetch execute cycle Next instruction location on program counter is stored on stack Contents of other registers are stacked Interrupt source is identified Other Lower priority interrupts are disabled Program counter is loaded with the address of Interrupt service routine Interrupt service routine is executed Contents of stack are restored to registers Interrupts are re-enabled Program counter is restored to point to next instruction

Vectored interrupt mechanism A complete list of interrupts and associated starting addresses are stored in the Interrupt vector table All interrupts have a base address (in the table) and the exact location of a particular interrupt is found by adding and offset address supplied by the interrupting device The base address plus the offset are copied to the program counter

Note Ask for handout on interrupts!

Processor performance is determined by Clock Speed Word Length Bus Width Read and make notes about these aspects on pages 205 and 206 then do questions and exercises on page 206

Task Read the recap and then do Q3 on page 203