Group 5 Tony Joseph Sergio Martinez Daniel Rultz Reginald Brandon Haas Emmanuel Sacristan Keith Bellville.

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Computer Organization and Architecture
Processor structure and function
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.
Chapter 12 Pipelining Strategies Performance Hazards.
Computer System Overview
1 Computer System Overview OS-1 Course AA
Computer System Overview
Chapter 7 Interupts DMA Channels Context Switching.
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
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.
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
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.
5-Stage Pipelining Fetch Instruction (FI) Fetch Operand (FO) Decode Instruction (DI) Write Operand (WO) Execution Instruction (EI) S3S3 S4S4 S1S1 S2S2.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
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.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Edited By Miss Sarwat Iqbal (FUUAST) Last updated:21/1/13
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
CPU Design and PipeliningCSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: CPU Operations and Pipelining Reading: Stallings,
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 Lecture #14 – CPU (III) Instruction Cycle & Pipelining Instructor: Dr. Honggang Wang Fall 2013.
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
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
CPU Design and Pipelining – Page 1CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: CPU Operations and Pipelining Reading:
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.
Computer Architecture Chapter (14): Processor Structure and Function
William Stallings Computer Organization and Architecture 8th Edition
Chapter 9 a Instruction Level Parallelism and Superscalar Processors
Processor Organization and Architecture
Computer System Overview
Computer Organization and ASSEMBLY LANGUAGE
Computer Architecture
Computer System Overview
CPU Structure and Function
Chapter 11 Processor Structure and function
Presentation transcript:

Group 5 Tony Joseph Sergio Martinez Daniel Rultz Reginald Brandon Haas Emmanuel Sacristan Keith Bellville

 To understand the organization of the CPU, we must learn those requirement which are  Fetch instructions  Interpret instructions  Fetch data  Process data  Write data Organization of the CPU

 Fetch instructions: the CPU reads an instruction from the memory  Interpret instruction: the instruction is decode to determine what action is required  Fetch data: the execution of an instruction may require reading data from memory or an I/o module  Process data: the execution of an intruction may require to perform arithmetic or logic operation Instruction Definition

 Write data: the results of an executive may require writing data to memory or an I/O module.  The CPU is connected to the rest of the system by the system bus.  The major components of the CPU are the arithmetic and logic unit (ALU) and control unit (CU). Definitions Cont.

 The ALU does the actual computation or processing of data.  The CU controls the movement of the data and instruction into and out of the CPU and controls the operation of the ALU.  It has a minimal internal memory called register ALU and CU

 Computer employs memory hierarchy, at higher levels of hierarchy, memory is faster, smaller and more expensive.  Within the processor, there is a set of registers that function as a level of memory above main memory and cache in the hierarchy level. Registers in the Processor Registers in the Processor User-visible User-visible Control and Status Control and Status

May be referenced by machine language programmer:  General purpose  Data  Address  Condition codes User-Visible Registers

Data (hold data only) Addressing (general purpose or addressing mode) Segment pointers Index Stack pointer General Purpose True general purpose (can contain the operand for any opcode) Restricted (dedicated for floating and stack operations) Sometimes used for addressing and data.

Make them general purposeMake them specialized Increase flexibility and programmer options Increase instruction size & complexity Smaller (faster) instructions Less flexibility

Condition Codes An arithmetic operation may produce a positive, negative, zero, or overflow result. Those results are stored into one or more registers, usually forming part of control registers. They can be read but not altered by the programmer. The condition code may be tested as part of a conditional branch operation. Many processors do not use condition codes, but they use conditional branch instructions to make comparison without using condition codes.

Condition Codes Advantages and Disadvantages: Advantages: Reduce the number of compare and test instructions needed. Conditional instructions are simplified to composite instructions. Facilitate multi-way branches. Disadvantages: Add complexity to hardware and software. Irregular, they are not typically part of data path, so they require extra wire connections. Must add non-condition code instructions. In a pipeline implementation, they require special synchronization to avoid conflicts.

User-Visible Registers In some machines, a subroutine call will result in the automatic saving of all user-visible registers, to be restored on return. This allows each subroutine to use this registers independently. On other machines it is a task to be performed by the programmer.

1.- program counter 2.- instruction register 3.- memory address register 4.- memory buffer register

 1.- Sign : contains the sign bit of the result  2.- Zero: set when the result is zero  3.- Carry: set if an operation resulted in a carry into or borrow out of high-order bit  4.-Equal: set if a logical compare result is equality  5.- Overflow: used to indicate arithmetic overflow  6.- Interrupt : used to enable or disable interrupts  7.- Supervisor : indicates whether the cpu is executing in supervisor or user mode

 PCI Standard Registers  VID - Vendor Identification Register  DID - Device Identification Register  RID - Revision Identification Register  CCR - Class Code Register  HDR - Header Type Register  SID/SVID - Subsystem Identity/Subsystem Vendor  Identification Register  PCICMD - Command Register  PCISTS - PCI Status Register  SAD - System Address Decoder Registers  SAD_PAM0123  SAD_PAM456  SAD_HEN  SAD_SMRAM  SAD_PCIEXBAR  SAD_DRAM_RULE_0, SAD_DRAM_RULE_1, SAD_DRAM_RULE_2,  SAD_DRAM_RULE_3  SAD_DRAM_RULE_4, SAD_DRAM_RULE_5  SAD_DRAM_RULE_6, SAD_DRAM_RULE_7  SAD_INTERLEAVE_LIST_0, SAD_INTERLEAVE_LIST_1  SAD_INTERLEAVE_LIST_2, SAD_INTERLEAVE_LIST_3  SAD_INTERLEAVE_LIST_4, SAD_INTERLEAVE_LIST_5  SAD_INTERLEAVE_LIST_6, SAD_INTERLEAVE_LIST_7

 MC bit register into eight data registers and nine address registers  Intel bit data register, and four pointer and index register

 To recap, basic instruction cycle contains: ◦ Fetch: Read the next instruction from memory into the processor. ◦ Execute: Interpret the opcode and perform the indicated operation. ◦ Interrupt: If interrupts are enabled and an interrupt has occurred, save the current process state and service the interrupt.

 Execution requires memory access to one or more operands.  Indirect addressing requires additional memory access.  This can be thought of as an additional instruction stage.

 Most activity consists of alternating between fetch and execute.  Fetch opcode  Check addressing  Execute  Check for Interrupt ◦ Service ◦ No interrupt  Fetch next opcode

 Event sequencing depends on design of processing unit.  Assume processor uses: ◦ Memory Address Register (MAR) ◦ Memory Buffer Register (MBR) ◦ Program Counter (PC) ◦ Instruction Register (IR)

 An instruction is fetched from memory  PC Contains address of next instruction  This address is moved to MAR and placed on address bus  Control Unit requests memory read and result is placed on data bus to be placed into MBR and then to the IR.  PC is incremented for the next fetch

 Fetch cycle ends  Control Unit examines IR for indirect addressing  Rightmost N bits of the MBR moved to MAR  CU requests memory read to get the address of operand into MBR

 Contents of PC must be saved ◦ Moved to MBR to be written ◦ Special memory location for this purpose is loaded into MAR from the CU  PC is loaded with address of interrupt routine  Next instruction cycle begins with fetch

o Fetch Instruction ( FI ) o Decode Instruction ( DI ) o Calculate Operands ( CO ) o Fetch Operands ( FO ) o Execute Instruction ( EI ) o Write Operand ( WO ) Stages of Instruction Processing

 Without pipelining, registers become idle between stages  With pipelining registers can be used between stages by other instruction sets  Very similar to an assembly line  Various stages allows for multiple instructions sets to occur simultaneously  Ideally the instruction sets go through all stages  The more stages the better the pipeline

 A pipeline hazard occurs when some portion of the pipeline must stall because conditions do not permit continued execution.  The different hazards are: ◦ Resource Hazard ◦ Data Hazard ◦ Control Hazard

 When two or more instructions require the same resource in a pipeline  This causes execution to be done in serial as opposed to parallel  This is sometimes referred to as a Structural Hazard  Another example when two stages require access to the ALU

 Read after write ( RAW ) : An instruction modifies a register or memory location before another instruction reads from said location. Hazard occurs if read takes place before write.  Write after read ( WAR ) : Instruction reads a register or memory location before another instruction writes to location. Hazard occurs if write completes before the read.  Write after write ( WAW ) : Two instructions write to the same location. Hazard occurs if write order occurs in reverse.

 Known as a Branch Hazard  Occurs when pipeline makes wrong decision on a branch prediction which brings in a instruction set that needs to then be discarded.

 A major problem in designing a pipeline is dealing with conditional branch instructions.  Impossible to determine if a branch will be taken until execution.  There are several approaches to the problem of conditional branches.

 Methods for dealing with branches ◦ Multiple Streams ◦ Pre-fetch the branch target ◦ Loop buffer ◦ Branch prediction ◦ Delayed branch

 Simple pipelines suffer a penalty if they choose the wrong instruction for a branch.  Solution, replicate initial pipeline portions.  Fetch both instructions.  Two problems with this approach. ◦ Register access delay. ◦ Each branch requires a stream.

 Identify the conditional branch, prefetch the target.  Prefetch the instruction after the target.  Save the target.  Target and instruction already fetched if branch is taken.  Method is a gamble.

 A small, high speed memory.  Contains the most recently fetched instructions.  Procedure if a branch is taken ◦ Check the loop buffer for the target ◦ Fetch instruction from loop buffer.

 Loop buffer benefits ◦ Instructions in sequence will be available without the usual memory access time. ◦ Targets a few address locations ahead will be preloaded ◦ With a large enough buffer an entire loop’s worth of instructions need only be fetched once.

 Common techniques for predicting. ◦ Predict never taken ◦ Predict always taken ◦ Predict by opcode ◦ Taken/not taken switch ◦ Branch history table

 Predict never taken. ◦ Assume the branch is never taken ◦ Fetch instructions as if there were no branch  Predict always taken. ◦ Assume the branch is always taken ◦ Fetch the instructions from the branch target  Predict by opcode. ◦ Decide if a branch is taken by the branch opcode.

 Taken/not taken switch. ◦ Record the history of branch instructions ◦ More than one bit is preferred ◦ Use the history as a guide for the next encounter ◦ A drawback, the target cannot be fetched until the target address is decoded.

 Branch history table. ◦ A small cache of memory ◦ Helps solve the problem of taken/not taken switch ◦ Usually three elements in the table  Address of the branch instruction  A number of history bits  Information about the target

 Possible to improve the pipeline through rearranging instructions.  Arrangements are made so that branches occur later in a program  Further examined in chapter 13

1) What are the two major components of a CPU? 2) How are the user-visible registers classified? 3) What are the four registers needed in order for the control and status register to work? 4) All CPU designs include a register or set of registers often known as? 5) What register does the control unit examine to determine addressing mode? 6) Why do the PC contents need to be stored in memory in the event of an interrupt.

7) What are the hazards in pipelining? 8) Does pipelining increase clock speed? 9) What is the difference between Predict Never Taken and Predict Always Taken? 10) What is one of the two problems with multiple streams?

1) ALU and Control Unit 2) General purpose, Data, Address, Condition Code 3) The IR, PC, MAR, MBR 4) PSW 5) IR 6) Contents must be saved so the processor can resume normal activity after the interrupt.

7) Control, data, and resource hazards 8) No, it increases the amount of instructions able to be completed in a given cycle. 9) PNT assumes the branch is never taken, PAT assumes the branch target will always be taken. 10) Multiple streams will encounter delays for access to a needed register or each stream can encounter a branch of its own.

 Processors and datapath  proc.html proc.html  Pipelining overview  ining-1.ars/1 ining-1.ars/1  Intel core i7 data sheet  hts/ pdf hts/ pdf