THE FETCH-EXECUTE CYCLE.

Slides:



Advertisements
Similar presentations
Fetch-Execute cycle. Memory Read operation Read from memory.
Advertisements

The Fetch – Execute Cycle
Computer Architecture and the Fetch-Execute Cycle
Central Processing Unit
CS364 CH16 Control Unit Operation
Damian BrowneLuis PabonPedro Tovar The operation of a computer in executing a program consists of a sequence of Instruction Cycles, with one machine.
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
The CPU. Parts of the CPU Control Unit Arithmetic & Logic Unit Registers.
CPS 101 Introduction to Computational Science Wensheng Shen Department of Computational Science SUNY Brockport.
Computer Organization and Architecture Tutorial 2 Kenneth Lee.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
The Computer Processor
Lecture 13 - Introduction to the Central Processing Unit (CPU)
CPU Fetch/Execute Cycle
Fetch Execute Cycle Travis Griffiths. Naming Conventions and Disclaimer Individual registers in a particular CPU will have different names depending on.
SAP1 (Simple-As-Possible) Computer
Computer Architecture and the Fetch-Execute Cycle
Computer Architecture and the Fetch-Execute Cycle
CPU Design. Introduction – The CPU must perform three main tasks: Communication with memory – Fetching Instructions – Fetching and storing data Interpretation.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
The structure COMPUTER ARCHITECTURE – The elementary educational computer.
Fetch-execute cycle.
Computer Systems - Registers. Starter… Discuss in pairs the definition of the following Control Unit Arithmetic and Logic Unit Registers Internal clock.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
September 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 2: Implementation of a Simplified Computer Jeremy R. Johnson Wednesday,
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
Fetch-Execute Cycle Fetch the next instruction Decode Execute It.
Computer Systems Organization
Dale & Lewis Chapter 5 Computing components
Structure and Role of a Processor
Processor Organization and Architecture Module III.
Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.
Jeremy R. Johnson William M. Mongan
Central Processing Unit Decode Cycle. Central Processing Unit Current Instruction Register (CIR) I1 The fetch cycle has transferred an instruction from.
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.
Program to multiply 2 numbers 500-Input x 291-Store acc. as x 500-Input y 292-Store acc. as y 193-Load y in to acc. (0 on 1 st parse) 391-Add x to acc.
Little Man Computer Task 1 Last lesson you were asked to write a program to multiply two numbers together. The next slide has a working program to do this.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
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;
Stored Program Concept Learning Objectives Learn the meaning of the stored program concept The processor and its components The fetch-decode-execute and.
OCR GCSE Computer Science Teaching and Learning Resources
Chapter 10: Computer systems (1)
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Symbol Hex Code Description I=0 I=1
Lesson Objectives A note about notes: Aims
Micro-Operations A computer executes a program Fetch/execute cycle
System Architecture 1 Chapter 2.
Data Representation – Instructions
The fetch-execute cycle
Instruction cycle Instruction: A command given to the microprocessor to perform an operation Program : A set of instructions given in a sequential.
Computer Organization and ASSEMBLY LANGUAGE
Instruction and Control II
Intel 8080 Processor The 8080 was an 8-bit processor
Systems Architecture I (CS ) Lecture 2: A Simplified Computer
The Little Man Computer
GCSE OCR 1 The CPU Computer Science J276 Unit 1
Program Execution.
CPU Structure and Function
THE FETCH-EXECUTE CYCLE.
Information Representation: Machine Instructions
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Instruction execution and ALU
Computer Architecture
COMPUTER ARCHITECTURE
Little Man Computer.
Presentation transcript:

THE FETCH-EXECUTE CYCLE

The address of the first instruction is copied from the PC to the MAR REGISTERS ACC Check for interrupts Fetch instruction from memory MBR MAR 1 CIR Execute instruction Update Program counter PC 1 MEMORY Location Contents THE PROGRAM The address of the first instruction is copied from the PC to the MAR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The first instruction is read into the MBR REGISTERS ACC Check for interrupts Fetch instruction from memory MBR LDA 23 MAR 1 CIR Execute instruction Update Program counter PC 1 MEMORY Location Contents THE PROGRAM The first instruction is read into the MBR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The first instruction is copied into the CIR REGISTERS ACC Check for interrupts Fetch instruction from memory MBR LDA 23 MAR 1 CIR LDA 23 Execute instruction Update Program counter PC 1 MEMORY Location Contents THE PROGRAM The first instruction is copied into the CIR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The program counter is updated to point to the next instruction REGISTERS ACC Check for interrupts Fetch instruction from memory MBR LDA 23 MAR 1 CIR LDA 23 Execute instruction Update Program counter PC 2 MEMORY Location Contents THE PROGRAM The program counter is updated to point to the next instruction 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The address part of the current instruction is placed in the MAR REGISTERS ACC Check for interrupts Fetch instruction from memory MBR LDA 23 MAR 23 CIR LDA 23 Execute instruction Update Program counter PC 2 MEMORY Location Contents THE PROGRAM The address part of the current instruction is placed in the MAR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

REGISTERS ACC Check for interrupts Fetch instruction from memory MBR 14 MAR 23 CIR LDA 23 Execute instruction Update Program counter PC 2 MEMORY Location Contents The contents of the location whose address is in the MAR are loaded into the MBR THE PROGRAM 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The contents of the MBR are copied into the ACC REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR 14 MAR 23 CIR LDA 23 Execute instruction Update Program counter PC 2 MEMORY Location Contents THE PROGRAM The contents of the MBR are copied into the ACC 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The Status Register is checked for interrupts REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR 14 MAR 23 CIR LDA 23 Execute instruction Update Program counter PC 2 MEMORY Location Contents THE PROGRAM The Status Register is checked for interrupts 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The address of the second instruction is copied from the PC to the MAR REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR 14 MAR 2 CIR LDA 23 Execute instruction Update Program counter PC 2 MEMORY Location Contents THE PROGRAM The address of the second instruction is copied from the PC to the MAR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The second instruction is read into the MBR REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR ADD 72 MAR 2 CIR LDA 23 Execute instruction Update Program counter PC 2 MEMORY Location Contents THE PROGRAM The second instruction is read into the MBR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The second instruction is copied into the CIR REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR ADD 72 MAR 2 CIR ADD 72 Execute instruction Update Program counter PC 2 MEMORY Location Contents THE PROGRAM The second instruction is copied into the CIR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The program counter is updated to point to the next instruction REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR ADD 72 MAR 2 CIR ADD 72 Execute instruction Update Program counter PC 3 MEMORY Location Contents THE PROGRAM The program counter is updated to point to the next instruction 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The address part of the current instruction is placed in the MAR REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR ADD 72 MAR 72 CIR ADD 72 Execute instruction Update Program counter PC 3 MEMORY Location Contents THE PROGRAM The address part of the current instruction is placed in the MAR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

REGISTERS ACC 14 Check for interrupts Fetch instruction from memory MBR 35 MAR 72 CIR ADD 72 Execute instruction Update Program counter PC 3 MEMORY Location Contents The contents of the location whose address is in the MAR are loaded into the MBR THE PROGRAM 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The contents of the MBR are added to the ACC REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR 35 MAR 72 CIR ADD 72 Execute instruction Update Program counter PC 3 MEMORY Location Contents THE PROGRAM The contents of the MBR are added to the ACC 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The Status Register is checked for interrupts REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR 35 MAR 72 CIR ADD 72 Execute instruction Update Program counter PC 3 MEMORY Location Contents THE PROGRAM The Status Register is checked for interrupts 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The address of the third instruction is copied from the PC to the MAR REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR 35 MAR 3 CIR ADD 72 Execute instruction Update Program counter PC 3 MEMORY Location Contents THE PROGRAM The address of the third instruction is copied from the PC to the MAR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The third instruction is read into the MBR REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR STA 53 MAR 3 CIR ADD 72 Execute instruction Update Program counter PC 3 MEMORY Location Contents THE PROGRAM The third instruction is read into the MBR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The third instruction is copied into the CIR REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR STA 53 MAR 3 CIR STA 53 Execute instruction Update Program counter PC 3 MEMORY Location Contents THE PROGRAM The third instruction is copied into the CIR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The program counter is updated to point to the next instruction REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR STA 53 MAR 3 CIR STA 53 Execute instruction Update Program counter PC 4 MEMORY Location Contents THE PROGRAM The program counter is updated to point to the next instruction 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The address part of the current instruction is placed in the MAR REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR STA 53 MAR 53 CIR STA 53 Execute instruction Update Program counter PC 4 MEMORY Location Contents THE PROGRAM The address part of the current instruction is placed in the MAR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

The contents of the ACC are copied into the MBR REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR 49 MAR 53 CIR STA 53 Execute instruction Update Program counter PC 4 MEMORY Location Contents THE PROGRAM The contents of the ACC are copied into the MBR 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 26 72 35

REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR 49 MAR 53 CIR STA 53 Execute instruction Update Program counter PC 4 MEMORY Location Contents The contents of the MBR are copied into the memory location whose address is in the MAR THE PROGRAM 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 49 72 35

The Status Register is checked for interrupts REGISTERS ACC 49 Check for interrupts Fetch instruction from memory MBR 49 MAR 53 CIR STA 53 Execute instruction Update Program counter PC 4 MEMORY Location Contents THE PROGRAM The Status Register is checked for interrupts 1 LDA 23 2 ADD 72 3 STA 53 23 14 53 49 72 35