9. Given this piece of code fragment: (10%) for (int x = 0; x < 10; x++) { if ( x % 4 >= 2) cout << "OK" << endl; } Assu
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
9. Given this piece of code fragment: (10%) for (int x = 0; x < 10; x++) { if ( x % 4 >= 2) cout << "OK" << endl; } Assu
9. Given this piece of code fragment: (10%) for (int x = 0; x < 10; x++) { if ( x % 4 >= 2) cout << "OK" << endl; } Assuming the branch prediction by default is "TAKEN”, (1) What is the accuracy of branch prediction of the cout statement when we use a 1-bit branch history? (2) What is the accuracy of branch prediction of the cout statement when we use a 2-bit branch history?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!