Question

In: Electrical Engineering

What problems occur in a pipelined CPU architecture when conditional branches are encountered? Name and describe...

What problems occur in a pipelined CPU architecture when conditional branches are encountered? Name and describe ways in which the effects of conditional branches can be reduced or eliminated.

Solutions

Expert Solution

Hello,
Please find the answer attached below. If the answer has helped you please give a thumbs up rating. Thank you and have a nice day!

A branching in a pipelined CPU architecture often involves a hazard. Unless the processor can give effect to the branch in a single time cycle, the pipeline will continue fetching instructions sequentially. Such instructions cannot be allowed to take effect because the programmer has diverted control to another part of the program.

The problem with a conditional branch is even more serious. The processor may or may not branch, depending on a calculation that has not yet occurred. Various processors may stall, may attempt branch prediction, and may be able to begin to execute two different program sequences (eager execution), both assuming the branch is and is not taken, discarding all work that pertains to the incorrect guess.[a]

A processor with an implementation of branch prediction that usually makes correct predictions can minimize the performance penalty from branching. However, if branches are predicted poorly, it may create more work for the processor, such as flushing from the pipeline the incorrect code path that has begun execution before resuming execution at the correct location.

Programs written for a pipelined processor deliberately avoid branching to minimize possible loss of speed. For example, the programmer can handle the usual case with sequential execution and branch only on detecting unusual cases. The programmer can also measure how often particular branches are actually executed and gain insight with which to optimize the code. In some cases, a programmer can handle both the usual case and unusual case with branch-free code.


*************************************************************
PS: Please do not forget the thumbs up!!


Related Solutions

Explain what problems are encountered in trying to achieve cost effective results occur if "command and...
Explain what problems are encountered in trying to achieve cost effective results occur if "command and control" environmental standards regulations (all polluter must keep emissions below a fixed ceiling) are employed by regulatory agencies.
Explain what has changed in CPU architecture to deal with clock rate
Explain what has changed in CPU architecture to deal with clock rate
name and describe structure what occur after hardening
name and describe structure what occur after hardening
Staffing a Project Team. What problems or obstacles may be encountered by the project manager when...
Staffing a Project Team. What problems or obstacles may be encountered by the project manager when attempting to staff his or her project team? Offer 2-3 problems or issues that may be experienced when staffing a project and provide a recommendation for managing and resolving the issue. What issues have you encountered and how were they responded to?
Name the two branches of the autonomic nervous system, describe the function of each branch, and...
Name the two branches of the autonomic nervous system, describe the function of each branch, and state the changes that occur in various target organs during the "fight-or-flight" response.
1. What are some of the problems that could occur in communication when a peer-review process...
1. What are some of the problems that could occur in communication when a peer-review process "breaks down." 2. What are some of the ways a writer can be clear to his reader when developing a research paper ?
Identify problems that occur when estimating the cost of capital for a privately held firm. What...
Identify problems that occur when estimating the cost of capital for a privately held firm. What are some solutions to these problems – specifically how would you estimate the cost of debt and cost of equity of such a firm?
Describe the components of the MEAN architecture and what role each component plays in the architecture...
Describe the components of the MEAN architecture and what role each component plays in the architecture of a web application. Describe the supporting cast components.
Discuss the problems encountered by intelligence units when gathering and disseminating information about organized crime.
Discuss the problems encountered by intelligence units when gathering and disseminating information about organized crime.
Explain some of the practical problems encountered by companies when valuing inventories. Set out two circumstances...
Explain some of the practical problems encountered by companies when valuing inventories. Set out two circumstances in which it may be necessary to complete financial statements from incomplete records and discuss the risks involved in preparing these financial statements. Explain what is meant by the "elimination method" of accounting for depreciation when a revaluation occurs? Explain why the profit on a disposal of property, plant and equipment is removed from the Operating Cash Flows under the indirect method and explain...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT