Question: For Questions 2 and 3 you will be working with the following MIPS assembly program. beq $ 2 , $ 0 , endloop add $
For Questions and you will be working with the following MIPS assembly program.
beq $$ endloop
add $$$
add $$$
loop: addi $$
Iw $$
slt $ $ $
bne $$ endif
sub $$$
sw $$
endif: addi $$
bne $$ loop
endloop: jr $
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 digit hexadecimal number preceded by x for a total of characters on a separate line. The alphadigits in the hexadecimal values should all be uppercase. See the solution for Question of Tutorial for the expected format.
b Assume you have a processor running at with the cycles per instruction set architecture defined as follows:
Memory accesses: cycles
BranchJump instructions: cycles
Everything else: cycles
Assume that the program is run using the array front end and the user enters for the array size, and the numbers: 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
