Consider the following C++ program fragment:

int a[1000];
int b = 0;
for (int i = 0;  i != 1000;  i++) {
	b = b + a[i];
}

(a) Write a MIPS assembly program which corresponds to this program fragment.
(b) Unroll the loop in the program 4 times in software. Transform the program by register renaming such that the number of stalls is minimized.

Ok I wrote it. Now what?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.