In the following, we have a code fragment of LEGV8 assembly: STUR X16, [X6, #12] LDUR X16, [X6, #8] SUB X7, X5, X4 CBZ X7, Label ADD X5, X1, Х4 SUB X5, X15, Х4 Assume we run this code on a pipeline CPU that has only one memory for both instructions and data. In this case, there could be a structural hazard every time a program needs to fetch an instruction during the same cycle in which another instruction accesses data. 1- Show where to insert NOPS in the code above to avoid the structural hazard. 2- In your opinion, is there any solution to reduce the number NOPS? Like reordering the instructions. 3- Do you think that we must handle this structural hazard in hardware? You know that data hazards can be avoided by inserting NOPS between assembly instructions. Can we do the same with this structural hazard? If so, explain how. If not, explain why not. 4- If we run the code above on a single-cycle computer, what kind of hazards are there?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
In the following, we have a code fragment of LEGV8 assembly:
STUR X16,
[X6, #12]
LDUR X16,
[X6, #8]
SUB X7, X5, X4
СВZ X7,
Label
ADD X5,
X1,
X4
SUB X5,
X15,
Х4
Assume we run this code on a pipeline CPU that has only one memory for both instructions and data. In this case, there
could be a structural hazard every time a program needs to fetch an instruction during the same cycle in which another
instruction accesses data.
1- Show where to insert NOPS in the code above to avoid the structural hazard.
2- In your opinion, is there any solution to reduce the number NOPS? Like reordering the instructions.
3- Do you think that we must handle this structural hazard in hardware? You know that data hazards can be avoided by
inserting NOPS between assembly instructions. Can we do the same with this structural hazard? If so, explain how. If not,
explain why not.
4- If we run the code above on a single-cycle computer, what kind of hazards are there?
Transcribed Image Text:In the following, we have a code fragment of LEGV8 assembly: STUR X16, [X6, #12] LDUR X16, [X6, #8] SUB X7, X5, X4 СВZ X7, Label ADD X5, X1, X4 SUB X5, X15, Х4 Assume we run this code on a pipeline CPU that has only one memory for both instructions and data. In this case, there could be a structural hazard every time a program needs to fetch an instruction during the same cycle in which another instruction accesses data. 1- Show where to insert NOPS in the code above to avoid the structural hazard. 2- In your opinion, is there any solution to reduce the number NOPS? Like reordering the instructions. 3- Do you think that we must handle this structural hazard in hardware? You know that data hazards can be avoided by inserting NOPS between assembly instructions. Can we do the same with this structural hazard? If so, explain how. If not, explain why not. 4- If we run the code above on a single-cycle computer, what kind of hazards are there?
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY