Instruction Pipelining MCQ Quiz in தமிழ் - Objective Question with Answer for Instruction Pipelining - இலவச PDF ஐப் பதிவிறக்கவும்
Last updated on Mar 9, 2025
Latest Instruction Pipelining MCQ Objective Questions
Top Instruction Pipelining MCQ Objective Questions
Instruction Pipelining Question 1:
Consider an instruction pipeline having 5 stages:
IF = Instruction Fetch stage
ID = Instruction Decode stage
OF = Operand Fetch stage
EX = Execute stage
WB = Write Back stage
Now consider the following instructions:
I1 : ADD | R1, R9, R10 | R1← R9 + R10 |
I2 : DIV | R4, R2, R3 | \(R4\leftarrow \frac{R2}{R3} \) |
I3 : MUL | R5, R4, R1 | R5← R4× R1 |
I4 : ADD | R6, R4, R5 | R6 ← R4 + R5 |
I5 : SUB | R8, R6, R7 | R8← R6 - R7 |
Each stage takes 1 clock cycle for all the instructions. If x is the number of clock cycles required without operand forwarding and y is the number of clock cycles required with operand forwarding, then find the value of x/y (Corrected up to 2 decimal places). Here operand is forwarded from EX stage to OF stage.
Answer (Detailed Solution Below) 1.44
Instruction Pipelining Question 1 Detailed Solution
Here I3 is dependent both on I1 and I2.
I4 is dependent both on I2 and I3.
I5 is dependent on I4 only.
NOTE: - We can fetch both the operands in one cycle only, one with the corrected value and other with some dummy value. The operand with dummy value will be updated after Write-Back stage.
Without operand-forwarding:
Instruction number\Clock cycle number | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
I1 | IF | ID | OF | EX | WB | ||||||||
I2 | IF | ID | OF | - | EX | WB | |||||||
I3 | IF | ID | - | OF | - | EX | WB | ||||||
I4 | IF | ID | - | - | OF | - | EX | WB | |||||
I5 | IF | ID | - | - | - | OF | - | EX | WB |
Without operand forwarding
Total clock cycles = 13
x = 13
With operand-forwarding:
Instruction number \Clock cycle number |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
I1 |
I F |
I D |
O F |
EX |
W B |
||||
I2 | IF | ID |
O F |
EX |
W B |
||||
I3 | IF | ID | OF | EX |
W B |
||||
I4 | IF | ID | OF | EX |
W B |
||||
I5 | IF | ID | OF | EX |
W B |
With operand forwarding
Total clock cycles = 9
y = 9
\(\frac{X}{Y}\)\(=\frac{13}{9}=1.4444\)
= 1.44 (Corrected up to 2 decimal places)
Instruction Pipelining Question 2:
A five-stage pipeline has stage delays of 150, 120, 150, 160 and 140 nanoseconds. The registers that are used between the pipeline stages have a delay of 5 nanoseconds each.
The total time to execute 100 independent instructions on this pipeline, assuming there are no pipeline stalls, is ______ nanoseconds.
Answer (Detailed Solution Below) 17160
Instruction Pipelining Question 2 Detailed Solution
Data:
Number of Instructions = n = 100
Number of stages = 5;
Stage delay = 5 ns
Calculation:
Time taken by five stage pipeline processor of singel instruction = T = Max (150, 120, 150, 160,140) + stages delay
= 160 + 5 = 165 ns
The time required to execute n instructions with pipeline = [k + (n – 1)]T
= (5 + (100 - 1))×165 = 17160 ns
Instruction Pipelining Question 3:
Consider a control unit generating the control signals. These control signals are divided into five mutually exclusive groups as shown below:
Groups | G1 | G1 | G1 | G1 | G1 |
Control Signals |
3 | 7 | 10 | 12 | 2 |
How many bits are saved using the Vertical Micro-programmed instead of Horizontal Micro-programmed control unit?
Answer (Detailed Solution Below)
Instruction Pipelining Question 3 Detailed Solution
Concept:
In Horizontal micro-programmed control unit, the control signals are represented in the decoded binary format. Here ‘n’ control signals require n bit encoding.
In Vertical micro-programmed control unit, the control signals are represented in the encoded binary format. Here ‘n’ control signals require ⌈log2n⌉ bit encoding.
Calculation
Number of bits in control word of Horizontal micro-programmed control unit
= 3 + 7 + 10 + 12 + 2 = 34 bits
Number of bits in control word of Vertical micro-programmed control unit
= ⌈log23⌉ + ⌈log27⌉ + ⌈log210⌉ + ⌈log212⌉ + ⌈log22⌉
= 2 + 3 + 4 + 4 + 1 = 14 bits
Difference = 34 - 14 = 20 bits.
Instruction Pipelining Question 4:
Which one of the following is false about Pipelining?
Answer (Detailed Solution Below)
Instruction Pipelining Question 4 Detailed Solution
Concept:
Pipelining is an implementation technique whereby multiple instructions are overlapped in execution. It is like an assembly line.
Explanation:
In pipelining, each step operates parallel with other steps. It stores and executes instructions in an orderly manner.
The main advantages of using pipeline are :
- It increases the overall instruction throughput.
- Pipeline is divided into stages and stages are connected to form a pipe-like structure.
- We can execute multiple instructions simultaneously.
- It makes the system reliable.
- It increases the program speed.
- It reduces the overall execution time but does not reduce the individual instruction time.
Therefore option 2 is the false statement about Pipelining
Instruction Pipelining Question 5:
In a 4- stage pipeline processor. The number of cycles needed by the five instructions N1, N2, N3, N4 and N5
|
IF |
ID |
EX |
WB |
N1 |
1 |
1 |
2 |
1 |
N2 |
2 |
1 |
3 |
1 |
N3 |
1 |
2 |
1 |
1 |
N4 |
3 |
2 |
1 |
2 |
N5 |
1 |
2 |
2 |
1 |
What is the number of cycles needed to execute the following loop?
for(int j = 0; j < 1; j++)
{
N1;
N2;
N3;
N4;
N5;
}
Answer (Detailed Solution Below)
Instruction Pipelining Question 5 Detailed Solution
j = 0
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
|
N1 |
IF |
ID |
EX |
EX |
WB |
|
|
|||||||
N2 |
IF |
IF |
ID |
EX |
EX |
EX |
WB |
|
|
|||||
N3 |
IF |
ID |
ID |
EX |
WB |
|
|
|||||||
N4 |
IF |
IF |
IF |
ID |
ID |
EX |
WB |
WB |
|
|
||||
N5 |
|
|
|
|
|
|
|
IF |
|
ID |
ID |
EX |
EX |
WB |
Therefore the number of cycles required to execute 5 instruction is 14.
Instruction Pipelining Question 6:
A fetch cycle is the
Answer (Detailed Solution Below)
Instruction Pipelining Question 6 Detailed Solution
Steps in the instruction cycle:
- First of all, the opcode is fetched by the microprocessor from a stored memory location.
- Then it is decoded by the microprocessor to find out which operation it needs to perform.
- If an instruction contains data or operand address which is still in the memory, the CPU has to perform read operation to get the desired data.
- After receiving the data, it performs to execute the operation.
Correct sequence: fetch → decode → read effective address → execute
Instruction Pipelining Question 7:
Suppose a program takes 1 million instruction on a processor having frequency 2 MHz . 50 % of instruction execute in 2 clock cycles, 30% execute in in 4 clock cycles and 20% execute in 5 clock cycles. What will be the execution time ( in seconds)?
Answer (Detailed Solution Below) 1.6
Instruction Pipelining Question 7 Detailed Solution
Answer: 1.6
Explanation:
Number of instructions = 1 Million = 1 * 10 6
Clock Frequency = 2 MHz = 0.5 micro second
So Effective CPI will be = 0.5 * 2 + 0.3*4 + 0.2*5 = 3.2
Execution time = Instruction count * CPI * Cycle time
Execution Time = (1 * 106)*(3.2)*(0.5 * 10-6) = 1.6 seconds
Instruction Pipelining Question 8:
Consider the following sequence of micro-operations.
MBR ← PC
MAR ← X
PC ← Y
Memory ← MBR
Which one of the following is a possible operation performed by this sequence?Answer (Detailed Solution Below)
Instruction Pipelining Question 8 Detailed Solution
The correct answer is "option 4".
CONCEPT:
Micro-operations are also known as micro-ops.
They are the atomic or functional operations of a processor.
It is an elementary Central Processing Unit (CPU) operations performed during one clock pulse.
Micro-operations are low-level instructions, used in some designs, to implement complex instructions.
Micro-operations generally perform data stored in one or more registers.
EXPLANATION:
1. Program counter holds the next instruction value to be executed.
Here, MBR <- PC means the value of the program counter will get stored in MBR.
2. MAR <- X means some address value X is storing in MAR so to access memory location X.
3. PC <- Y means storing new instruction value Y to the program counter to access new instruction.
4. Memory <- MBR means MBR register will store its value to Memory. This saves the previous value of PC to memory.
This sequence of instructions matches with Interrupt Service Routine (ISR) since the sequence of instructions saved the address of current instructions into memory.
Then started executing new address by loading new instruction value to Program counter.
Hence, the correct answer is “option 4”.
Additional Information
1. Instruction fetch means fetching the instruction.
2. Operand fetch means fetching the operands.
3. Conditional branch means the program will branch to another instruction after satisfying a condition.
Instruction Pipelining Question 9:
A non-pipeline system takes 50 ns to process a task. The same task can be processed in a six-segment pipeline with a clock cycle of 10 ns. The maximum speedup that can be achieved using a pipeline system is
Answer (Detailed Solution Below)
Instruction Pipelining Question 9 Detailed Solution
Concept:
Speed up factor is defined as the ratio of time required for non-pipelined execution to that of time received for pipelined execution.
\(S = \frac{{{t_n}}}{{{t_p}}}\)
Where, tn = time for non-pipelined execution
tp = time for pipelined execution
S = speed up factor
Calculation:
Given, tn = 50 ns
tp = 10 ns
\(S = \frac{{50}}{{10}} = 5\)
Extra Information:
Speed up factor is also defined as:
\(S = \frac{{nk}}{{n + \left( {k - 1} \right)}}\)
n = number of instructions
k = number of stages in the pipeline.
Instruction Pipelining Question 10:
Consider a 5- stage instruction pipeline where the delay of S4 is half to that of S1. S2 has a half delay to S3. S1 is having a delay of 10 ns. S5 and S3 have the same delay as S1 . What will be the speed up achieved in this?
Answer (Detailed Solution Below)
Instruction Pipelining Question 10 Detailed Solution
Formula:
\(Speed\;up = \frac{{execution\;time\;without\;pipeline}}{{execution\;time\;with\;pipeline}}\)
Explanation:
Given:
Delay of stage S1 = 10 ns
Stage delays are represented as :
S1 |
S2 |
S3 |
S4 |
S5 |
10 |
5 |
10 |
5 |
10 |
Execution time with pipeline (Tp) = max {all stage delays}
= 10 ns
Execution time without pipeline(Tn) = sum of all stage delays
= 10 + 5 + 10 + 5 + 10 = 40 ns
\(Speed\;up = \;\frac{{40}}{{10}} = 4\)