ADD R3 = R4 + R9; I4: lw $R1,0($R3)                                 //LDW R1 = MEM[R3 + 0]; I5: sub $R3,$R1,$R4                             //SUB R3 = R1 -

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Consider the following assembly language code:

I0: add $R4,$R1,$R0                             //ADD R4 = R1 + R0;

I1: lw $R1,100($R3)                             //LDW R1 = MEM[R3 + 100];

I2: lw $R9,4,($R1)                                // LDW R9 = MEM[R1 + 4];

I3: add $R3,$R4,$R9                             //ADD R3 = R4 + R9;

I4: lw $R1,0($R3)                                 //LDW R1 = MEM[R3 + 0];

I5: sub $R3,$R1,$R4                             //SUB R3 = R1 - R4;

I6: and $R9,$R9,$R7                             //AND R9 = R9 & R7;

I7: sw $R2,100($R4)                             //STW MEM[R4 + 100] = R2;

I8: and $R4,$R2,$R1                             //AND R4 = R2 & R1;

I9: add $R1,$R5,$R4                             //ADD R1 = R5 + R4;

Assume that the code runs in a pipeline with the same five stages, but the forwarding mechanism can only forward from the MEM stage. How many cycles does it take to execute the code? You can use the table below and expand it if necessary,

There is a total of ____ cycles

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education