Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MIPS can somebody explain to me the output of this code and the answer to the 2 questions ? The answer to (b) is

MIPS

can somebody explain to me the output of this code and the answer to the 2 questions ?

The answer to (b) is " 30 cycles. Beginning with instruction #1 on line #1, the sequence of execution is 1, 2, 3, 4, 5, 6, S, 4, 5, 6, S, 7, 8, S, 3, 4, 5, 6, S, 4, 5, 6, S, 7, 8, S. Notice the stall cycles "s" which are inserted after the branches. "

I need a full explanation of how this code is working step by step and why it's working that way.

(please don't answer if you're just gonna write the answer with no explanation)image text in transcribed

3. Consider the following code: li $to,2 li t1,2 add $t0, $t0,-! add $tl, $tl, -1 add $t3, $t3, 1 bne t1, zero, Loop2 li t1,2 bne $t0, zero, Loop1 Loop 1 : Loop2: Assume a single cycle processor is running the above code at 1 GHz. How long will this code take to execute? If there is no branch prediction, how many cycles will the above code take to execute on a multicycle machine? a. b. 3. Consider the following code: li $to,2 li t1,2 add $t0, $t0,-! add $tl, $tl, -1 add $t3, $t3, 1 bne t1, zero, Loop2 li t1,2 bne $t0, zero, Loop1 Loop 1 : Loop2: Assume a single cycle processor is running the above code at 1 GHz. How long will this code take to execute? If there is no branch prediction, how many cycles will the above code take to execute on a multicycle machine? a. b

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions