CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A pipelined processor uses a 4-stage instruction pipeline with the following stages: Instruction fetch (IF), Instruction decode (ID), Execute (EX) and Writeback (WB). The arithmatic operations as well as the load and store operations are carried out in the EX stage. The sequence of instructions corresponding to the statement X = (S - R *(P + Q))/ T is given below. The values of variables P, Q, R, S and T are available in the registers R0, R1, R2, R3 and R4 respectively, before the execution of the instruction sequence.

ADD R5, R0, R1 ; R5 R0 + R1

MUL R6, R2, R5 ; R6 R2 + R5

SUB R5, R3, R6 ; R5 R3 - R6

DIV R6, R5, R4 ; R6 R5/R4

STORE R6, X ; X R6

The IF, ID and WB stages take 1 clock cycle each. The EX stage takes 1 clock cycle each for the ADD, SUB and STORE operations, and 3 clock cycles each for MUL and DIV operations. Operand forwarding from the EX stage to the ID stage is used. The number of clock cycles required to complete the sequence of instructions is

A
14
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
12
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
16
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
10
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B 12

So total 12 cycles are required.

flag
Suggest Corrections
thumbs-up
5
similar_icon
Similar questions
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Coordination & Importance of Coordination
BUSINESS STUDIES
Watch in App
Join BYJU'S Learning Program
CrossIcon