C.1 [15/15/15/15/25/10/15] Use the following code fragment: Loop: 1d addi sd x1,0(x2) x1,x1,1 x1,0,(x2) x2, x2,4...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
C.1 [15/15/15/15/25/10/15]<A.2>Use the following code fragment: Loop: 1d addi sd x1,0(x2) x1,x1,1 x1,0,(x2) x2, x2,4 x4, x3,x2 x4, Loop ;load x1 from address 0+x2 ;x1=x1+1 ;store x1 at address 0+x2 ;x2=x2+4 ;x4=x3-x2 addi sub bnez ;branch to Loop if x4!= 0 Assume that the initial value of x3 is x2+396. d. [15]<C.2> Show the timing of this instruction sequence for the 5-stage RISC pipeline with full forwarding and bypassing hardware, as shown in Figure C.6. Use a pipeline timing chart like that shown in Figure C.8. Assume that the branch is handled by predicting it as taken. If all memory references take 1 cycle, how many cycles does this loop take to execute? e. [25]<C.2>High-performance processors have very deep pipelines-more than 15 stages. Imagine that you have a 10-stage pipeline in which every stage of the 5-stage pipeline has been split in two. The only catch is that, for data for- warding, data are forwarded from the end of a pair of stages to the beginning of the two stages where they are needed. For example, data are forwarded from the output of the second execute stage to the input of the first execute stage, still causing a 1-cycle delay. Show the timing of this instruction sequence for the 10-stage RISC pipeline with full forwarding and bypassing hardware. Use a pipeline timing chart like that shown in Figure C.8 (but with stages labeled IF1, IF2, ID1, etc.). Assume that the branch is handled by predicting it as taken. If all memory references take 1 cycle, how many cycles does this loop take to execute? f. [10]<C.2> Assume that in the 5-stage pipeline, the longest stage requires 0.8 ns, and the pipeline register delay is 0.1 ns. What is the clock cycle time of the 5-stage pipeline? If the 10-stage pipeline splits all stages in half, what is the cycle time of the 10-stage machine? Time (in clock cycles) СС 1 CC 2 СС 3 СС 4 СС 5 СС 6 DADD R1, R2, R3 IM Reg DM Reg LD R4, 0(R1) IM Reg DM Reg SD R4,12 (R1) IM Reg DM Figure C.6 Forwarding of operand required by stores during MEM. The result of the load is forwarded from the memory output to the memory input to be stored. In addition, the ALU output is forwarded to the ALU input for the address calculation of both the load and the store (this is no different than forwarding to another ALU operation). If the store depended on an immediately preceding ALU operation (not shown herein), the result would need to be forwarded to prevent a stall. Program execution order (in instructions) ALU 1d x1,0(x2) IF ID EX МЕМ WB sub x4,x1,x5 IF ID EX МЕМ WB and x6,x1,x7 IF ID EX МЕМ WB or x8,x1,x9 1d x1,0(x2) IF ID EX MEM WB IF ID EX MEM WB sub x4,x1,x5 IF ID Stall EX МЕМ WB and x6,x1,x7 IF Stall ID EX MEM WB or x8,x1,x9 Stall IF ID EX MEM WB Figure C.8 In the top half, we can see why a stall is needed: the MEM cycle of the load produces a value that is needed in the EX cycle of the sub, which occurs at the same time. This problem is solved by inserting a stall, as shown in the bottom half. C.1 [15/15/15/15/25/10/15]<A.2>Use the following code fragment: Loop: 1d addi sd x1,0(x2) x1,x1,1 x1,0,(x2) x2, x2,4 x4, x3,x2 x4, Loop ;load x1 from address 0+x2 ;x1=x1+1 ;store x1 at address 0+x2 ;x2=x2+4 ;x4=x3-x2 addi sub bnez ;branch to Loop if x4!= 0 Assume that the initial value of x3 is x2+396. d. [15]<C.2> Show the timing of this instruction sequence for the 5-stage RISC pipeline with full forwarding and bypassing hardware, as shown in Figure C.6. Use a pipeline timing chart like that shown in Figure C.8. Assume that the branch is handled by predicting it as taken. If all memory references take 1 cycle, how many cycles does this loop take to execute? e. [25]<C.2>High-performance processors have very deep pipelines-more than 15 stages. Imagine that you have a 10-stage pipeline in which every stage of the 5-stage pipeline has been split in two. The only catch is that, for data for- warding, data are forwarded from the end of a pair of stages to the beginning of the two stages where they are needed. For example, data are forwarded from the output of the second execute stage to the input of the first execute stage, still causing a 1-cycle delay. Show the timing of this instruction sequence for the 10-stage RISC pipeline with full forwarding and bypassing hardware. Use a pipeline timing chart like that shown in Figure C.8 (but with stages labeled IF1, IF2, ID1, etc.). Assume that the branch is handled by predicting it as taken. If all memory references take 1 cycle, how many cycles does this loop take to execute? f. [10]<C.2> Assume that in the 5-stage pipeline, the longest stage requires 0.8 ns, and the pipeline register delay is 0.1 ns. What is the clock cycle time of the 5-stage pipeline? If the 10-stage pipeline splits all stages in half, what is the cycle time of the 10-stage machine? Time (in clock cycles) СС 1 CC 2 СС 3 СС 4 СС 5 СС 6 DADD R1, R2, R3 IM Reg DM Reg LD R4, 0(R1) IM Reg DM Reg SD R4,12 (R1) IM Reg DM Figure C.6 Forwarding of operand required by stores during MEM. The result of the load is forwarded from the memory output to the memory input to be stored. In addition, the ALU output is forwarded to the ALU input for the address calculation of both the load and the store (this is no different than forwarding to another ALU operation). If the store depended on an immediately preceding ALU operation (not shown herein), the result would need to be forwarded to prevent a stall. Program execution order (in instructions) ALU 1d x1,0(x2) IF ID EX МЕМ WB sub x4,x1,x5 IF ID EX МЕМ WB and x6,x1,x7 IF ID EX МЕМ WB or x8,x1,x9 1d x1,0(x2) IF ID EX MEM WB IF ID EX MEM WB sub x4,x1,x5 IF ID Stall EX МЕМ WB and x6,x1,x7 IF Stall ID EX MEM WB or x8,x1,x9 Stall IF ID EX MEM WB Figure C.8 In the top half, we can see why a stall is needed: the MEM cycle of the load produces a value that is needed in the EX cycle of the sub, which occurs at the same time. This problem is solved by inserting a stall, as shown in the bottom half.
Expert Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these algorithms questions
-
As shown in Figure P18.42, water is pumped into a tall vertical cylinder at a volume flow rate R. The radius of the cylinder is r, and at the open top of the cylinder a tuning fork is vibrating with...
-
As shown in Figure P29.72, a particle of mass m having positive charge q is initially traveling with velocity vj . At the origin of coordinates it enters a region between y = 0 and y = h containing a...
-
A solenoid is wound as shown in FIGURE EX30.10. a. Is there an induced current as magnet 1 is moved away from the solenoid? If so, what is the current direction through resistor R?b. Is there an...
-
In Exercises, find the limit. x-4 lim x-00x + 1
-
For the conditions of Exercise 4, what is the probability that neither student A nor student B will fail the examination? In Exercise 4 If the probability that student A will fail a certain...
-
A highway patrolman sends a 28.250-GHz radar beam toward a speeding car. The reflected wave is lower in frequency by 2.97 kHz. (a) Is the car moving toward or away from the radar gun? Explain. (b)...
-
An American Airlines agent tells you that you must pay a surcharge because your checked bag weighs 23.018 kg, which exceeds the limit of 23 kg, and that theres no doubt that the scale is correct...
-
Use the Kyler Media Corporation data in Short Exercise 14-7 and the results you calculated from the requirements. Requirement 1. Prepare Kyler Medias statement of cash flowsindirect methodfor the...
-
How do omics technologies, including genomics, transcriptomics, proteomics, and metabolomics, facilitate comprehensive analyses of biological systems for biotechnological purposes ?
-
Joy camera plans to expand to the European market. The company considers buying Enola Plc, a privately owned company headquartered in the UK. The EBIT (earnings before interest and taxes) for Enola...
-
On January 1st, 2008, Batman Company acquired all of the voting stock of Catwomen Company at book value. Batman accounts for its investment in Catwomen using the initial value method (cost method)...
-
Contract Damages Subject Matter (Use to answer scenarios below): 1) Direct or Compensatory Damages: These are damages for a monetary amount that is intended to compensate the non-breaching party for...
-
1. a. Is there a tort of invasion of privacy in Canada? Explain. b. If you answered "no" to question (a), how might a Canadian plaintiff obtain legal redress for an alleged invasion of privacy? 2. a....
-
In terms of corporate finance, what's does a profitability index of 2.46 mean?
-
Stay Fit is an online personal trainer based in Liverpool which offers tailor - made exercise for its clients. Stay Fit intends to expand the services beyond Liverpool area. They have identified...
-
You were in an auto accident and are due $50,000 from the insurance company for the other person that hit you. They are going to pay you this amount in 5 years. What is the value of that money today...
-
What is corporate governance? Group of answer choices The revolving door of government workers and company executives Laws that establish the duties of CEOs Tax policy implemented by government to...
-
Consider the sections of two circuits illustrated above. Select True or False for all statements.After connecting a and b to a battery, the voltage across R1 always equals the voltage across R2.Rcd...
-
Let A k denote the kth leading submatrix of a symmetric positive-definite matrix A. Prove that det (Ak)/ det(A k - 1 ) is the kth pivot during LU decomposition, where, by convention, det(A) = 1.
-
Give an example of a directed graph G = (V, E), a source vertex s V, and a set of tree edges E E such that for each vertex V, the unique simple path in the graph (V, E ) from s to is a...
-
Give an adjacency-list representation for a complete binary tree on 7 vertices. Give an equivalent adjacency-matrix representation. Assume that vertices are numbered from 1 to 7 as in a binary heap.
-
The trial balance columns of the worksheet for Barbosa Apparel at June 30, 2025, are as follows. Other data: Operating expenses incurred on account, but not yet recorded, total R$1,640. Instructions...
-
Presented below is information for Bach Chocolatiers for the month of March 2025. Instructions a. Prepare an income statement. b. Prepare a comprehensive income statement. c. Compute the gross profit...
-
In 2025, Endeaver Cameras had net sales of 860,000 and cost of goods sold of 533,200. Operating expenses were 221,000, and interest expense was 7,000. Instructions a. Compute Endeavers gross profit....
Study smarter with the SolutionInn App