Program Counter and PCB
Program counter (PC) and process control block (PCB) are two important concepts in computer science and operating systems. Although they are related, they serve different purposes and have different characteristics. A program counter is a register in a computer's central processing unit (CPU) that holds the address of the next instruction to be executed. It keeps track of the current instruction in a program and is incremented each time an instruction is executed. The program counter helps the CPU to execute instructions in the correct order, ensuring that the program runs as intended. A process control block (PCB) is a data structure that contains information about a process. It is used by the operating system to manage and keep track of processes. A PCB contains information such as the process's state (running, blocked, etc.), its memory usage, and its scheduling information. The operating system uses this information to manage the process and make sure it runs efficiently.