Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Instruction Set Design
Computer Organization and Architecture
Computer System Overview
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization and Architecture
Computer Organization and Architecture
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Computer Organization and Architecture The CPU Structure.
Computer System Overview
Computer System Overview
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Chapter 12 CPU Structure and Function. Example Register Organizations.
Chapter 15 IA 64 Architecture Review Predication Predication Registers Speculation Control Data Software Pipelining Prolog, Kernel, & Epilog phases Automatic.
RICARFENS AUGUSTIN JARED COELLO OSVALDO QUINONES Chapter 12 Processor Structure and Function.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
CH12 CPU Structure and Function
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Group 5 Tony Joseph Sergio Martinez Daniel Rultz Reginald Brandon Haas Emmanuel Sacristan Keith Bellville.
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
CPU Registers – Page 1 of 35CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: CPU Registers Reading: Stallings, Sections 10.3,
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
CSCI 4717/5717 Computer Architecture
Edited By Miss Sarwat Iqbal (FUUAST) Last updated:21/1/13
Presented by: Sergio Ospina Qing Gao. Contents ♦ 12.1 Processor Organization ♦ 12.2 Register Organization ♦ 12.3 Instruction Cycle ♦ 12.4 Instruction.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
ECE 456 Computer Architecture
ECE 456 Computer Architecture Lecture #14 – CPU (III) Instruction Cycle & Pipelining Instructor: Dr. Honggang Wang Fall 2013.
Operating System Isfahan University of Technology Note: most of the slides used in this course are derived from those of the textbook (see slide 4)
Computer Architecture 2 nd year (computer and Information Sc.)
Stored Program A stored-program digital computer is one that keeps its programmed instructions, as well as its data, in read-write,
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Lecture 1: Review of Computer Organization
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
Processor Organization
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.
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Chapter 1 Computer System Overview
William Stallings Computer Organization and Architecture 8th Edition
William Stallings Computer Organization and Architecture 7th Edition
Chapter 15 Control Unit Operation
Processor Organization and Architecture
Computer System Overview
Central Processing Unit
Computer Organization and ASSEMBLY LANGUAGE
Processor Organization and Architecture
William Stallings Computer Organization and Architecture 7th Edition
William Stallings Computer Organization and Architecture 8th Edition
Computer Architecture
Chapter 1 Computer System Overview
CPU Structure CPU must:
CPU Structure and Function
Chapter 11 Processor Structure and function
Presentation transcript:

Processor Structure and Function Chapter8:

CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction decoded to determine the action  Fetch data –Execution Instruction may require reading data from memory/ I/O module  Process data –Execution Instruction may require performing some arithmetic/ logical operation on data  Write data –Result from execution may require writing data to memory/ I/O module

CPU With Systems Bus  Major component of processor:  ALU  CU  Registers (internal memory)  ALU does the actual computation/processing of data  CU controls the data and instruction movement into and out of the processor. Also controls ALU operation

CPU Internal Structure

Registers  CPU must have some working space (temporary storage) called registers  Number and function vary between processor designs  One of the major design decisions  Top level of memory hierarchy

User Visible Registers  Enable machine/assembly language programmer to minimize main memory reference by optimizing use of register  Category :  General Purpose  Data  Address  Condition Codes

General Purpose Registers (1)  May be true general purpose  May be restricted (eg. For floating point / stack operation)  May be used for data or addressing  Data – only hold data  Accumulator  Addressing  Segment pointer  Index register  Stack pointer

General Purpose Registers (2)  Make them general purpose —Increase flexibility and programmer options —Increase instruction size & complexity  Make them specialized —Smaller (faster) instructions —Less flexibility

How Many GP Registers?  Between  Fewer = more memory references  More does not reduce memory references and takes up processor real estate  See also RISC

How big?  Large enough to hold full address  Large enough to hold full word  Often possible to combine two data registers —C programming —double int a; —long int a;

Condition Code Registers  Sets of individual bits —e.g. result of last operation was zero  Can be read (implicitly) by programs —e.g. Jump if zero  Can not (usually) be set by programs

Control & Status Registers  Variety of processor registers that are employed to control operation of processor  4 registers are necessary to instruction execution: 1.Program Counter 2.Instruction Decoding Register 3.Memory Address Register 4.Memory Buffer Register  Revision: what do these all do?

Program Status Word  Processor design include register or set of registers and known as PSW, that contain information  contains condition codes + other status info  Common field or flags include:  Sign of last result  Zero  Carry  Equal  Overflow  Interrupt enable/disable  Supervisor

Supervisor Mode  Intel ring zero  Kernel mode  Allows privileged instructions to execute  Used by operating system  Not available to user programs

Other Registers  May have registers pointing to: —Process control blocks (see O/S) —Interrupt Vectors (see O/S)  N.B. CPU design and operating system design are closely linked

Example Register Organizations

Instruction Cycle  Revision  Stallings Chapter 3

Indirect Cycle  May require memory access to fetch operands  Indirect addressing requires more memory accesses  Can be thought of as additional instruction subcycle

Instruction Cycle with Indirect

Instruction Cycle State Diagram

Data Flow (Instruction Fetch)  Depends on CPU design  In general:  Fetch –PC contains address of next instruction –Address moved to MAR –Address placed on address bus –Control unit requests memory read –Result placed on data bus, copied to MBR, then to IR –Meanwhile PC incremented by 1

Data Flow (Fetch Diagram)

Data Flow (Data Fetch)  IR is examined  If indirect addressing, indirect cycle is performed —Right most N bits of MBR transferred to MAR —Control unit requests memory read —Result (address of operand) moved to MBR

Data Flow (Indirect Diagram)

Data Flow (Execute)  May take many forms  Depends on instruction being executed  May include —Memory read/write —Input/Output —Register transfers —ALU operations

Data Flow (Interrupt)  Simple  Predictable  Current PC saved to allow resumption after interrupt  Contents of PC copied to MBR  Special memory location (e.g. stack pointer) loaded to MAR  MBR written to memory  PC loaded with address of interrupt handling routine  Next instruction (first of interrupt handler) can be fetched

Data Flow (Interrupt Diagram)

Prefetch  Fetch accessing main memory  Execution usually does not access main memory  Can fetch next instruction during execution of current instruction  Called instruction prefetch

Improved Performance  But not doubled: —Fetch usually shorter than execution –Prefetch more than one instruction? —Any jump or branch means that prefetched instructions are not the required instructions  Add more stages to improve performance

Computer Performance(1)  Understanding computer performance:  Algorithm – determines number of operations executed  Programming language, compiler, architecture – determines number of machine instructions executed per operation  Processor and memory system – determine how fast instruction are executed  I/O system (incl. OS) – determines how fast I/O operations are executed

Computer Performance(2)

Performance – Let’s look at this…

Computer Performance(3)

Response Time and Throughput  Response Time  how long it takes to do a task  Throughput  total of work done per unit time  How are Response Time and Throughput affected by  replacing the processor with a faster version?  adding more processors?

CPU Clocking  Operation of computer hardware governed by constant-rate of clock

Execution Time(1)  The execution time is defined in terms of:  Elapsed Time  counts everything  a useful number, but often not good for comparison purposes  CPU Time  does not count I/O or time spent running other programs

Execution Time(2)

Basic Definition of Performance(1)  For some program running on machine X, (Performance) x = 1/(execution time) x When X is n times faster than Y machine (Performance) x / (Performance) y = n Problem: Machine A runs a program in 20s Machine B runs the same program in 25s How to improve performance - everything else being equal we can either:  reduce the number of required cycle for a program, or  reduce the clock cycle time (clock rate)

Basic Definition of Performance(2)  Hardware Designer must often trade off clock rate against clock count  Can we assume: # of cycle = # of instructions?  multiplication takes more time than addition  floating-point operations take longer than integer  accessing memory takes more time than registers

CPU Time – proportional to instruction count(1)

CPU Time – proportional to instruction count(2) Any additional instruction you execute takes time. CPU Time: proportional to clock period - how can architects reduce clock period? Instruction’s execution time in “number of cycles” - short clock period => short execution time. What ultimately limits an architect’s ability to reduce the clock periods?

CPU Time – Example(1)

CPU Time – Example(2) Solution:

Aspects of CPU Performance(1)

Aspects of CPU Performance(2)

Performance Equation

Amdahl’s Law(1)

Amdahl’s Law(2)

Enhancement by Multiple CPUs

Experimental Example

Points to remember…..