In: Computer Science
(a) Consider the following MIPS memory with data shown in hex, which are located in memory from address 0 through 15. Show the result of the MIPS instruction “lw $s0, 4($a0)” for machines in little-endian byte orders, where $a0 = 4.
Address |
Contents |
0 |
8a |
1 |
9b |
2 |
a3 |
3 |
b4 |
4 |
c5 |
5 |
6d |
6 |
7e |
7 |
8f |
Address |
Contents |
8 |
0a |
9 |
1b |
10 |
2c |
11 |
3d |
12 |
4e |
13 |
5f |
14 |
66 |
15 |
70 |
(b) )Assume we have the following time, performance and architecture parameters in the specified units.
Ec = execution time in cycles/program
Es = execution time in seconds/program
Pr = performance rate in instructions/seconds
CCT = clock cycle time in second/cycle
CR = clock rate in cycle/second
IC = instructions in instructions/program
CPI = average cycles per instruction in cycle/instruction
Complete the following formulas with the appropriate parameter
CR = 1/____, ____ = IC´ CPI, Es = ____ ´ CPI ´ CCT
(a)
lw $s0, 4($a0)
This instruction loads a word into register $s0, from the effective address
= 4 + $a0
= 4 + 4
= 8
Now, since the system is little-endian, so the Least Significant Byte (LSB) will be stored at lower address, and Most Significant Byte (MSB) will be stored at higher address.
So, we need to fetch 4 bytes beginning from address 8, abut reverse them to give the logical value in destination register $s0.
Thus,
$s0 <- 0x3d2c1b0a
(b)
1.
CR = 1 / CCT
Reasoning notes :
2.
Ec = IC * CPI
Reasoning notes :
3.
Es = IC * CPI * CCT
Reasoning notes :