1. [30 points] This problem pertains to the following sequence of MIPS instructions:
Instruction Address
0x24
0x28
0x2C
0x30
0x34
0x38
Instruction
add $1, $2, $1
beq $1, $3, 2 ; # and yes the 2 is a number
nop
add $12, $2, $2
add $13, $12, $2
sw $13, 10($10)
a) What, if any, are the data hazards in this code segment? Identify any dependencies using arrows in the code above.
b) What, if any, are the control hazards in this code segment? List any instruction below which would cause a control hazard.
Register Contents
1 0x50
2 0x28
3 0x78
10 0x102
12 0xF
Table 1: Contents of selected registers of the register file
c) Given the above initial contents of the registers shown in Table 1, what is the result of the computation and where is the result stored (at which address)? Show the result of each executed instruction.