Final answer:
The CPI of branches in a 5-stage pipeline with necessary forwarding paths and branch resolution in the MEM stage is 3.
Step-by-step explanation:
The correct answer is option (d) 3. The CPI (Cycle Per Instruction) of branches in a 5-stage pipelined processor with all necessary forwarding paths and branch resolution in the MEM stage is 3. This is because when a branch instruction is encountered, the pipeline needs to be flushed or stalled until the branch is resolved.
This results in a 3-cycle penalty: one cycle for the branch instruction fetch, one cycle for the branch instruction decode, and one cycle for the branch resolution in the MEM stage.
The CPI (Cycles Per Instruction) for branches in a 5-stage pipeline with stalls at the MEM stage cannot be determined exactly without specific details on stall cycles. CPI is calculated by dividing the total cycles including stall cycles for branch instructions by the number of branches executed.