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
harina [27]
3 years ago
11

MIPS Assembly program: Accept N numbers from the user (or list the input array in the program similar to the demo code) and sort

the N numbers using any sorting algorithm. Print both the sorted array and unsorted array. N should be greater than or equal to 10.
Engineering
1 answer:
Snezhnost [94]3 years ago
3 0

Answer:

main:

   la  $t0, Array      # Copy the base address of your array into $t1

   add $t0, $t0, 40    # 4 bytes per int * 10 ints = 40 bytes                              

outterLoop:             # Used to determine when we are done iterating over the Array

   add $t1, $0, $0     # $t1 holds a flag to determine when the list is sorted

   la  $a0, Array      # Set $a0 to the base address of the Array

innerLoop:                  # The inner loop will iterate over the Array checking if a swap is needed

   lw  $t2, 0($a0)         # sets $t0 to the current element in array

   lw  $t3, 4($a0)         # sets $t1 to the next element in array

   slt $t5, $t2, $t3       # $t5 = 1 if $t0 < $t1

   beq $t5, $0, continue   # if $t5 = 1, then swap them

   add $t1, $0, 1          # if we need to swap, we need to check the list again

   sw  $t2, 4($a0)         # store the greater numbers contents in the higher position in array (swap)

   sw  $t3, 0($a0)         # store the lesser numbers contents in the lower position in array (swap)

continue:

   addi $a0, $a0, 4            # advance the array to start at the next location from last time

   bne  $a0, $t0, innerLoop    # If $a0 != the end of Array, jump back to innerLoop

   bne  $t1, $0, outterLoop    # $t1 = 1, another pass is needed, jump back to outterLoop

Explanation:

You might be interested in
Write down about the water source selection criteria​
ololo11 [35]

Answer:

ssjsssmmmmdndkuctcxhhxhxjxk

5 0
3 years ago
Who wants fight with me
vladimir1956 [14]
Yea, ‘Who wants to fight with me’
3 0
3 years ago
In a wind-turbine, the generator in the nacelle is rated at 690 V and 2.3 MW. It operates at a power factor of 0.85 (lagging) at
Juli2301 [7.4K]

To solve this problem we will apply the concepts related to real power in 3 phases, which is defined as the product between the phase voltage, the phase current and the power factor (Specifically given by the cosine of the phase angle). First we will find the phase voltage from the given voltage and proceed to find the current by clearing it from the previously mentioned formula. Our values are

V = 690V

P_{real} = 2.3MW

Real power in 3 phase

P_{real} = 3V_{ph}I_{ph} Cos\theta

Now the Phase Voltage is,

V_{ph} = \frac{V}{\sqrt{3}}

V_{ph} = \frac{690}{\sqrt{3}}

V_{ph} = 398.37V

The current phase would be,

P_{real} = 3V_{ph}I_{ph} Cos\theta

Rearranging,

I_{ph}=\frac{P_{real}}{3V_{ph}Cos\theta}

Replacing,

I_{ph}=\frac{2.3MW}{3( 398.37V)(0.85)}

I_{ph}= 2.26kA/phase

Therefore the current per phase is 2.26kA

6 0
3 years ago
Roku internet service providet​
podryga [215]

Answer:

What?? I do not understand?

6 0
3 years ago
calculate force and moment reactions at bolted base O of overhead traffic signal assembly. each traffic signal has a mass 36kg,
Igoryamba

Answer:

The free body diagram of the system is, 558 368 368 508 O ?? O, Consider the equilibrium of horizontal forces. F

Explanation:

I hope this helps you but I think and hope this is the right answer sorry if it’s wrong.

7 0
3 years ago
Other questions:
  • Write the definition of a function printLarger, which has two int parameters and returns nothing. The function prints the larger
    14·1 answer
  • The Hubble space telescope is a bus-sized satellite powered by huge ___ panels
    10·2 answers
  • The specific gravity of a substance that has mass of 10 kg and occupies a volume of 0.02 m^3 is a) 0.5 b) 1.5 c) 2.5 d) 3.5 e) n
    11·1 answer
  • What type of degree is needed to be an architect?
    13·2 answers
  • ​What should be a concern as a weldment becomes larger as more parts are added?
    14·1 answer
  • Please help this is due today!!!!!
    13·1 answer
  • Which of the following describes a polar orbit?
    7·1 answer
  • Will mark brainliest if correct
    11·1 answer
  • Scrooge McNugget wants to store information (names, addresses, descriptions of embarrassing moments, etc.) about the many ducks
    6·1 answer
  • Can anyone explain how a Halbek Device works
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!