Question

In: Computer Science

(a) Consider the following MIPS memory with data shown in hex, which are located in memory...

(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

Solutions

Expert Solution

(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 :

  • CR = Number of cycles per second
  • CCT = Clock cycle time, so number of cycles per second is simply its inverse

2.

Ec = IC * CPI

Reasoning notes :

  • CPI is the number of cycles required per instruction, and IC is the total number of instructions in the program. So, multiplying them gives the total number of cycles in the program.

3.

Es = IC * CPI * CCT

Reasoning notes :

  • CPI is the number of cycles required per instruction, and CCT is the clock cycle time (in seconds). So, multiplying them gives the time per instruction (in seconds).
  • Multiplying the above quantity further with IC, gives the time for the program (in seconds).


Related Solutions

Write a MIPS program that always checks the bit 0 of a memory data at address...
Write a MIPS program that always checks the bit 0 of a memory data at address 0x0BF81234. If it is equal to one add nth and (n+1)th elements of an array and store it to memory address 0x0BF85678 . Suppose $t0 contains the address of the 0th element of an array of 32-bit data and $t1 = n.
How does one find the binary and hex for MIPS instructions. Such as, sub $s1, $t7,...
How does one find the binary and hex for MIPS instructions. Such as, sub $s1, $t7, $t8 or lw $s1, 400($s5) ???
Question 3. Describe memory types used in the MIPS assembly. Explain registers used in the MIPS...
Question 3. Describe memory types used in the MIPS assembly. Explain registers used in the MIPS assembly. Differentiate between assembly source code and machine code. Write a note on MIPS instruction formats.
The following problems are related to PIC18F46K22 data memory: (a) What is the data memory space...
The following problems are related to PIC18F46K22 data memory: (a) What is the data memory space and actual implemented size? (b) What does direct addressing mean? (c) What does indirect addressing mean? (d) What is the Access Bank used for? (e) What is the address range for Bank 6? (f) What is the purpose of the registers FSR0, FSR1, FSR2 for?
-If we assume we place the following MIPS code starting at location 8000 in memory, what...
-If we assume we place the following MIPS code starting at location 8000 in memory, what is the MIPS machine code for this code? Show the machine codes in decimal. Please explain each instruction and specify its type ( R format, I format, or J format). k corresponds to register $s4, j corresponds to register $s1, i corresponds to register $s0, and the base of the array v is in $a0 addi $s1,$s0,-1 label2: slti $t0, $s1, 0 bne $t0,...
Consider the headway data shown in the following table. Data was taken from the center lane...
Consider the headway data shown in the following table. Data was taken from the center lane a three-lane intersection approach for a total of ten signal cycles. For the purposes of the analysis, the data may be considered to have been collected under ideal conditions. Calculate the average headway per vehicle ID, and plot the average headways with respect to vehicle positions in the queue for the data shown below. Sketch an approximate best-fit curve through the data. Use the...
The following data are for the Ipad Supplies Company which is a store located in New...
The following data are for the Ipad Supplies Company which is a store located in New York City: Sales are budgeted at $355 ,000, $240,000, and $220,000 for November, December and January, respectively. Collections are expected to be 55% in the month of sale, 40% in the month following the sale, and 5% uncollectible. The cost of goods sold is 60% of sales and includes only the cost of merchandise. The company purchases 60% of its merchandise in the month...
Consider the data shown in the following table. Identify any modifications that would result in a...
Consider the data shown in the following table. Identify any modifications that would result in a more effective table. Comment the characteristics of participants. Baseline Characteristics of Participants in Randomized Trial Characteristic Treatment Group (n = 361) Placebo Group (n = 344) Age, years 45.8 47.6 Male sex 201 198 Systolic blood pressure 128.25 ± 14.2 121.7 ± 13.91 Race/ethnicity Asian 184 180 White 107 100 Hispanic 70 64
This is to be done with MIPS assembly language. Write MIPS code which is equivalent to...
This is to be done with MIPS assembly language. Write MIPS code which is equivalent to the follow java program: int day = (int)(Math.random() * 7); switch (day) { case 1: System.out.println(“Monday”); break case 2: System.out.println(“Tuesday”); break case 3: System.out.println(“Wednesday”); break case 4: System.out.println(“Thursday”); break case 5: System.out.println(“Friday”); break case 6: System.out.println(“Saturday”); break case 0: System.out.println(“Sunday”); break }
Consider the following data on x and y shown in the table below, x 2 4...
Consider the following data on x and y shown in the table below, x 2 4 7 10 12 15 18 20 21 25 y 5 10 12 22 25 27 39 50 47 65 Fit the model E(y)=β0+β1x to the data, and plot the residuals versus x for the model on Minitab. Do you detect any trends? If so, what does the pattern suggest about the model?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT