Computer Architecture and the Fetch-Execute Cycle

Slides:



Advertisements
Similar presentations
The CPU The Central Presentation Unit What is the CPU?
Advertisements

Central Processing Unit
The CPU. Parts of the CPU Control Unit Arithmetic & Logic Unit Registers.
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
Computer Systems. Computer System Components Computer Networks.
Stored Program Concept: The Hardware View
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
Elements of the Computer (How a processor works)
1 TK6123: COMPUTER ORGANISATION & ARCHITECTURE Prepared By: Associate Prof. Dr Masri Ayob Lecture 6: CPU and Memory (1)
A-Level Computing#BristolMet Session Objectives#4 MUST describe the differences between the main types of primary memory SHOULD describe the function and.
The Computer Processor
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Computer Structure.
Basic Operational Concepts of a Computer
A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.
Computer Systems 1 Fundamentals of Computing The CPU & Von Neumann.
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.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
DH2T 34 – HNC Computer Architecture 1 Lecture 14 The Fetch-Decode-Execute Cycle [1]. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College.
Fetch-execute cycle.
Computer Systems - Registers. Starter… Discuss in pairs the definition of the following Control Unit Arithmetic and Logic Unit Registers Internal clock.
D75P 34 – HNC Computer Architecture
Computer Studies/ICT SS2
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
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.
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.
Dale & Lewis Chapter 5 Computing components
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Structure and Role of a Processor
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
CSIT 301 (Blum)1 Instructions at the Lowest Level Some of this material can be found in Chapter 3 of Computer Architecture (Carter)
1 3 Computing System Fundamentals 3.2 Computer Architecture.
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.
24/06/20161 Hardware Processor components & ROM. 224/06/2016 Learning Objectives Describe the function and purpose of the control unit, memory unit and.
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.
CPU Lesson 2.
OCR GCSE Computer Science Teaching and Learning Resources
Systems Architecture Keywords Fetch Execute Cycle
The CPU, RISC and CISC Component 1.
Von Neumann architecture
Chapter 10: Computer systems (1)
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Stored program concept
3.3.3 Computer architectures
Lesson Objectives A note about notes: Aims
Computer Architecture
Hook – CPU Knowledge Check
Teaching Computing to GCSE
System Architecture 1 Chapter 2.
The Processor and Machine Language
Computer Science 210 Computer Organization
Functional Units.
Basic Computer Organization
Computer Architecture
1-2 – Central Processing Unit
Unit 1.1 System Architecture Lesson 2
GCSE OCR 1 The CPU Computer Science J276 Unit 1
A Top-Level View Of Computer Function And Interconnection
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.
Computer Architecture
COMPUTER ARCHITECTURE
Computer Science. The CPU The CPU is made up of 3 main parts : Cache ALU Control Unit.
Presentation transcript:

Computer Architecture and the Fetch-Execute Cycle Von Neumann Architecture

Learning Objectives Describe basic Von Neumann architecture, identifying the need for and the uses of special registers in the functioning of a processor.

Stored Program John Von Neumann introduced the idea. Previously data and programs were stored in separate memories. Von Neumann realised that data and programs are indistinguishable and can, therefore, use the same memory. This led to the introduction of compilers which accepted text as input and produced binary code as output.

Von Neumann Architecture Program is stored in memory along with data. Programs and data are indistinguishable. Uses a single processor. Sequential carrying out of instructions.

Registers Small, permanent storage locations within the CPU used for a particular purpose. They are only storage locations and do not do anything themselves.

Von Neumann Architecture Uses a single processor which follows a linear sequence of fetch-decode-execute. In order to do this, the processor has to use some special registers. Register Meaning PC / SCR Program Counter / Sequence Control Register CIR Current Instruction Register MAR Memory Address Register MDR / MBR Memory Data Register / Memory Buffer Register ACC Accumulator - Holds results

Typical Layout 1 4 3 2

Central Processor Unit (CPU) Contains: Arithmetic - Logic Unit (ALU) (also known as the arithmetic unit) Holds the accumulator. But also has other circuitry to do its job. Control Unit Holds PC & CIR Memory Data Register (MDR) Memory Address Register (MAR). Remember the registers are simply storage locations. The Control unit and the ALU hold some of these registers but they also have extra circuitry which actually do “things”.

Typical Layout 1 4 3 2

Control Unit Has circuitry which fetches instructions from memory, decodes them and synchronises the operations before sending signals to other parts of the computer. Also contains the instruction registers (PC & CIR).

Typical Layout 1 4 3 2

Program Counter (PC) / Sequence Control Register (SCR) Stores the address of (so that the control unit can keep track of where to find) the next instruction to be accessed so that a copy of the instruction can be placed in the current instruction register. The initial contents of the PC is the address of the first instruction of a program and it is copied in by the Loader (see Memory Management Presentation).

Program Counter (PC) After the address is copied into the MAR the PC is incremented by 1. At this point it could be said to hold the address of the instruction after the next instruction (as we have not technically started executing the next instruction we should still refer to it as the next instruction). Assumes that the instructions will be in consecutive locations but if it is a jump instruction the PC will be altered again at the end of the cycle.

PC / SCR Sometimes the program counter is called the Sequence Control Register (SCR) as the control unit uses its contents to control the sequence of instruction execution.

Typical Layout 1 4 3 2

Memory Address Register (MAR) Also used to hold / store the memory address (copied from the PC) that contains the instruction to be used next but can also hold the memory address of data needed to execute the next instruction. After the address has been copied from the PC into the MAR the PC is incremented by 1. Assumes that the instructions are in consecutive locations but if it is a jump instruction the PC will be altered again at the end of the cycle.

MAR You may be wondering: why the address is copied into the MAR when it is already in the PC? Why not use the address straight from the PC? You will find out the answer to this in the next presentation (Fetch-Decode-Execute-Reset Cycle Presentation). Basically the MAR may have to be used to store an address of data needed to execute the next instruction. As no register can hold more than one “thing” at a time the control unit may copy an address of data needed to execute the next instruction over the address of the next instruction in the PC.

Typical Layout 1 4 3 2

Memory Data Register (MDR) / Memory Buffer Register (MBR) Acts like a buffer and holds anything that is copied from the memory ready for the processor to use it. This could be the next instruction copied from the memory address held in the MAR but it could also be a piece of data (copied in from an address in memory or back from the instruction in the CIR – see next slide) needed to execute the next instruction.

MDR / MBR Sometimes the memory data register is called the Memory Buffer Register (MBR) as it acts as a buffer between the primary memory and the processor.

Typical Layout 1 4 3 2

Current Instruction Register (CIR) Holds the instruction while it is being executed. The binary code held in the CIR is split into an operation code and an address.

CIR Again you may be wondering why the instruction is copied into the CIR when it is already in the MDR? Again you will find out the answer to this in the next presentation (Fetch-Decode-Execute-Reset Cycle Presentation). Basically the MDR may have to be used to store data needed to execute the next instruction. As no register can hold more than one “thing” at a time the control unit may copy data needed to execute the next instruction over the current instruction in the MDR. So it would no longer “know” what it was supposed to do.

Typical Layout 1 4 3 2

Arithmetic - Logic Unit (ALU) Internal circuitry processes data here (arithmetic and logical operations). Arithmetic operations are those that add and subtract numbers, and so on. Logical operations involve comparing binary patterns and making decisions. Also contains the accumulator.

Typical Layout 1 4 3 2

Accumulator (ACC) Stores results of calculations. All input to and output from processor pass through the accumulator.

Reset Cycle is reset (restarted) by passing control back to the PC.

Control Unit & ALU Remember the registers are simply storage locations and do not “do” anything. The Control Unit “does” everything described in this presentation except for arithmetic and logical operations which is done by the ALU, but even then the Control Unit tells it what to do (i.e. add this to this, compare this with this, etc…).

Example Cycle

Typical Layout 1 4 3 2

Typical Layout 1 4 3 2

Typical Layout 1 4 3 2

Typical Layout 1 4 3 2

Typical Layout 1 4 3 2

Plenary What is Von Neumann architecture?

Von Neumann Architecture Program is stored in memory along with data. Programs and data are indistinguishable. Uses a single processor. Sequential carrying out of instructions.

Plenary Explain the purpose of each of the following special registers in a processor. Program Counter (Sequence Control Register). Current Instruction Register. Memory Address Register. Memory Data Register. Accumulator.

Program Counter (PC) / Sequence Control Register (SCR) Stores the address of (so that the control unit can keep track of where to find) the next instruction to be accessed so that a copy of the instruction can be placed in the current instruction register. The initial contents of the PC is the address of the first instruction of a program and it is copied in by the Loader (see Memory Management Presentation).

Common confusions with the PC The PC DOES NOT: Keep track of the number of programs running. Or Keep the order in which programs have been called.

Memory Address Register (MAR) Also used to hold / store the memory address (copied from the PC) that contains the instruction to be used next but can also hold the memory address of data needed to execute the next instruction. After the address has been copied from the PC into the MAR the PC is incremented by 1. Assumes that the instructions are in consecutive locations but if it is a jump instruction the PC will be altered again at the end of the cycle.

Memory Data Register (MDR) / Memory Buffer Register (MDR) Acts like a buffer and holds anything that is copied from the memory ready for the processor to use it. This could be the next instruction copied from the memory address held in the MAR but it could also be a piece of data (copied in from an address in memory or back from the instruction in the CIR – see next slide) needed to execute the next instruction.

Current Instruction Register (CIR) Holds the instruction while it is being executed. The binary code held in the CIR is split into an operation code and an address.

Accumulator (ACC) Stores results of calculations. All input to and output from processor pass through the accumulator.