Home » Computer Organization and Architecture » Computer organization and architecture miscellaneous » Question

Computer organization and architecture miscellaneous

Computer Organization and Architecture

  1. A CPU has a five-stage pipeline and runs at 1 GHz frequency. Instruction fetch happens in the first stage of the pipeline. A conditional branch instruction computes the target addresses and evaluates the condition in the third stage of the pipeline. The processor stop fetching new instructions following a conditional branch until the branch outcome is known. A program executes 109 instructions out of which 20% are conditional branches. If each instruction takes one cycle to complete on average, the total execution time of the program is
    1. 1.0 s
    2. 1.2 s
    3. 1.4 s
    4. 1.6 s
Correct Option: C

In the 3rd stage of pipeline, there will be 2 shall cycles.
Total number of instructions = 109, 20% out of 109 are conditional branches. Therefore, cycle penalty = 0.2 * 2 * 109 = 4 * 108.
Clock speed is 1GHz and each instruction on average takes 1 cycle. so

Total execution time =
109
+ 4*
108
109109

= 1 + (0.4) = 1.4 sec



Your comments will be displayed only after manual approval.