Assume that a RISC processor uses branch prediction to improve its performance. The table below gives the number of cycles taken for predicted and actual branch outcomes. These figures include both the cycles taken by the branch itself and the branch penalty associated with branch instructions.
If pb is the probability that a particular instruction is a branch, pt is the probability that a branch is taken, and pw is
the probability of a wrong prediction, derive an expression for the average number of cycles per instruction, TAVE.
All non?branch instructions take one cycle to execute.
The total number of possible outcomes of an instruction are:
Non?branch cycles + branches not taken and predicted not taken + branches not taken and predicted taken +
branches taken and predicted taken + branches taken and predicted not taken
In each case, we multiply the probability of the event by the cost of the event; that is:
TAVE = (1 ? pb)?1 + pb ?((1 ? pt)?(1 ? pw)?1 + (1 ? pt)?pw?2 + pt?(1 ? pw)?1 + pt?pw?4 )
Remember that if pt is the probability of a branch being taken, 1 ? pt is the probability of a branch not being taken.
If pw is the probability of a wrong correction, (1 ? pw) is the probability of a correct prediction.
Therefore, the average number of cycles is 1 ? pb(1 ? 1 + pt + pw ? pt?pw ? 2?pw + 2?pt?pw ? pt + pt?pw ? 4?pt?pw)
= 1 ? pb? ( ?pw ? 2?pt?pw ) =1 + pb?pw(1 + 2?pt)
You might also like to view...
Referring to the accompanying figure, which of the following callouts points to the memory card slot?
A. D B. G C. I D. C
Input masks can restrict the number of characters allowed in a field
Indicate whether the statement is true or false
Which type of network is based on network clients sharing resources with one another?
a. Client/server b. Client-peer c. Peer-to-peer d. Peer-to-server
Answer the following statements true (T) or false (F)
1) PreparedStatement class allows execution of SQL statements with parameters. 2) CallableStatement class allows call to PL/SQL blocks. 3) SQL statements are embedded directly into Java program with SQLj. 4) Host variables are used in SQLj program as IN parameters only. 5) Two types of SQLj iterators are named and anonymous iterators.