A computer has become a necessary part of all government and private offices. The computer skills test has become an essential part of many competitive exams. It is expected from the candidates that they know about the computer, its different parts, and its different apps. Here in this article, we will tell you about the most important part of a computer, ‘the CPU’. We will also discuss how does a CPU work.
Let’s know about it and try to understand its working.
What is CPU
CPU is the Central Procession Unit of a computer. CPU is like the brain of the computer and all the processing from booting the OS to run any programme, runs in CPU only. The processing speed of CPU determines its power. The speed of a CPU is measured in Giga Hertz. As CPU performs a lot of calculations at a high speed, so it gets heat up quickly. To cool down its temperature a cooling FAN is installed on it.
When you know that CPU is the brain of the computer then you must want to know what work it does. Let’s have a look at it.
What Work Does a CPU Do
CPU’s working method is complex. All the CPUs no matter what their origin is, perform the below mentioned basic instruction cycle that consists of three steps – Fetch, Decode and Execute.
Fetch: The primary function of CPU is to fetch the instruction from the memory of the computer. In the memory of the computer, all the instructions are already saved at a particular address and CPU fetches the instruction form that addresses. In this process of the computer, CPU takes the address number from the program counter and arranges the priority of all the instructions. The CPU uses a program counter that keeps the track of which instruction to fetch next. It means all the instructions you give to the computer execute one by one as per the priority set by the processor.
Decoding: The other primary function of CPU is decoding the instructions. The CPU understands only binary language and the instructions it receives are in assembly language. So CPU decodes the instructions by converting them into binary language. This process is called decoding.
Execute: The third function of the CPU is to execute the instruction. During the execution CPU performs three activities; it does the calculation in ALU (Arithmetic and logical unit) move data from one memory location to another and jumps to other address.
After executing the process ALU has to store the result of execution as well. These result stays in cache memory until the user wants to save it in RAM or shut down the CPU.
CPU keeps repeating all the three primary functions. CPU performs all its calculations and other duties with help of its two components; Control unit — CU, Arithmetic and logical unit — ALU. Let’s know about them.
Components of CPU
The Control Unit (CU): Control unit coordinate to transfer the data between microprocessor and ALU. It does not execute the programme instructions but serves them to ALU. The complete workflow of CPU is also controlled by CU. Control unit of CPU is run by the instructions stored in the computer’s memory; RAM and ROM.
The Arithmetic and Logical Unit: ALU does all types of computation; arithmetic or logic. The arithmetic operations include addition, subtraction, multiplication, and division. The logical calculations are based on the comparison. These comparisons are based on AND, OR, XOR and NOT operations.
How CPU Works
Here we will understand how CPU works with the example of only one instruction but in actual CPU processes many instructions in one go. Let’s know in detail how the CPU works in stepwise.
Step 1: some instruction is given to CPU.
Step 2: CPU draws it from the RAM (Random Access Memory) and some other hardware for the purpose.
Step 3: CPU reads the information associated with the task given to it and send it back to RAM. After reading the information from the computer’s memory the CPU starts its calculation and thereafter transporting the data.
Step 4: CPU also has to make sure that data travel through the System BUS. System Bus is a communication system through which data is transferred among all the components of the computer.
Step 5: In the system bus, the data is arranged in the correct order. And that’s how the CPU completes the assigned work. As the last step of getting the action done, CPU saves the data in the system’s memory.
To conclude the working style of CPU we can say that the instructions move from memory to control unit then Arithmetic Logic Unit then again come to memory and thus the output is ready. You can understand the same with the below mentioned chart.
If you are curious to know more about how a CPU works, then you need to know about the primary functions of CPU. Lets’ have a look at them.
How It All Joins Together
So here we have given the gross simplification of how CPU works. CPU has much hardware in it to support it to execute any command. Usually, CPU comes with one ALU but many Morden and advanced CPUs also come with more than one ALU as well.
When some command is executed then Data is loaded from system RAM (memory) to the control section. Control section reads two numbers from RAM. The first number goes to the ALU register and the second one goes to the system bus. ALU then performs all the calculations and stores the result of the calculation in a different register. CPU reads data from there and then continue the process and saves data in memory.
So that’s how the CPU works and solves our difficult calculation in seconds.