how first instruction is loaded to devices? Is just some electricity that stores in chips somehow?

108 viewsEngineeringOther

Hi, how exactly cpu becomes clever from just be a piece of silicon? Initially its just a piece of stone and metal with photolithography on it, and then somehow it piece of stone starts understand commands, how exactly first instruction is loaded to a piece of stone?

In: Engineering

9 Answers

Anonymous 0 Comments

This is a really complicated topic but, basically it is a bunch of light switches. You put electricity in one side and out the other side pops a video game, movie, or AI.

This series does a good job of breaking it down.

Anonymous 0 Comments

The CPU is hardwired to begin executing code from a specific location, that location contains more instructions, likely that lead to more instructions, until the device is up and running in it’s normal state.

It’s like knowing that if you flip over a box of frozen food and look for the ‘directions’ box, then you read and follow those and eventually enjoy your meal.

Anonymous 0 Comments

The CPU is designed to, from a total power loss or a reset, start in a specific mode and start loading instructions from what it sees as “memory” starting from a specific address. The CPU specifications and/or its manufacturer will specify what this is. Beyond that, it does just start running instructions immediately in the usual way.

When I say “specific mode”, for example modern CPUs can run in several modes such as 16 bit, 32 bit and 64 bit and many variants and so on. At power-on which mode it is in will always be the same.

Whoever makes the circuit board the CPU is installed into is responsible for having a storage chip on the board with code already saved onto it, ready to go and available to the CPU as part of its “memory”/RAM. In the old days this was often a removable chip to allow upgrading by literally swapping it out, or re-programming it with a device designed to do it. These days it’s stored on flash memory, like an SSD, but on the board itself.

That code usually goes by the name of “firmware”, or on PCs people will call it the BIOS sometimes.

Anonymous 0 Comments

The 1s and 0s are already written down on the chip. Running power let’s the computer read it

Anonymous 0 Comments

Part of the answer here is that the circuit that has been manufactured on the silicon by the processes you mention has a defined structure (architecture) and a defined set of instructions that run on that structure.

There are many ‘departments’ within the architecture of a modern processor but their behaviour is planned and designed in.

When you want to get one out of bed, you have to follow the manufacturer’s plan for which signals to apply to which pins and in what order.

Most (all?) processors have at least one hardware reset pin that you must hold at either a 1 or 0 level whilst you apply the power and then release once you’re sure the power is up.

This pin is internally connected to the structure in such ways that the internal logic gates start off in a known state.

Once you have that state, the processor will have a pre-defined (by the designer/manufacturer) sequence of things that will happen when you release the hardware reset line.

Usually, the processor will assert a binary address on its address pins and expect to be presented with another binary code on its data pins. This code constitutes/correlates to its first ‘instruction’ from memory.

Everything beyond that is ‘software’ and the world’s your oyster…

Anonymous 0 Comments

If you have 50 hours to spare I recommend watching a series on youtube from Ben Eater [breadboard computer]( He build a cpu from “scratch”. It helped me understand how it works

Anonymous 0 Comments

In addition to these correct comments I’ll add:

This is what is called bootstrapping.

It is the impossible idea that you can pull yourself up by your own bootstraps.

When you boot your computer, this is what it does.

Anonymous 0 Comments

I could not find a satisfying answer to this question when I began asking it a few years ago. I asked ChatGPT to elaborate more and more and couldn’t get to a point that made sense.

Most people (even those on this site) are happy with the answer that when powered, a CPU begins processing instructions at a memory address. How does putting an electrical potential across a CPU (billions of transistors) cause it to even know where to look for the memory address, how does it know what a memory address is. How does it read its own firmware, how does it know what instructions it can run.

Good luck.

Anonymous 0 Comments

Most modern processors actually have a limited function processor built into them with the sole responsibility to initialize all the main processor’s systems upon power up and then set the main processor going, executing the bootstrap code. The limited function processor then goes idle until the next power up.