Question: PART I Write an RV 3 2 - I assembly program using RARS simulator to: Declare an array of fifteen integers. The array elements must

PART I
Write an RV32-I assembly program using RARS simulator to: Declare an array of fifteen integers. The array elements must be in the following order: two numbers in decimal, 0,0xA00000DD,0x80000000,12345678,0,202,80000000,0xF0F0F0F0,1000504,111111112321(3-bit system),550,20008(6-bit system),275.
Implement two subroutines to store only positive even numbers in memory location 0x10010080 and onward:
- One with Packed (Mixed Bit Widths or Compressed) Storage: Pack data using a mix of bit widths based on the actual bit values.
- Another one Sparse storage: Assume you dont have to store the values in consecutive memory addresses even if they all have fixed 32-bit representation or otherwise.
Return to the main program, count the positive, negative, and zero numbers in the array, and display the count in memory locations 0x10010060,0x10010064, and 0x10010068.
PART II
Suggest ways to improve all your programs using optimization techniques.
Improve your program with the suggested optimization techniques and
To verify the assembly program output, write a corresponding C program to implement all of the above Assuming each Assembly code line uses one CPU clock cycle, and each memory address occupies 32 bits; compare the time and memory complexity of various storage methods without any optimization. Compare the time and memory complexity of various storage algorithms with optimization. Confirm your guess with C programs by using time() function time.h header as well as memory usage using functions like mallinfo() in malloc.h to retrieve memory allocation information.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!