Fetch Execute Cycle – In Detail -

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Computer Architecture and the Fetch-Execute Cycle
Central Processing Unit
CS364 CH16 Control Unit Operation
Slide 4-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 4 Computer Organization.
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Arithmetic Logic Unit (ALU)
Damian BrowneLuis PabonPedro Tovar The operation of a computer in executing a program consists of a sequence of Instruction Cycles, with one machine.
PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
ARITHMETIC LOGIC SHIFT UNIT
Processor System Architecture
Chapter 16 Control Unit Operation No HW problems on this chapter. It is important to understand this material on the architecture of computer control units,
1 Computer System Overview OS-1 Course AA
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Chapter 15 IA 64 Architecture Review Predication Predication Registers Speculation Control Data Software Pipelining Prolog, Kernel, & Epilog phases Automatic.
INPUT/OUTPUT ORGANIZATION INTERRUPTS CS147 Summer 2001 Professor: Sin-Min Lee Presented by: Jing Chen.
The Computer Processor
Computer Organization and Architecture
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Group 1 Michael Bouizza Rolando Abreu Carlos De Cossio Ricardo Urena Michael Hernandez Robert Romano Sun Li Yang.
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 2. Computer Structure Computer Structure The traditional diagram of a computer...
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Computer Architecture and the Fetch-Execute Cycle
Computer Architecture and the Fetch-Execute Cycle
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
CPU Design. Introduction – The CPU must perform three main tasks: Communication with memory – Fetching Instructions – Fetching and storing data Interpretation.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
CHAPTER 4 The Central Processing Unit. Chapter Overview Microprocessors Replacing and Upgrading a CPU.
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
Fetch-execute cycle.
CSE 241 Computer Organization Lecture # 8 Ch. 7 Control Unit Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Computer Organization 1 Instruction Fetch and Execute.
Computer Organization CDA 3103 Dr. Hassan Foroosh Dept. of Computer Science UCF © Copyright Hassan Foroosh 2002.
Lecture 15 Microarchitecture Level: Level 1. Microarchitecture Level The level above digital logic level. Job: to implement the ISA level above it. The.
Basic Elements of Processor ALU Registers Internal data pahs External data paths Control Unit.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Control Unit Operations Chapter10:. What is Control Unit (CU)?(1)  Part of a CPU or other device that directs its operation.  Tells the rest of the.
Chapter 10 Control Unit Operation “Controls the operation of the processor”
Structure and Role of a Processor
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
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;
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
Control Unit Operation
Basic Processor Structure/design
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Chapter 9 a Instruction Level Parallelism and Superscalar Processors
Micro-Operations A computer executes a program Fetch/execute cycle
William Stallings Computer Organization and Architecture
William Stallings Computer Organization and Architecture 7th Edition
Chapter 15 Control Unit Operation
The fetch-execute cycle
Computer System Overview
Computer Organization and ASSEMBLY LANGUAGE
William Stallings Computer Organization and Architecture 7th Edition
Chapter 14 Control Unit Operation
William Stallings Computer Organization and Architecture 8th Edition
Chapter 14 Control Unit Operation
CPU Structure and Function
A Top-Level View Of Computer Function And Interconnection
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Computer Architecture
Computer Architecture
Presentation transcript:

Fetch Execute Cycle – In Detail -

Simple Layout of Fetch-Execute Cycle

FETCH-EXECUTE CYCLE The fetch execute cycle is the time period of which the computer reads and processes the instructions from the memory, and executes them. This process is a continuous cycle which is used until the computer is turned off or there are no more instructions to process.

Fetch Cycle Fetch the Instruction from Main Memory The CPU presents the value of the program counter on the address bus. The CPU then fetches the instruction from main memory via the data bus into the Instruction Register. Decode the Instruction The instruction decoder (ID) interprets and implements the instruction Execute Cycle Get Data from Main Memory Fetch required data from main memory to be processed and placed into registers. Execute the Instruction Control signals are initialized to process the data using ALU and write the result back to a register. Store Results The result generated by the operation is stored in the main memory, or sent to an output device.

To do this it contains 4 main registries, As soon as a computer is powered on it begins the process of the fetch-execute cycle. To do this it contains 4 main registries, MBR (Memory Buffer Register) MAR (Memory Address Register) PC (Program Counter) IR (Instruction Register).

Memory Buffer Register This register has the job of storing the last collected data that has been fetched. If no fetch has occurred it contains the data from the last process. This then is the value the computer works with for the next instruction, or flushes it to memory (on command) to enable a new data to be stored. Memory Address Register The memory address register contains the address of the memory of which we either want to read or write to. Program Counter The program counter holds the address of the next instruction to be executed. Instruction Register This holds the instruction for the last execution or, after fetch cycle has run and has moved onto the decode cycle, the current execution command.

How It Works? The fetch cycle The fetch cycle collects the data from the memory and stores it in the MBR as well as setting the program to load the next step. This prepares the processor for the information is about to receive as well as progressing the program ready for the next processor cycle (the combination of all the cycles together). The following is the order for a fetch cycle. 1.      Move PC to MAR: This progresses the program moving the 'next instruction' to be the current instruction. Progression starts here. 2.      Move MAR to MBR: As MAR only holds an address of op code to be collected it is important that the data is now fetched into the processor buffer. 3.      Increase PC: This sets the position of the next instruction to be executed. 4.      Move MBR to IR: This allows the processor to now manipulate the buffer into operation code (op code) to be run by the processor. In some cases processors might be able to fetch more than one bit of data, supposing it has more than one buffer. If this is the case the process has to repeat to load each buffer. MBR (Memory Buffer Register), MAR (Memory Address Register), PC (Program Counter), IR (Instruction Register)

The Decode cycle The decode cycle is responsible for fetching the memory the op code,fetched by the fetch cycle, needs. Depending on the op code this may take some time due, especially when fetching data from main memory. In this cycle it decodes indirect addresses (variable names) into direct addresses in the memory where the information is stored. The Execute cycle This cycle processes the command and returns the result. An example would be the Assembler code Add R0, X. By this point R0 would have been translated into a proper address of where the data can be found by and collected. At this stage it would follow the following commands: 1.      Move value at address X into MAR 2.      Read the memory and insert value into MBR 3.      Compute R0 added to the value of MBR and place in R0 MBR (Memory Buffer Register), MAR (Memory Address Register), PC (Program Counter), IR (Instruction Register)

The Interrupt cycle This cycle would run to see if any other processes needed to run or were called by an event in a chip. These interrupts would be stored in another Register, separate from the cycle, so even if the system was half way through a cycle the interrupt would be noticed at this stage. The following would be executed to allow the execution of the new program and the successful save of the current. 1.      Move current value of PC into MBR. 2.      Move system stack address into MAR. 3.      Move interrupt address into PC. 4.      Move MBR into correct direct system stack address. 5.      Continue cycle with new interrupt routine. 6.      When finished return the system stack address loads and PC is obtained again. Because the new process may be interrupted as well the system stack may fill up. As the processes end however they are removed from the stack and the program underneath is executed. The current running program is said to be at the top of the stack, and only the top of the system stack can be executed or dealt with. All others simply wait for the processor to finish the top process that interrupted. MBR (Memory Buffer Register), MAR (Memory Address Register), PC (Program Counter), IR (Instruction Register)

Detailed Layout of Fetch-Execute Cycle

References http://www.karbosguide.com/hardware/module5a3.htm http://www.cs.mcgill.ca/~cs573/fall2003/suppnotes/lec273/lecture8/index.htm http://en.wikipedia.org/wiki/Input/output_base_address