Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

8. I would needle members for greater effort.

Answered: 1 week ago