Write A Program In Any High-Level Programming Language To Pe

Write a Program In Any High Level Programming Language To Perform the

Write a program in any high level programming language to perform the following: 1. Read a text file containing a sequence of branches, for each branch, predict the branch to be taken based on the three branch prediction techniques: a. Static – Predict Taken b. Static – Predict Not Taken c. Dynamic Branch Prediction -state scheme where change prediction only if get misprediction three times. For each branch prediction, increment a branch prediction stall counter according to the following: Prediction Correct Prediction Incorrect Predict Taken Predict Not Taken. Calculate the misprediction and successful prediction rates for each technique and print out the results. Also print a report on total cycles added to each program’s execution due to control hazards. A sample output for dynamic branch prediction technique is shown below: Dynamic Branch Prediction Read 80 points 40 successes in 80 branches => 50% success rate Total number of branch hazard cycles: xxx Run the program for the three attached input files and collect the program outputs in a Word file. Also in your file answer the following: 1. What technique gives the best performance for a single test case? Why? 2. What technique gives the worst performance for a single test case? Why? 3. What technique gives the best performance ON THE AVERAGE for a all test cases? Why? 4. Based on answers above, what technique is the most flexible? You must submit: 1. A zip file containing the following: a. Your fully commented source file b. The executable compiled from your source code. The executable should be compatible with a Windows™ based PC. 2. A Word file containing the screenshot of all your program runs, and the answers to the 4 questions above. The due date for this project is 11:59 PM (EST) of 15 November 2015.