 In the previous video, we saw that every time we have a branch instruction, we end up with some extra wasted clock cycles waiting around to determine which instruction we should run next. In this video, we're going to start looking at speculation and then branch prediction. So instead of just sitting around waiting for the branch instruction to complete, I could decide to just go run another instruction. This may or may not be a useful instruction depending on what the results of that branch instruction are, but if I guess right, then I've saved myself a clock cycle. If I guess wrong, oh well, it's no different than having a no-op in my pipeline. So speculation is just picking one of the two possible instructions that could run and trying to run it. We'll determine later whether or not we actually want to run that instruction. If we do want to run that instruction, then we keep the results. If not, we just throw them away. Branch prediction will be how we decide to choose which of those two paths we should take. We will either predict that we're going to take the branch or that we're not going to take the branch. And we can come up with all sorts of schemes for how we want to do that. We will look a little bit at static branch prediction because those are nice, simple schemes. They don't change based on the code. Dynamic branch prediction, on the other hand, looks at how the code has run, what it's done, what this branch has done recently, and makes decisions about whether this branch is likely to be taken again or not.