Pennsylvania State University
CMPEN 431
Instructions I pledge that all of the work in this exam is solely mine. Signature: . Please fill your NAME and PSU ID on the top of every page. Pages with NO NAME OR PSU ID will NOT be evaluated All questions have designated spaces for answers. Only those designated spaces will be evaluated. The rest of the white space may be used rou
...[Show More]
Instructions I pledge that all of the work in this exam is solely mine. Signature: . Please fill your NAME and PSU ID on the top of every page. Pages with NO NAME OR PSU ID will NOT be evaluated All questions have designated spaces for answers. Only those designated spaces will be evaluated. The rest of the white space may be used rough work. This exam contains 7 pages (including this cover page) and 4 questions. Grade Table (for grading purposes only) Question Points Score 1 10 2 5 3 10 4 10 Total: 35 Name: PSU ID: Page 2 of 7 1. (10 points) Pipelining and Data Hazards (a) (7 points) Consider the following instructions scheduled on a five stage, scalar MIPS pipeline (FDEMW) with full forwarding and bypass networks; and hazard detection and branch resolution performed in decode stage. For each cycle in the table below, indicate the cycle an instruction completes a stage with a capital letter (FDEMW) and indicate stalls with a lowercase letter (fdemw). Indicate by drawing a vertical arrow when a value is bypassed from one instruction to another in the cycle that the forwarding occurs. For simplicity, omit W → D bypassing arrows. Assume all loads/stores are 1-cycle hits; there are no exceptions; and all branches are perfectly predicted. CYCLE 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 FOO: lw $2, 0($4) lw $3, 0($5) addu $2, $2, $3 sw $2, 0($4) lw $4, 4($4) addi $5, $5, 4 bne $4, 0, FOO (b) (3 points) The following schedule was executed on a different processor: CYCLE 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 FOO: lw $2, 0($4) F D E M W lw $3, 0($5) F D E M W addu $2, $2, $3 F D e E M W sw $2, 0($4) F d D e E M W lw $4, 4($4) f F d D E M W addi $5, $5, 4 f F D E M W bne $4, 0, FOO F D E M W i. Indicate by drawing a vertical arrow when a value is bypassed from one instruction to another during a specific cycle. ii. Indicate where in pipeline do ”hazard detection” and ”branch resolution” occur.
[Show Less]