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
MakcuM [25]
3 years ago
13

Write a MIPS program to continuously generate the following series of integers: 1, 2, 3, 6, 9, 18, 27, 54, 81, and so on. Use st

andard MIPS programming conventions. Use the jump instruction to generate an infinite loop. Write a subroutine EVEN that returns a 1 if the argument is even, else it returns a 0. You must call this subroutine with jal and return from it with jr. The MIPS program must be converted into machine code and placed in the instruction memory. The sequence can be computed by adding the value to itself if it is odd and by adding the previous value to it if it is even. Before replacing the test program in the instruction memory, make sure that your design works for the provided Test-Program.
Computers and Technology
1 answer:
Pachacha [2.7K]3 years ago
3 0

Answer:

Explanation:

Here is a working solution in MIPS

.data

space: .asciiz ", "

.text

li $t1, 1       #Start at 1

li $t2, 1       #Store last value

li $t4, 1000    #terminate at 1000

li $t7, 2       #For division (divide by 2)

loop:

li $v0, 1

add $a0, $t1, $zero #print $t1

syscall

div $t1, $t7      #divide $t1 by 2

mfhi $t5          #get the remainder

move $t6, $t1     #hang on to what $t1 was originally

beqz $t5, even    #if the remainder is 0, it's even

add $t1,$t1,$t1    #it's odd, so add to itself

move $t2, $t6      #store what $t1 was originally to last value

bgt $t1, $t4, done #if the number is over 1000, we're done

li $v0, 4           #Print a comma and space

la $a0, space

syscall

j loop

even:

add $t1,$t1,$t2    #set $t1 = $t1 + Last value ($t2)

move $t2, $t6      #store what $t1 was originally to last value

bgt $t1, $t4, done #if the number is over 1000, we're done

li $v0, 4           #Print a comma and space

la $a0, space

syscall

j loop

done:

You might be interested in
FOLLOW INSTRUCTIONS BELOW , WRITTEN IN JAVA LANGUAGE PLEASE AND THANK YOU !
boyakko [2]
It’s a lot of reading sorry can’t help you but try your best too
7 0
3 years ago
What is a method whereby new problems are solved based on the solutions from similar cases solved in the past?
mario62 [17]

Answer:

"Case-Based Reasoning" is the answer for the above question.

Explanation:

  • Case-Based Reasoning is a process of decision-making theory in which the new problems were solved based on the previously solved problem.
  • It is used in artificial intelligence and robots. This helps to make any AI and robots to do the work and take decisions on its own.
  • The theory is used to make any computer that behaves like humans. It can take decisions like a human.
  • The above question asked about the method by which the new problem is solved on behalf of the old problem. Hence the answer is "Case-Based Reasoning".
4 0
3 years ago
Plato :
ddd [48]

Answer:

filler content

Explanation:

Isabel must use some sort of filler content while creating a wireframe that she is up with. For the banner, she can make use of the placeholder, and for the text, she can make use of the lorem ipsum. Also, if the wireframe is low fidelity then only she can use above. And if the wireframe is high fidelity then she should use the original banner and text.

3 0
3 years ago
Read 2 more answers
My HTC Desire 510's mobile data stopped working, how to I make it work again?
denis-greek [22]
Ask your mobile operator
2.go to hrs service
3. Turn on and turn off
4 0
3 years ago
Who the heck is bts?!?!!!???​
Lana71 [14]

Answer:

they are a k-pop boy band.

6 0
2 years ago
Read 2 more answers
Other questions:
  • If you want to boot from a hard drive what must it have
    6·1 answer
  • A(n) ____ backup only archives the files that have been modified since the last backup.
    11·1 answer
  • How do you increase the amount of data in a sampled Google Analytics report?
    8·1 answer
  • You get a BRAINLIEST if you help me ASAP!
    11·2 answers
  • Peter has recently bought a media player and a digital camera he wants to buy a memory card and then use devices which memory do
    11·2 answers
  • How does a router differ from such devices as repeaters, bridges, and switches?
    6·1 answer
  • ap csp The local, remote, and upstream _______ can each have multiple ___ _____. When a participant in a collaborative group on
    5·1 answer
  • Which statement assigns the value 140 to the variable streetNumber in Python?
    13·1 answer
  • Now that you have learned the basics of acquiring relevant information through research, it's time to put your skills to work.
    7·1 answer
  • Retype the below code. Fix the indentation as necessary to make the program work.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!