Answered step by step
Verified Expert Solution
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started