I am confused by the difference between the CPU memory buffer register and the program counter. The MBR holds contents and instructions from memory. The program counter stores the next instruction to be sent to the Instruction Register. Both the MBR and the program counter send information to the Instruction Register. Both seem to do the same thing- hold the next piece of data and then send it to the Instruction Register where it then executes the instructions from the byte code. So what is the difference? What am I missing?
The program counter (PC) containts the address of the next instruction to be executed.
So an instruction fetch works like this:
- Put contents of PC onto address bus (often there's a memory address (MA) register or similar which buffers the contents of the address bus).
- Read memory contents from this address into MBR
- Latch contents of MBR into instruction decode circuitry, so the MBR can be used for other data transfers.
As you can see, the PC and MBR are completely different.
(And guys, the question is perfectly clear, and not too broad at all. I don't understand the close votes).