What is the different between branch prediction and branch predication with an "a" after the c? I believe I understand branch prediction and I can make sense out it but I get confused with branch predication?
|
|
What is the different between branch prediction and branch predication with an "a" after the c? I believe I understand branch prediction and I can make sense out it but I get confused with branch predication?
You are quite correct, they are two similar things but are not the same. They are both aimed at solving the same problem.
Suppose that every day you have to call a friend to find out whether you need to pick up a package on the East side of the city or the West side of the city. You can't call him until 8:00. And it takes an hour to drive to either side of the city.
With branch prediction, you would keep track each day of whether you had to go to the East side or the West side. If you discovered that 99% of the time you went to the East side, you'd start heading East before 8:00.
So you try to predict which way you're going to have to go and start going that way ahead of time. If you guess wrong, there may be a penalty, since you'll be on the wrong side of the city. But so long as you guess right often enough, it's a net win.
Branch predication would be if you got two cars and sent one East and one West. Then when you found out which way you had to go, you let that car pick up the package. What about the other car? It doesn't matter.
Note that this doesn't require any prediction. You don't have to guess which way you need to go. You go *both* ways. And when you find out which way you needed to go, you *predicate* (preh'-di-kate) which one you keep based on that.
So with branch prediction, you try to guess which branch you need to take. If you take the right one, you win. If you take the wrong one, you undo it, and you lose some time. But that shouldn't happen too often.
With branch predication (preh'-di-kay'-shun), you take both branches. When you find out which one you needed to take, you keep that one and forget about the other one. You win either way.
Hope that clears it up for you.
Bookmarks