Question: Th e table below shows 32-bit values of an array stored in memory. Address .............Data 24 ..........................2 38 ..........................4 32 ..........................3 36 ..........................6 40 ..........................1

Th e table below shows 32-bit values of an array stored in memory.

Address .............Data
24 ..........................2
38 ..........................4
32 ..........................3
36 ..........................6
40 ..........................1

1. For the memory locations in the table above, write C code to sort the data from lowest to highest, placing the lowest value in the smallest memory location shown in the figure. Assume that the data shown represents the C variable called Array, which is an array of type int, and that the first number in the array shown is the first element in the array. Assume that this particular machine is a byte addressable machine and a word consists of four bytes.

2. For the memory locations in the table above, write MIPS code to sort the data from lowest to highest, placing the lowest value in the smallest memory location. Use a minimum number of MIPS instructions. Assume the base address of Array is stored in register $s6.

Step by Step Solution

3.60 Rating (172 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 temp Array0 temp2 Array1 Array0 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Organization Design Questions!