Logout

6.1.1 Describe the function of the following processor components: accumulator, instruction register and program counter.

Teaching Notes:
Further details (or registers) are not required.

Sample Question 1:

An application is running on a computer. The main program calls up a subprogram.
When the subprogram finishes, control is passed back to the main program.

(a) Explain how a stack would be used to ensure that the correct sequence
of instructions is followed. Reference should be made to the use of the
program counter. [3 marks]

Sample Question 2:

Outline the functions of the following registers:
(a) instruction register; [2 marks]
(b) accumulator. [2 marks]


JSR Notes:

Take a good look at the additional notes linked from this topic - they will put all of 6.1 into a bit better full context.

Remember here that the one crucial register missing is the Memory Address Register - the textbook does a good job of covering it. And do note that these are not all of the registers. Refer back to my Topic 3 notes where the CPU is discussed to get an idea of other registers. A certain processor might have 64 or 128 or 256 different registers, but these are the main ones to get your head around. So here's a summary of what each of the three registers mentioned in the syllabus do:

Accumulator - This is the register that keeps the "running total" as it were of calculations and processes. Another way to put it is that it maintains the value that is being changed on the way to a final result. For example, think of a very complex mathematical calculation; there are many "sub-totals", as it were, that need to be calculated on the way to coming up the final answer. In fact all processes executed in a computer are broken down, ultimately, to simple addition, subtraction or comparison. As these minor parts of a bigger calculation/process are processed, the accumulator keeps track of the "sub-result" that is required to be worked on next. This happens up to the point where the full calculation/process is finished, and so the final accumulated product, sitting in the accumulator, is passed back to be stored in RAM memory.

Instruction Register - This register holds the actual instructions sent from the RAM, one at a time. It is this instruction which is actually executed in the fetch and execute cycle. See the text for more good information on this, but remember that what sits in the instruction register is both an instruction, and data that the instruction will act upon (in combination with what is in the accumulator). When you think of basic arithmetic, you have an operator, like a + sign, and you have two operands, like 4, and 12. So you can think of the opcode part of the instruction as the operator, and the data part of the instruction as one of the operands; the other operand is sitting in the accumulator.

Program Counter - This just holds the address of the next instruction to be executed. As soon as the request for the next instruction is made (using the address held in the program counter), the program counter is incremented by one, so that it's ready to be used to access the next instruction in the program. You can think of the addresses as being in hexadecimal - they will actually be transferred via the address bus as 32 binary digits, or for newer computers possibly 64 binary digits. So the program counter would increment, for example ABC123 to be ABC124, to ABC125 and so on as the program executes machine code line by machine code line.