The EX stage of a pipelined processor performs the memory read operations for
LOAD instructions, and the operations for the arithmetic and logic instructions. Let
π‘πΈπ denote the time taken by the EX stage to perform the operation for an instruction.
For each instruction type, the values of π‘πΈπ and M (the number of instructions of that
type in a sequence of 100 instructions for a program P), are given in the table below.
The duration of the pipeline clock cycle is 1 nanosecond. Assume that the latch time
for the interstage buffers in the pipeline is negligible.
When program P is executed, the number of clock cycles for which the pipeline is
stalled due to structural hazards in the EX stage is ______. (answer in integer)
Instruction
π‘πΈπ in
nanoseconds
π
LOAD
1.8
15
IMUL
1.5
10
IDIV
2.5
5
FADD
1.7
10
FSUB
1.7
5
FMUL
2.8
15
FDIV
3.2
5
All other
instructions
Less than
1.0
35
In a pipelined processor, if the EX stage takes longer than one clock cycle for a given instruction, then the next instruction that needs the EX stage must wait, causing a structural hazard. The clock cycle is 1 ns, so any instruction whose \(t_{EX}\) exceeds 1 ns will occupy the EX stage for multiple clock cycles, forcing stall cycles equal to \(\lceil t_{EX} \rceil - 1\).
Step 1: Find the number of EX stage cycles required per instruction type.
Number of cycles needed = \(\lceil t_{EX} / 1\,ns \rceil\)
Step 2: Multiply the stall cycles per instruction by the count M of that instruction type.
\[ \text{LOAD} = 1 \times 15 = 15 \] \[ \text{IMUL} = 1 \times 10 = 10 \] \[ \text{IDIV} = 2 \times 5 = 10 \] \[ \text{FADD} = 1 \times 10 = 10 \] \[ \text{FSUB} = 1 \times 5 = 5 \] \[ \text{FMUL} = 2 \times 15 = 30 \] \[ \text{FDIV} = 3 \times 5 = 15 \] \[ \text{Others} = 0 \times 35 = 0 \]
Step 3: Add all stall cycle contributions.
\[ 15 + 10 + 10 + 10 + 5 + 30 + 15 + 0 = 95 \]
Note that whether these stalls happen back-to-back does not matter here since we assume the pipeline has no other hazards and each instruction of a given type independently occupies the EX stage for its required number of cycles, contributing that many stall cycles when a following instruction needs the same stage.
The total number of clock cycles for which the pipeline is stalled due to structural hazards in the EX stage is:
\[ \boxed{95} \]
A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?

A partial data path of a processor is given in the figure, where RA, RB, and RZ are 32-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the data path as shown?

The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node. Suppose a Min-Heap \( T \) stores 32 keys. The height of \( T \) is ___________ (Answer in integer).
Which one of the following dependencies among the register operands of different
instructions can cause a data hazard in a pipelined processor?