Answer is as follows :
As we see that there are following hazards :
The hazard is remove when it comes to instruction 4, because upto that value is finally written onto register R1.
No other hazard is there on any type of register.
So the pipeline diagram is as follows :
As we see that it requires 9 clock cycle to execute.
Bold lines are data hazards show in diagram.
if there is any query please ask in comments....
Draw the pipeline diagram with data dependency considered Appendix A Pipelining: Basic and Intermediate Concepts Data...
Using a diagram similar to Figure 7.53, show the forwarding and stalls needed to execute the following instructions on the pipelined ARM processor. Exercise 7.30 Using a diagram similar to Figure 7.53, show the forwarding and stalls needed to execute the following instructions on the pipelined ARM processor. ADD RO, R4, R9 SUB RO, RO, R2 LDR R1, [RO, #60] AND R2, R1. RO 4 8 Time (cycles) R4 LDR RE 40 R1 DM LDR R1, [R4, #40] |IM RF...
5.3 Rewrite the following program fragment that is written using the GPR instruction set for execution on a CISC processor that provides the same instruction set as the GPR processor but allows the register addressing mode to be used on the input operands or destination of any instruction. (Yes, the code fragment will execute correctly as written on such a processor. Your goal should be to reduce the number of instructions as much as possible. ) Assume that the program...
Consider a standard 5-stage MIPS pipeline of the type discussed during the class sessions: IF- ID-EX-M-WB. Assume that forwarding is not implemented and only the hazard detection and stall logic is implemented so that all data dependencies are handled by having the pipeline stall until the register fetch will result in the correct data being fetched. Furthermore, assume that the memory is written/updated in the first half of the clock cycle (i.e. on the rising edge of the clock) and...
Consider a VEX-executing VLIW machine with the following characteristics: The machine supports 4 slots (4-wide machine) with the following resources: 2 memory units each with a load latency of 3 cycles 2 integer-add/sub functional units with a latency of 2 cycle 1 integer-multiply functional unit with a latency of 4 cycles Each functional unit in the machine is pipelined and can be issued a new operation at each cycle. However, the results of an operation are only available after the...
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...
Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...
Questions1. The function L is defined as L(1) = 2,L(2) = 1,L(3) = 3,L(4) = 4 and for n ≥ 4,L(n + 1) = L(n) + L(n − 1) + L(n − 2)L(n − 3)i.e., the (n + 1)-th value is given by the sum of the n-th, n − 1-th and n − 2-th values divided by the n − 3-th value.(a) Write an assembly program for computing the k-th value L(k), where k is an integer bigger than...
Assembly language 64 bit please ! An example file for set up ==========+ ;| Data Segment BEGINS Here | ;+======================================================================+ segment .data ;Code this expression: sum = num1+num2 num1 dq 0 ;left operand of the addition operation num2 dq 0 ;right operand of the addition operation sum dq 0 ;will hold the computed Sum value RetVal dq 0 ;Integer value RETURNED by function calls ;can be ignored or used as determined by the programmer ;Message string prompting for the keyboard...
5. Consider the SPIM code below. globl main .text main: ori $t1, $0, 10 ori $t2, $0, 11 add $t3, $t1,$t2 move $t4, $t3 The following image shows a screen shot of QtSPIM page when this program is loaded, and executed in step-by step fashion. Current instruction is highlighted. Data Text x Text Regs Int Regs [16] Int Regs [16] PC = 400028 EPC 0 Cause = 0 BadAddr = 0 Status = 3000ff10 HI LO = 0 = 0...