Question: For Questions 2 and 3 you will be working with the following MIPS assembly program. beq $ 2 , $ 0 , endloop add $

For Questions 2 and 3 you will be working with the following MIPS assembly program.
beq $2,$0, endloop
add $3,$0,$1
add $4,$2,$0
loop: addi $4,$4,-1
Iw $13,0($3)
slt $14, $13, $0
bne $14,$0, endif
sub $15,$13,$4
sw $15,0($3)
endif: addi $3,$3,4
bne $4,$0, loop
endloop: jr $31
Line numbers have been added to the beginning of each instruction so you can use them as references in subsequent questions.
(a) Write the machine code version of the program. The machine code instructions should be written as hexadecimal values. The file should contain each 8-digit hexadecimal number preceded by 0x (for a total of 10 characters) on a separate line. The alphadigits in the hexadecimal values should all be uppercase. See the solution for Question 3 of Tutorial 08 for the expected format.
(b) Assume you have a processor running at 8GHz with the cycles per instruction set architecture defined as follows:
Memory accesses: 8 cycles
Branch/Jump instructions: 2 cycles
Everything else: 4 cycles
Assume that the program is run using the array front end and the user enters 5 for the array size, and the numbers: -5,0,2,-8,3 for the array contents. What is the CPI of the processor for the program given the input described?
How much time would the processor take to complete the program instructions?
Your answer should ignore the user time it takes to enter the data. You may assume there are no extra cycles due to pipelining or hazards for this question.
Show your work.
 For Questions 2 and 3 you will be working with the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!