Question: Using any high-level programming language of your choice, develop a programme to test the working of Branch prediction technique, which is used in Computer

Using any high-level programming language of your choice, develop a programme to test the working of  Question 2 (Performance measure) Using your programs developed in question 1 above, perform the following

Using any high-level programming language of your choice, develop a programme to test the working of "Branch prediction" technique, which is used in Computer Engineering to improve performance. In developing this program, it is suggested that you consider the following possibilities: [1] Write a main program that has at least ten different executable branches. The executed branch should be determined by a value of a global variable, say, myBranchNumber. [2] For the ten branches suggested in [1] above, ensure that they have comparable computations. [3] Apart from the ten branches in [1], the main program should have at least thirty (30) sequentially executed instructions. [4] Write a function that generates random numbers within a reasonable range and update the global variable as suggested in [1]. [5] There should be a function which keeps track of the time taken to complete N runs of the program. This function should store in a file the record of predicted and executed branches as well as the time to complete the N runs. Question 2 (Performance measure) Using your programs developed in question 1 above, perform the following tests: [1] Run the program for N runs with the prediction functionality disabled and determine time taken to complete the runs. [2] Re-run the program with the branch prediction enabled and determine time taken to complete the runs. "Adjust" the branch prediction accuracy and determine its effect on the speed of execution. [3] Report on your findings. Using any high-level programming language of your choice, develop a programme to test the working of "Branch prediction" technique, which is used in Computer Engineering to improve performance. In developing this program, it is suggested that you consider the following possibilities: [1] Write a main program that has at least ten different executable branches. The executed branch should be determined by a value of a global variable, say, myBranchNumber. [2] For the ten branches suggested in [1] above, ensure that they have comparable computations. [3] Apart from the ten branches in [1], the main program should have at least thirty (30) sequentially executed instructions. [4] Write a function that generates random numbers within a reasonable range and update the global variable as suggested in [1]. [5] There should be a function which keeps track of the time taken to complete N runs of the program. This function should store in a file the record of predicted and executed branches as well as the time to complete the N runs. Question 2 (Performance measure) Using your programs developed in question 1 above, perform the following tests: [1] Run the program for N runs with the prediction functionality disabled and determine time taken to complete the runs. [2] Re-run the program with the branch prediction enabled and determine time taken to complete the runs. "Adjust" the branch prediction accuracy and determine its effect on the speed of execution. [3] Report on your findings.

Step by Step Solution

3.37 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

int randomint branch... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!