mt_sol

mt_sol - Name Solution Computer Architecture EE 4720...

Info iconThis preview shows pages 1–4. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Name Solution Computer Architecture EE 4720 Midterm Examination Wednesday, 3 November 2010, 10:40–11:30 CDT Alias ¡Mi! ¡Mi! ¡Mi! ¡Ips! ¡Ips! ¡Ips! ¡Cinco etapes hagan MIPS! Problem 1 (30 pts) Problem 2 (15 pts) Problem 3 (15 pts) Problem 4 (23 pts) Problem 5 (10 pts) Problem 6 (7 pts) Exam Total (100 pts) Good Luck! Problem 1: Show the execution of the following code fragments on the illustrated MIPS implementations. format
 immed
 IR
 Addr
 25:21
 20:16
 IF
 ID
 EX
 WB
 ME
 rsv
 rtv
 IMM
 NPC
 ALU
 Addr
 Data
 Data
 Addr
 D In
 +1
 PC
 Mem
 Port
 Addr
 Data
 Out
 Addr
 Data
 In
 Mem
 Port
 Data
 Out
 rtv
 ALU
 MD
 dst
 dst
 dst
 Decode
 dest. reg
 NPC
 =
 30
 2
 2’b0
 + 15:0
 25:0
 29:26
 29:0
 0
1
 15:0
 ( a ) [20 pts] The code below executes for many iterations. Show a pipeline execution diagram for the execution of the code on the implementation above for enough iterations to determine the CPI, and determine the CPI. checked Pipeline diagram of execution. Don’t forget to check for dependencies! # SOLUTION LOOP: # Cycle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 lw r1, 0(r2) IF ID EX ME WB First Iteration lw r3, 0(r1) IF ID -> EX ME WB bne r3, r4 IF -> ID ----> EX ME WB lw r2, 8(r1) IF ----> ID EX ME WB LOOP: # Cycle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 lw r1, 0(r2) IF ID -> EX ME WB Second Iteration lw r3, 0(r1) IF -> ID -> EX ME WB bne r3, r4 IF -> ID ----> EX ME WB lw r2, 8(r1) IF ----> ID EX ME WB LOOP: # Cycle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 lw r1, 0(r2) Third Iteration IF ID -> EX ME WB checked CPI for a large number of iterations. The first iteration starts in cycle 0, the second in cycle 7, the third in cycle 15. The state of the pipeline at the beginning of the second and third iterations is identical: lw r1 in IF , lw r2 in ID , and bne in EX . Therefore the third iteration will execute identically to the second and the time for the second iteration, 15- 7 = 8 cycles, will be the same as the third, etc. The CPI is 8 4 = 2 . 2 Problem 1, continued: format
 immed
 IR
 Addr
 25:21
 20:16
 IF
 EX
 WB
 MEM
 rsv
 rtv
 IMM
 NPC
 ALU
 Addr
 Data
 Data
 Addr
 D In
 +1
 PC
 Mem
 Port
 Addr
 Data
 Out
 Addr
 Data
 In
 Mem
 Port
 Data
 Out
 rtv
 ALU
 MD
 dst
 dst
 dst
 Decode
 dest. reg
 NPC
 Int Reg File
 FP Reg File
 fd
 fd
 WF
 Addr
Data
 D In
 WE
 Addr
 Addr
 Data
 fsv
 ftv
 15:11
 20:16
 M6
 we
 we
 Decode
 dest. reg
 ID
 A4
 fd
 we
 fd
 we
 A3
 A2
 A1
 M3
 M4
 M5
 xw
 fd
...
View Full Document

This note was uploaded on 12/11/2011 for the course EE 4720 taught by Professor Staff during the Fall '08 term at LSU.

Page1 / 10

mt_sol - Name Solution Computer Architecture EE 4720...

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

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