1 / 22

CMPT 250 Computer Architecture

CMPT 250 Computer Architecture. Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Final Exam!. The final exam is scheduled on 7 th , August, Friday 7:00 pm – 10:00 pm. The Reduced Instruction Set Computer (RISC).

orinda
Download Presentation

CMPT 250 Computer Architecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPT 250 Computer Architecture Instructor: Yuzhuang Hu yhu1@cs.sfu.ca

  2. Final Exam! • The final exam is scheduled on • 7th, August, Friday • 7:00 pm – 10:00 pm

  3. The Reduced Instruction Set Computer (RISC) • The goal of a RISC architecture is high throughput and fast execution. To achieve these goals, accesses to memory are to be avoided. • A RISC architecture has the following properties: • Memory accesses are restricted to load and store instructions, and data-manipulation instructions are register-to-register. • Addressing modes are limited in number. • Instruction formats are all of the same length. • Instructions perform elementary operations.

  4. Datapath Organization • The new datapath has 32 32-bit registers. The address inputs are therefore five bits. • The replacement of the single-bit position shifter with a barrel shifter to permit multiple-position (SH) shifting. • In the function unit, the ALU is expanded to 32 bits. • The constant unit performs zero fill for CS=0 and sign extension for CS=1. • MUX A is added to provide a path from the updated PC, PC-1, for implementation of the JML instruction.

  5. Datapath Organization contd. • Adding an additional input to MUX D to implement the Set if Less Than (SLT) instruction. It is 1 when N is 1 and V is 0, or N is 0 and V is 1. • A final difference is that the register file is no longer edge triggered and is no longer a part of a pipeline platform at the end of the write-back (WB) stage. • In the second half of the cycle, it is possible to read data written into the register file during the first half of the same clock cycle. It is called a read-after-write register file.

  6. Control Organization • SH is added to IR, CS is added to the instruction decoder, MD is expanded to two bits. • MUX C selects from three different sources for the next value of PC. • BrA is formed from the sum of the updated PC value for the branch instruction and the target offset. • BAA is used for the register jump. • BS, PS and Z are used to select the next PC value.

  7. Definition of Control Fields BS and FS

  8. Data Hazards • Unfortunately, there are other problems with pipeline operation that reduce throughput. • Data Hazards • Control Hazards

  9. Data hazards • Consider the following instructions • MOV R1, R5 • ADD R2, R1, R6 • ADD R3, R1, R2 4 1 2 3 5 Mov R1, R5 Add R2, R1, R6 Add R3, R1, R2

  10. A Program Based Solution • Add NOPs to the program. 4 7 1 2 3 5 6 8 Mov R1, R5 NOP Add R2, R1, R6 NOP Add R3, R1, R2

  11. Data Hazard Stall • Insert bubbles to the pipeline. 4 7 1 2 3 5 6 8 Mov R1, R5 (Add R2, R1, R6) Add R2, R1, R6 (Add R3, R1, R2) Add R3, R1, R2 Data hazards detected, pipeline stalled, bubble launched

  12. Data Forwarding • No extra delay. Mov R1, R5 Add R2, R1, R6 Add R3, R1, R2

  13. Control Hazards 1 BZ R1, 18 2 MOV R2, R3 3 MOV R1, R2 4 MOV R4, R2 20 MOV R5, R6 PC set to 20 Change in R2 Change in R1 BZ R1, 18 MOV R2, R3 MOV R1, R2 MOV R5, R6

  14. A Program Based Solution 1 BZ R1, 18 2 MOV R2, R3 3 MOV R1, R2 4 MOV R4, R2 20 MOV R5, R6 PC set to 20 No change No change BZ R1, 18 NOP NOP MOV R5, R6

  15. Branch Prediction 1 BZ R1, 18 2 MOV R2, R3 3 MOV R1, R2 4 MOV R4, R2 20 MOV R5, R6 PC set to 20 No change No change BZ R1, 18 NOP NOP MOV R5, R6 Branch detected and bubbles launched

  16. CISC Architecture • The goal of the CISC architecture is to match more closely the operations used in programming language and to provide instructions that facilitate compact programs and conserve memory. • A purely CISC architecture has the following properties: • Memory access is directly available to most types of instructions. • Addressing modes are substantial in number. • Instruction formats are of different lengths. • Instructions perform both elementary and complex operations.

  17. THANKS!

More Related