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
Debora [2.8K]
3 years ago
5

For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f , g , h , i , and j

are assigned to registers $s0 , $s1 , $s2 , $s3 , and $s4 , respectively. Assume that the base address of the arrays A and B are in registers $s6 and $s7 , respectively.sll $t0, $s0, 2 # $t0 = f * 4add $t0, $s6, $t0 # $t0 = &A[f]sll $t1, $s1, 2 # $t1 = g * 4add $t1, $s7, $t1 # $t1 = &B[g]lw $s0, 0($t0) # f = A[f]addi $t2, $t0, 4lw $t0, 0($t2)add $t0, $t0, $s0sw $t0, 0($t1)
Computers and Technology
1 answer:
LenaWriter [7]3 years ago
7 0

Answer / Explanation:

Before we answer this question, let us try to understand the meaning of some basic terms as this we help us in better understand the answer provided:

MIPS: This can be refereed to as the assembly language assigned to MIPS processor.

The abbreviated word MIPS means Microprocessor without Interlocked Pipeline Stages and it is a reduced-instruction set architecture.

Now, going back to the question, the answer goes thus:

sll $t0, $s0, 2          // $t0 = f * 4;

add $t0, $s6, $t0   // $t0 = &A[f];

sll $t1, $s1, 2           // $t1 = g * 4;

add $t1, $s7, $t1     // $t1 = &B[g];

lw $s0, 0($t0)         // f = A[f];

addi $t2, $t0, 4       // $t2 = &A[f + 1];

We therefore note that:

                                          // Note here f is still of the original value.

w $t0, 0($t2)                     // $t0 = A[f + 1];

add $t0, $t0, $s0             // $t0 = A[f + 1] + A[f]; // Here assumes a nop.

sw $t0, 0($t1)                    // B[g] = A[f + 1] + A[f];

Now, considering for the overall register:

Overall:

B[g] = A[f + 1] + A[f];

f = A[f];

It can now therefore be concluded that the two statements in the narrative in the question cannot swap order.

You might be interested in
The duties of a database administrator include determining which people have access to what kinds of data in the database; these
fomenos

Answer:

Processing Rights.

Explanation:

The duties of a database administrator include determining which people have access to what kinds of data in the database; these are referred to as processing rights. There are other kind of rights too that will be decided by the Database Administrator. The database administrator grants access to different people depending on the usages of the database. There can be different types of data in the database. These are called the Processing rights.

7 0
3 years ago
Read 2 more answers
Ben assembled parts of a computer and created a fully functional desktop PC. He wants the computer to connect to the Internet. W
Burka [1]
Network interface card. or NIC for short
5 0
4 years ago
How does technology affect our daily lives essay
Gnom [1K]

Technology affects almost every aspect of 21st century life, from transport efficiency and safety, to access to food and healthcare, socialization and productivity. The power of the internet has enabled global communities to form and ideas and resources to be shared more easily. However, the overuse of some technology has been linked to a decline in mental health, increased social division and privacy concerns.

We take technology for granted every day – even when it’s delivering us the latest news in an instant, making our cappuccino, or connecting us with a loved one halfway across the country (or even the world).

4 0
3 years ago
Read 2 more answers
Which file type is the best choice if the image will be made into a billboard?
matrenka [14]

Answer:

BMP

Explanation:

They are high resolution and are suitable for billboards.

6 0
2 years ago
I'm not sure how to do these. By the way, it has to be python.
frutty [35]

Task 1:

float75 = float(75)

string75 = "75"

# you cannot add together a number and a string because a string has no inherent numerical value like a number does.

Task 2:

num = float(input("Enter a number"))

print(num**2)

Task 3:

num = int(input("Enter an integer: "))

print("When you divide "+str(num)+" by 7, the quotient is "+str(num//7)+" and the remainder is "+str(num%7)+".")

Task 4:

gigs = int(input("How many gigabytes does your flashdrive hold? "))

print("A flashdrive with "+str(gigs)+ " gigabyte(s) holds "+str(gigs*8589934592)+" bit(s).")

For task 4, you might have to change the number 8589934592 to something else. I'm not entirely sure how many bits are in a gigabyte. I hope this helps though.

6 0
3 years ago
Other questions:
  • ISBN-13 is a new standard for identifying books. It uses 13 digits d1d2d3d4d5d6d7d8d9d10d11d12d13. The last digit d13 is a check
    9·1 answer
  • Why is it important to develop a research plan?
    5·1 answer
  • What is WEB 1.0 to WEB3.0
    11·1 answer
  • Match the item to the type.
    11·1 answer
  • A) Suppose a computer has an instruction pipeline with 4 phases. How many cycles (if there are no delays) would it take to compl
    13·1 answer
  • Coral Given three floating-point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the a
    6·1 answer
  • Consider the code below. When you run this program, what is the output if the temperature is 77.3 degrees Fahrenheit?
    6·1 answer
  • Genetics Vocabulary: no <br> Allele: Different versions of the same qene (Aa, Bb)
    11·1 answer
  • You are the administrator for the ABC Company. You are looking to install Windows Server 2016, and you need to decide which vers
    13·1 answer
  • _______________________ variables do not need to be declared inside the function definition body, they get declared when the fun
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!