A computer system has five major divisions- The Central Processing Unit (CPU), Main Memory Unit, Input Devices, Output Devices and Secondary Storage Devices.
The CPU- The central processing unit comprises of two parts, namely the control unit and Arithmetic and Logical Unit (ALU). The control unit controls all the parts connected to the computer system.
The ALU performs all the arithmetic and logical functions.
Instruction and data are fed into the computer through input devices, such as keyboard and mouse. The input signal goes to the primary memory from where the control unit fetches the instruction and data. The control unit reads the signal and passes it to the secondary memory or to the ALU.
If the user gives an instruction of storing data then the control unit sends the data to the secondary storage device to store the data permanently. Primary memory is a temporary memory, it acts as an intermediary memory.
If the user gives any complicated instruction, which involves arithmetic calculation and logical decision, then the control unit passes the instruction to the ALU. While executing the instruction, the ALU often needs to store the temporary results, before executing the final result. Therefore, the CPU consists of some temporary storage locations called registers.
There are four important registers- An accumulator, An address register, A storage register and general purpose register.
When the ALU executes the instruction completely then the final result is sent to the control unit. The control unit sends the result to the output device via the primary memory.