[Shreeyash] asks an interesting question: how many registers does your CPU have? The answer is probably more than you think. The reason? Modern CPUs — at least many of them — execute instructions out of sequence so they can perform multiple instructions per clock cycle. To do this, they may need to execute instructions that change registers that other instructions are still reading. In addition, you might be writing a result speculatively — a branch might make it where your result won’t wind up in the target register. The answer to both of these problems is register renaming.The ARM CPU he looks at has many physical registers you can’t see. These get mapped to the registers you use on the fly. So when you read a register in software, you are really getting an underlying physical register. Which one? Depends on when you read it.The RAT, or Register Alias Table, keeps track of the mapping between physical registers and the register names you use. Not only does this allow the CPU to run operations out of order, but it also lets results sit in unnamed physical registers until the time is right for it to become the real register. As a byproduct, moving one register to another becomes fast since you can just copy the alias of one physical register to another logical register.Not clear? Try reading the post. There are other ways to get the same result (e.g., reservation stations), but the technique goes way back to mainframe computers. While it didn’t appear right away in microprocessors, modern ones often execute out of order and have to have some scheme to address this problem.If you build your own CPUs with FPGAs, it is possible to do the same trick. There are also RISC-V variants that can do it.