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
xz_007 [3.2K]
3 years ago
8

Given a high-level code you should be able to write the corresponding MIPS assembly code. Simple loop in C; A[ ] is an array of

ints do { g = g + A[i]; i = i + j; while (i != h) } Rewrite this as: Loop: g = g + A[i]; i = i + j; if (i != h) goto Loop; Using the mapping: g: $s1, h: $s2, i: $s3, j: $s4, base of A: $s5; write the corresponding assembly instructions
Computers and Technology
1 answer:
nevsk [136]3 years ago
4 0

Answer:

Explanation:

The code for the given problem is written below

.data

A : .word 1 2 3 4 5 6 7 8 9 10

.text

la $s5,A

li $s1,0 # load g

li $s2,10 # load h

li $s3,0 # load i

li $s4,1 # load j

loop:

mul $s6,$s3,4

add $s6,$s6,$s5 #address of A[i]

lw $s6,($s6) #get value of A[i] in s3

add $s1,$s1,$s6 #g = g+A[i]

add $s3,$s3,$s4 # i = i+j

bne $s3,$s2,loop #if i!=h jump to loop

You might be interested in
What's the best way to change the font size of all your notes pages at once?
defon
On which os? mac os windows linux?
7 0
3 years ago
When does patch 1.6 come out for the division?
Fynjy0 [20]
Thurdsay the 9th of february 
5 0
3 years ago
Your employer is opening a new location, and the IT director has assigned you the task of calculating the subnet numbers for the
astraxan [27]

Answer:

Check the explanation

Explanation:

• We are taking a look at the class B network beginning with 172.0.0.0.0,while Converting this value to binary as:10101100.00010100.00000000.00000000.  32 bits in total, out of this the First 16 bits that are used as network ID and the subsequent 16 bits are used as HostID.Out of the 16 bits that are sued for Network ID the 2 bits namely Bits fifteen and sixteen (15 and 16) have been set and can't be changed and hence only 14 bits are used as network ID.

• Now so that we can divide this network into 50 subnets for class B network we will have to borrow a bit as shown below:

• 10101100.00010100.00000000.00000000=172.0.0.0.0,Adding 1 bit by borrowing from host portion and adding it to network ID will give it 10101100.00010100.00000000.00000000(0 shown in bold) or10101100.00010100.10000000.00000000 (1 shown in bold) will give us 2 unique subnets.i.e changing 1 bit will give us 2 power 1=2 subnets,thus changing 2 bits will give us 2 power 2 subnets =4 similarly changing 6 bits will give us 64 unique subnets.

• Which means and going by the above problem statement in case we need 50 subnets and we also need to change 6 bits in the Network ID to give 50 unique subnets.

• Thus the answer is 6

3 0
4 years ago
You invested $2,300 in a stock. Your account now has a value of $2,643. Your percentage gain on the investment (rounded to the n
nasty-shy [4]
Your percentage gain on the investment was d)15%

To find percentage increase we subtract original number from new number.
2,643 - 2,300 = 343
Then we divide 343 by 2,300 = .1491
Then you multiply by 100. 
.1491 * 100 = 14.91
It is a 14.91% (rounded) increase.
So the nearest percent out of these options would be 15%.

Hope this helps you! (:
-Hamilton1757
4 0
4 years ago
Read 2 more answers
A power supply unit for a computer converts:
mixer [17]
A power supply unit for a computer converts <span>220 Voltage to 110 Voltage.</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • Joe sends a scathing e-mail to his boss regarding increased work hours. Joe tries to deny sending the e-mail, but is unable to d
    9·1 answer
  • _______ are special incentives or excitement-building programs that encourage consumers to purchase a particular product, often
    7·1 answer
  • Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with e
    11·1 answer
  • What is a word processor in ms word​
    9·2 answers
  • Implement a function with signature barGraph(w, h, data) which creates and returns a cs1graphics.Canvas instance that has width
    9·1 answer
  • I'll give brainlyist
    9·2 answers
  • Which are options in the Form Tools Format tab?
    10·1 answer
  • Which cable between Twisted-Pair-Cable (TPC) and Coaxial-Cable (CC) work for transmitting data to more distances?
    9·1 answer
  • Flight controllers make sure the facilitates that house mission control can operate properly, even in the event of a severe weat
    6·1 answer
  • _________ in online education refer(s) to how fairly the particular needs of particular groups of students are met.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!