ELi5: How do we tell a CPU what its job is?

684 views

Edit: I don’t think I worded this right, how do we create CPU’s? How do they know they’re the brain of the entire operation? If that makes my question easier to comprehend.

In: Technology

5 Answers

Anonymous 0 Comments

There is no consciousness embedded in a CPU. The CPU is like an engine, give it fuel, start it rotating and it keeps running according to the fuel given to it. The engine, like the CPU, doesn’t “know” anything.

CPUs are at one level just big general purpose calculating machines. Give it some electrical signals as input and instruct it to manipulate the signal using logic and then output the results as other signals. The output can be connected to a screen, disk drive, RAM, to the internet. The input comes from the internet, keyboard, mouse, RAM, HDD etc etc.

The CPU doesn’t “know” any of this – some of the instructions are built in, other instructions it gets from the inputs (other programs – ROM, RAM, CD etc). It simply follows the instructions one after another after it is turned on.

EDIT: A CPU doesn’t choose what it does, it doesn’t have ideas who or where the inputs/instructions come from and it doesn’t know what the output is used for.

In a simple analogy, the light in your room doesn’t “know” it needs to light up a room. If the right kind of power is delivered to it, it lights up. Take away the power, and it stops lighting. We don’t describe the light as having an understanding of it’s job.

Anonymous 0 Comments

Think of a CPU as a fancy calculator. The calculator has no idea what it is doing. It is just designed to take input (you type stuff into the buttons) and give the right output.

But the CPU doesn’t have buttons that a person types on. Instead, there are programs in the computer’s memory that hold the instructions that are fed into the CPU.

Anonymous 0 Comments

They don’t “know” anything. They respond to a specific set of voltages on input wires with an action that is determined by their internal construction. The fact that that construction and the number of possible inputs and resulting actions is immensely complex doesn’t mean that they are fundamentally different than any other piece of machinery or electronics.

Anonymous 0 Comments

CPUs are designed around their instruction set architectures (ISA). To create an ISA, the designer decides what instructions the CPU will be able to execute, how those instructions are going to be read and interpreted, and what more advanced features they are going to provide. It’s a fairly common 2nd/3rd year group project for computer engineers to design a simple CPU this way.

More generally, think of a CPU as a cook, and the programs they run as a recipe. The CPU will go through the programs line by line, doing what each instruction tell them to do. The ISA describes how the recipes have to be formatted and what the recipes can tell the cook to do.

Now, in a large modern computer, the CPU is more of a head cook, and most of it’s job is to assign individual parts of the recipes to the lesser cooks in the kitchen. However, the rules for doing so are all part of the design and they influence how the ISA is structured as well and at the heart, the CPU is still just going through the recipe line by line until it is done. It’s just that the recipes are a lot more complex and getting the timing right so everything gets done when it is suppose to is extremely hard.

Anonymous 0 Comments

CPUs are basically complex circuits.

Send a voltage through this port and that port (input) and watch which port outputs a voltage. Overlysimplified so might not be 100% accurate but enough for a ELi5