What is CPU ?
A CPU is a Central Processing Unit. It used to be that the CPU lived in the middle of a computer, and there were I/O (input/output) devices connected to it on one side and the memory connected to it on the other side. Google “Von Neuman architecture” to see drawings.
The CPU has a loop. The loop begins when the CPU starts to execute an instruction. There is a register inside the CPU, the PC (program counter) that has the address of the next instruction to execute. The CPU gets the instruction, which is a number, from that address. Once it has the instruction, then it has to decode the instruction. Once the instruction is decoded, the CPU then does whatever it is the instruction tells it to do. The PC is then incremented to the next instruction and the loop starts all over again.
Why did I write “used to be”? Because as technology evolved, more and more CPUs were added to the I/O devices, and memory controllers were added to the memory. These also executed instructions. Some of them (for example, the memory controller) were quite limited. Others (For example, the Graphic Processing Unit in the video card) were extraordinarily powerful. CPUs themselves became more powerful. As the CPU chips became larger and larger, it became cost effective to add more CPUs (“cores”) to each chip, so what is called the “CPU chip” may actually have more than one actual CPU on it.
Now, this is a very limited discussion of what a CPU is and how it works. There are thick books written on how CPUs work. Also, how a CPU works depends on how you look at it. An electrical engineer looks at how the CPU connects with all of the other parts of the computer, and how the CPU itself is made. The part of the CPU that decodes the instructions and does what the instruction tells it to do is also software, called “microcode” and somebody has to write that. Somebody who writes software in assembly language has a different view of the CPU, and there are thick books written about that, too.
Bottom line: you asked a simple question with a very complicated answer. It’s an excellent question. I encourage you to study computer design a little more. It is a fascinating subject and I predict that it will be a good, high paying career for decades to come.
No comments: