In the previous lesson, you learned about hardware part of a system. If you leave I/O then only CPU and memory is left in the system. In this lesson, you learn the relationship of CPU (Processor) with memory by understanding activities of a CPU.
The main function of CPU is to execute a program which is nothing but a set of instructions and data. A CPU gets the instruction as part of the response from memory.
Every memory location has an address. At this address, the instruction is located which gets as a response from memory. Sometimes the response is a data or operand.
Two major instruction processing phase of CPU is
During the execute phase, the data is fetched and operation is carried out on the data or operand. This major phase is known as Instruction Cycle.
The whole cycle is FETCH – DECODE – EXECUTE.
Suppose there is an instruction that fetch 3 unit of information and 3 unit for execute phase. Fetching one unit of information from memory over bus (called bus activity) which will be completed called Machine Cycle.
It is also possible that each machine cycle is divided into steps of small activities called the state of the processor. This small activity is controlled by the Basic clock of the computer.
Because the programs and data are stored, you have a Stored Program Digital Computer. This is known as VON NEUMANN Architecture, named after mathematician and physicist John von Neumann.
It is logical to say that CPU registers, bus width, and memory should be of an n-bit word, but not necessary. If registers in CPU have instructions and data, it need not fetch from memory.
CPU always gets what it does not have. Once it has everything then the execute phase happens.
There may be one operand, two operands in the instruction. Also, there is zero operand instructions
for example, ADD R1 R2 where R1 and R2 are two operands.
Finally, instructions always start with decoding the instructions.