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]
4 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]4 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
Suppose we have a linearly separable dataset, and we divide the data into training and validation sets. Will a perceptron learne
Sauron [17]

Answer:

Theoretically Yes

Explanation:

The data given is linearly separable. So, the subset of the data will also be linearly separable. And it will pass for all training dataset. However, you should definitely never expect such thing In any real-life problem because the data is noisy, for a bazilion of reasons, so no model is guaranteed to perform perfectly.

3 0
3 years ago
You’ve been given a new cell phone with a 2 gigabyte data plan. You plan to use your phone for text messages, images, video, and
Katarina [22]

Answer:

IUYTR

Explanation:

5 0
3 years ago
The rule of thumb in the wireless industry is that a smartphone uses 4 gigabytes of data per month where ____ percent travels th
lianna [129]
I believe the correct answer is 75%. <span>The rule of thumb in the wireless industry is that a smartphone uses 4 gigabytes of data per month where 75% percent travels through wi-fi or 3 gb travels through wi-fi. Hope this answers the question. Have a nice day.</span>
4 0
3 years ago
Read 2 more answers
The windows desktop contains a start button in its lower-right corner, which can be used to start the computer.
WITCHER [35]
If you are referring to the actual desktop interface inside windows, it goes down to what version you would have. But to my knowledge, there is no start button in the lower right corner. 
6 0
4 years ago
The study of sound and sound wave is called​
pishuonlain [190]

Answer: Acoustics

Explanation:

Acoustics is simply refered to as a branch in physics that studies sound and its wave.

Acoustics studies mechanical waves in liquid, solid state or gaseous state. Topics such as infrasound, vibration and ultrasound are studied. Someone who works in the acoustics field is referred to as an acoustician.

7 0
3 years ago
Other questions:
  • Commercial websites have domain names so that users can easily access the web pages by typing the domain names instead of the IP
    12·1 answer
  • Which of the following is a beneficial reason to extract mineral resources from the earth?
    13·2 answers
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • What are the nicknames for the first generation computers
    8·1 answer
  • What is the output of the following code fragment? int i = 1; int sum = 0; while (i &lt;= 15) { sum = sum + i; i++; } System.out
    5·1 answer
  • Compressing a file is also called
    9·2 answers
  • What is the most likely reason that a digital artist would use a program such as Autodesk Maya or Max to create 3-D images for a
    12·1 answer
  • Which of the following would most likely be the target audience for a product
    7·2 answers
  • You are not sure if a certain word has an"e"at the end<br>​
    11·1 answer
  • Write a code segment that uses a loop to create and place nine labels into a 3-by-3 grid. The text of each label should be its c
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!