L6_example-1

L6_example-1 - ELEC152 Computer Organization Pipeline...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ELEC152 Computer Organization Pipeline Example rofessor George Yuan Professor George Yuan Office: Rm. 2527 Email:eeyuan@ust.hk Example 1: Pipeline processor An instruction sequence is going to run on the simple pipeline rocessor in the next slide. Before execution [120]=6, $1=100, processor in the next slide. Before execution [120] 6, $1 100, $2=45, $3=10, $4=10, $5=10, $6=10 2 20($1) 00 lw $2, 20($1) add $3, $2, $4 add $4, $2, $4 dd 6 $4 $2 200 1. What would be the register values in the end? add $6, $4, $2 add $5, $4, $2 2. Is there any hazard? 3. How to resolve it? Is there any bubble generated in the ipeline? pipeline? ELEC152 Computer Organization Spring 2009 Page 2 Pipeline Processor without Forwarding M u x IF/ID EX/MEM MEM/WB 1 ID/EX 4 Add Add result Shift Add Instruction Address left 2 Instruction PC Read data 1 Read register 1 Read register 2 Zero memory Address Write data M u x 1 Registers Read data 2 Write register Write data Read data Data memory 1 ALU result M u x ALU 32 16 Sign extend ELEC152 Computer Organization Spring 2009 Page 3 Cycle 1 [120]=6, $1=100, $2=45, $3=10, $4=10, $5=10, $6=10 A L U IF Reg DM Reg lw Cycle 1: U lw $2, 20($1) 200 lw $2, 20($1) 204 add $3, $2, $4 08 dd 4 $2 $4 M u x 1 208 add $4, $2, $4 212 add $6, $4, $2 216 add $5, $4, $2 4 Add Add result IF/ID EX/MEM MEM/WB Add ID/EX Instruction Address Shift left 2 Instruction PC R i t Read data 1 Read register 1 Read register 2 AL Zero memory 32 Address Write data M u x 1 eg s e s Read data 2 16 Sign Write register Write data Read data Data memory 1 ALU result M u x U 200 ELEC152 Computer Organization Spring 2009 Page 4 extend Cycle 2 lw add [120]=6, $1=100, $2=45, $3=10, $4=10, $5=10, $6=10 A L U IF Reg DM Reg Cycle 2: $2 20($1) dd $3 $2 $4 200 lw $2, 20($1) 204 add $3, $2, $4 08 dd 4 $2 $4 M u x 1 lw $2, 20($1) add $3, $2, $4 208...
View Full Document

This note was uploaded on 01/28/2011 for the course ELEC 152 taught by Professor Chan during the Fall '09 term at HKUST.

Page1 / 17

L6_example-1 - ELEC152 Computer Organization Pipeline...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online