What is Program Counter?
There is a register in a PC (program counter) processor that contains the address of the next instruction to be executed from memory. It is a 16 bit register and is also called instruction counter, instruction pointer, and instruction address register (IAR). PC (program counter) is a digital counter which is needed to execute tasks quickly and track the current execution point.
All the instructions and data present in memory have a special address. As each instruction is processed, the program counter is updated to the address of the next instruction to be fetched. When a byte (machine code) is fetched, the PC is incremented by one. So that it can fetch the next instruction. If the computer is reset or restarted, the program counter returns to zero value.
For example, suppose the content of PC is 8000H. Which means that the processor wants to fetch the instruction byte on 8000H. After fetching the byte at 8000H, the PC automatically increments by one (1). In this way the processor becomes ready to fetch the next byte of the instruction or to fetch the next opcode.
Instruction Register
Do you ever wonder how your computer makes sense of your commands and responds accordingly? What is there to say? It is no magic, but a thing called the Instruction Register. “Fancier” is perhaps one way to say “It’s akin to the conductor at an orchestra where every note (instruction) should be perfect.”
Today in this article, we are going to explore about mystery that exists in the Instruction Register. Whether you are techie or just anyone who is interested in knowing what it actually does inside one’s computer; here comes our trip to unraveling these mysteries. Therefore, fasten you seat belts, come with me and allow us take a close look at the Instruction Register but in an easy-to-understand version.
- Central Processing Unit (CPU): These include a central processing unit (CPU) that is responsible for interpreting and following instructions from memory stored within various parts of a computing system. This unit has several parts which include the Instruction Register, ALU, and the Control Unit.
- Memory: Data and instructions are stored in memory in a computer system. Memory communicates with the CPU in the sense that it fetches, stores as well as processes the data.
Table of Content
- What is an Instruction Register?
- What is Program Counter?
- Difference Between Program Counter (PC) and Instruction Register (IR)
- How do Instruction Registers Work?
- Workflow Diagram of Instruction Register
- Types of Instruction Register
- Features of Instruction Register
- Importance of Instruction Register