eli5- How does coding work on a chip level?

399 viewsEngineeringOther

I’ve always wondered how a program wtitten by a human makes a silicon chip work. The idea that a a chip made from an element responds to a written code to generate outputs is so intriguing to me. So, how does a program make a chip work? Sorry if i sound very naive.

In: Engineering

4 Answers

Anonymous 0 Comments

This is multiple levels deep.

So first up you have the most basic of all programing.

Logical gates.

These are teeny tiny components the size of some hundresds of atoms at their smallest.

They are arranged such that, for example, if both the inputs are 1 then there is enough current in the system to produce a 1 and if not there isnt enough current and it produces a 0. This is done mainly through the use of very fine tuned resistors.

Next up is microchips.

You can put these gates in a row to make more complex gates and develop very basic functions.

For example there is a specific way to arrange 6 or 7 “AND” (which take input of 1 on both sides to produce a 1) logic gates to make a system that will take 4 inputs and output the value of one of them, selecteded by a 5th and 6th input.

This is what a microchip is

Now full on hardware.

So with these microchips we can repeat the process and arrange them to form for example something that takes in 2 numbers and then adds, subtracts or multiplies them (dividing is super hard actually) based on a 3rd input.

Now binary.

Now that we have a working component, we can feed it predetermined strings of 0 and 1 and it will do what we want.

These strings are MILLIONS of 0 and 1 long so its basically impossible to code in this.

Now ASSEMBLY.

So since 0s and 1s are so hard, chip manufacturers have worked extremely hard to assemble a list of these 0s and 1s that do basic basic stuff like selecting a specific part of the CPUs memory.

Adding 2 values.

Reading a value.

This forms the most basic programming laguange ever, ASSEMBLY.

Were as in other languages you might only need to say “add 1+1” in ASSEMBLY you have to do crazy stuff like

“Select this physical location on the actual CPU”

“Now to that specific location, add the value of this other one”

“Now, read what is the result from the microchip that does addition”

You are telling the PC in almost 0s and 1s what physical wires need to conduct current to do what you want.

This gets converted into ACTUAL 0s and 1s by a program called a “compiler” which was developed by the beautiful people that created ASSEMBLY and who had to suffer through dealing with actual 0s and 1s

High level languages.

And now we arrive at our destination.

High level languages.

These languages are what you normally see people programing in but they are being super sneaky on how they work.

When you finish you project and run your code, what you wrote gets actually turned into Assembly code and then that assembly code is turned into 0s and 1s and those 0s and 1s are fed into the microchip that feeds them into the logic gates that physically conduct the electricity in this huge beautifull extra precise domino effect

You are viewing 1 out of 4 answers, click here to view all answers.