Question: Given this piece of code fragment: for ( int x = 0 ; x < 1 0 ; x + + ) { if (

Given this piece of code fragment:
for (int x =0; x <10; x++)
{
if (x >=5)
cout <<"OK"<< endl;
else
cout <<"No"<< endl;
}
Assuming the branch prediction by default is "TAKEN", what is the prediction of the cout OK statement inside the if branch when we use a 2-bit branch history? (T for taken, N for not taken)
Question 7 options:
NNNNN TTTTT
TNNNN NTTTT
TTNNN NNTTT

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!