Question: For all 2 parts, assume that before the code block is executed, x 1 1 is initialized to 5 and x 1 2 is initialized

For all 2 parts, assume that before the code block is executed, x11 is initialized to 5 and x12 is initialized to 2. Other registers, if un-initialized can be assumed to be 0.
(5pts) Suppose you executed the code below on a pipelined system that
does not handle data hazards.
Also, the register file is NOT a fast register file, i.e. it does not have the feature of reading and writing in the same clock cycle. For example, if the old value of x1 is 10. Now, lets assume that in Clock Cycle 5(CC5), we are both writing a new value of 20 to x1 and also reading x1 in the same clock cycle. Then, the output value from the read would be 10, NOT 20. This new value of 20 will be available in x1 only from the next clock cycle CC6.
In this context, what will be the final values of registers x13, x14, and x15 at the end of this code block?
I1: addi x13, x11,1
I2: add x14, x0, x12
I3: sll x15, x11, x12
I4: sub x13, x15, x14
I5: add x14, x15, x13

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!