A program counter is also known as an instruction counter, instruction pointer, instruction address register or sequence control register. All instructions as well as data in memory have a specific address. As each instruction is processed, the software application responsible updates the program counter with the upcoming instructions' address which needs to be fetched.
The program counter increases the stored value by one as the next instruction is fetched. If the computer is reset or restarts, the program counter usually reverts to the value of zero. Similar to other process registers of the computer, the program counter is like a bank of binary latches, with each representing one bit of value.
The program counter works in combination with other registers to identify the current instruction. It can be modified or accessed with the help of access or jump instructions. Therefore, the destination address can be loaded to the program counter via branch instructions. The program counter can also be loaded with the address using the data processing instructions.
By: Brad Rudisail Contributor. By: Kaushik Pal Contributor. Viewed 12k times. Improve this question. Joey Joey 1 1 gold badge 1 1 silver badge 5 5 bronze badges. Have you read in your computer architecture textbook how to build an adder?
If yes, then you know how to add 1 to something. When the current instruction is stored at address , then the next instruction should be stored at ?
Is this right? Well there may be issues regarding byte address versus word address. But this is minor. A byte address is just a word address with 2 or 3 zero bits appended depending on whether you have 32 or 64 bits machine, i. But I do not see what you perceive as a problem.
Add a comment. Active Oldest Votes. Improve this answer. Aaron Hammond Aaron Hammond 2 2 bronze badges. Sanjana Ghosh Sanjana Ghosh 1. Please provide a reference or other context for the statement in your answer. Sign up or log in Sign up using Google. Sign up using Facebook.
Ans: The basic computer has three instruction code formats, as shown in Fig. Each format has 16 bits. The operation code opcode part of the instruction contains three bits and the meaning of the remaining 13 bits depends on the operation code encountered. Ans: Before investigating the operations performed by the instructions, let us discuss the type of instructions that must be included in a computer. A computer should have a set of instructions so that the user can construct machine language programs to evaluate any function that is known to be computable.
The set of instructions are said to be complete if the computer includes a sufficient number of instructions in each of the following categories: view more.. Ans: The timing for all registers in the basic computer is controlled by a master clock generator. The clock pulses are applied to all flip-flops and registers in the system, including the flip-flops and registers in the control unit.
The clock pulses do not change the state of a register unless the register is enabled by view more.. Ans: The last three waveforms in Fig. Ans: A program residing in the memory unit of the computer consists of a sequence of instructions.
The program is executed in the computer by going through a cycle for each instruction. Each instruction cycle in turn is subdivided into a sequence of subcycles or phases. In the basic computer each instruction cycle consists of the following phases: view more.. Ans: Initially, the program counter PC is loaded with the address of the first instruction in the program.
The sequence counter SC is cleared to 0, providing a decoded timing signal To. After each clock pulse, SC is incremented by one, so that the timing signals go through a sequence T0, T1, T2, and so on. The rnicrooperations for the fetch and decode phases can be specified by the following register transfer statements. The flowchart of Fig.
The three possible instruction types available in the basic computer are specified in Fig. These instructions use bits 0 through 11 of the instruction code to specify one of 12 instructions. These 12 bits are available in IR Ans: In order to specify the rnicrooperations needed for the execution of each instruction, it is necessary that the function that they are intended to perform be defined precisely.
Looking back to Table , where the instructions are listed, we find that some instructions have an ambiguous description.
0コメント