Chapter 4: The Program counter Flashcards
What happens when a normal ALU type instruction executes?
the Program Counter is incremented to the next instruction address (by one for word-addressable memory, or more for byte-addressable memory).
How can the program counter be used to speed up the processor?
. In fact, many processors make use of this to speed up the processor by using pipelining.
What is pipelining?
This term refers to the process of breaking down the instruction cycle into different parts and overlapping the steps of consecutive instructions.
Example of a fetch/execute step?
movlw H’55’
Example diagram of pipelining?
So during the execution stage of one instruction the next instruction is already being fetched. By using pipelining, the speed of the microprocessor can be increased.
What happens to a program counter during a branch, jump or goto?
In branch, jump and goto instructions the programme counter is no longer simply incremental. Instead, these instructions intentionally change the programme counter to a new value often specified as the operand of the instruction
Possible negatives of pipelining?
Note that there is a speed cost to using these operations, since the next instruction that would have been fetched during the execution of the branch, jump or goto instructions as a result of pipelining would have to be discarded as it would be the wrong one. This can be seen in the diagram above. The Fetch 4 process was unnecessary since the SUB_1 should be the next instruction. The call function in line 3 then must prevent this fetched instruction from being executed.
Unconditional branch, effect on program counter?
An unconditional branch always changes the programme counter.
What is a conditional loop?
A conditional branch can use a status bit to make the decision whether to branch or not. This allows a conditional loop to be created such as a for or while loop