1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
11Alexandr11 [23.1K]
3 years ago
5

For the following MIPS code write the C equivalent: The following code fragment processes two arrays and produces an important v

alue in register $v0. Assume that each array consists of 2500 words indexed 0 through 2499, that the base addresses of the arrays are stored in $a0 and $a1 respectively, and their sizes (2500) are stored in $a2 and $a3 , respectively. Add comments to the code and describe in one sentence what this code does. Specifically, what will be returned in $v0 ? Also, convert this MIPS code to C (you may find it easier to understand if you do this first!).
Computers and Technology
1 answer:
mestny [16]3 years ago
8 0

Answer:

//get size of array one

int size1 =2500; // sll $a2,$a2,2

int array1[size1];

//get size of array two

int size2 = 2500; // sll $a3,$a3,2

int array2[size2];

int v0=0 ; // $v0,$zero,$zero

int t0 = 0; //$t0,$zero,$zero

do{ //outer:

//add $t4,$a0,$t0

//lw $t4,0($t4)

int t4 = array1[t0];

int t1 = 0; //$t1,$zer0,$zer0

do{

//add $t3,$a1,$t1

//lw $t3,0($t3)

int t3 = array2[t1];

if(t3==t4){ //bne $t3,$t4,skip

v0 = v0+1; //addi $v0,$v0,1

}

//skip:

t1 = t1+1; //addi $t1,$t1,4

}while(t1!=size2);

t0 = t0+1; //addi $to,$to,4

}while(t0!=size1);

return 0;

Given code loops through the two array. It will count the number of duplicates found in both array.

You might be interested in
What aspect does not provide context in a portrait?
Svetradugi [14.3K]
I believe the correct answer is d. movement
8 0
3 years ago
Read 2 more answers
Which step in the software development life cycle involves making improvements based on user feedback?
Dima020 [189]

Answer:

The step is Testing oki doki

6 0
3 years ago
I need the answers. i don’t get this
bixtya [17]
Run,lazy,turtles,slow,wandering, jump,45,weird,pigs, cows, cousins, pale,rude,candles

There are many answers for this but this is what first came to my mind

Hope this helps
4 0
3 years ago
What type of function is being performed when a router screens packets based on information in the packet header
Helga [31]

Answer:

"Router screening" is the correct option.

Explanation:

  • A router that philters packets like a firewall. For certain instances, the whole firewall system is such a single scanning router.
  • Often connected to a network stage as well as a container-filter firewall has been the scanning router firewall. This rather firewall operates by filtering protocol characteristics from received packets.

So that the above seems to be the correct approach.

3 0
4 years ago
The expectations I would discuss with Erica regarding the usage of the internet
ryzh [129]

Answer:

Tell her about cyber bullies

Tell her about hackers

stalkers

identity theft

spam

Sorry if wrong

Explanation:

8 0
3 years ago
Other questions:
  • Few people will care if you use their image in a photograph without obtaining their consent. True False
    10·1 answer
  • PLEASE HELP!!!!! MUCH OBLIGED!!!!
    15·1 answer
  • If a computer is found to have an ip address of 169.254.1.1, what can you assume about how it received that ip address?
    11·1 answer
  • An enterprise system is a packaged software application that helps integrate various ___________ in a company.
    15·2 answers
  • Why is it important for software developers to study Human-Computer Interaction? to make sure a user interface is easy to use, w
    10·2 answers
  • Which of the following takes place during the research phase
    7·1 answer
  • Which of the following is a valid variable name? a. salesTax b. input-string c. 25Percent d. double
    8·1 answer
  • The radix sort
    14·1 answer
  • Using Visio, create a Local Area Network (LAN) consisting of 12 computers, a switch, and three printers. The switch should be in
    11·1 answer
  • What is the next line?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!