How Do CPU's Read Data/Instructions?

By sanks4545 ·
Assembly language, as I've heard, is the language of microprocessors. You write it, it gets "assembled" into binary and the CPU reads it. How does this work? CPU's are simply made of silicon and some conductive metal, aren't they? How does the CPU know what a 1 or a 0 is? Perhaps it's because 0 is off and 1 is on, and impulses flow that way...but how does the computer know how to turn this off and on by "reading" binary? There has to be some sort of magic going on.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Electronics 101

by TheChas In reply to How Do CPU's Read Data/In ...

To understand how the CPU converts raw binary data into actions, you need to learn basic electronics.

The silicon in the CPU is at the basic level a vast array of electronic (transistor) switches. Imagine millions of light switches that are interconnected in ways to respond when specific other light switches are turned on and off.

Step back to one of the first "hobbyist" computers, the Altair.
To program the Altair you set one bank of switches for the memory address in binary, with on as a "1" (high) and off as a "0" (low), and another bank of switches with the binary data to be stored in that memory location. You then pressed another switch to write the data to the memory address. If you programmed each byte of data correctly into memory, you could then run your program.

The CPU and memory do the same thing. Only on a much faster and more autonomous level.

All of the "magic" of computers and other modern electronic devices are pure applied physics.

You might try this web site for learning electronics:

Here is a video on using an Altair computer.


Collapse -

Reponse To Answer

by OH Smeg Moderator In reply to Electronics 101

Great response Chas.

Collapse -

Reponse To Answer

by sanks4545 In reply to Electronics 101

Thanks dude, exactly what I was looking for! Now, the only thing left is to become an awesome electrical engineer.

Collapse -

Fetch boy!

by Charles Bundy In reply to How Do CPU's Read Data/In ...

Roll over!

At it's heart a processor fetches and executes instructions. There is nothing specific to electronics or electricity to realize this never ending cycle (see Alan Turing, Joseph Jacquard and Charles Babbage)

Collapse -

1 or 0

by Charles Bundy In reply to How Do CPU's Read Data/In ...

The CPU defines nothing :) You use transistors to control current flow. The mechanical equivalent is a bucket attached to a lever which turns on water. Water flowing means 1 no water means 0. Or switch it around :). Anyway poke a hole in the bucket. Pour water in faster than it flows out the hole and eventually the weight of the water turns on the spigot (which is spring loaded to turn off automatically). No water into bucket and eventually leakage causes the bucket to lighten and turn water off. You now have the basic mechanical switch to build a computer.

Collapse -

Binary is a "convenient" representation for us

by Tony Hopkinson In reply to How Do CPU's Read Data/In ...

Processors don't "understand" any of it.
They "understand" two different voltages, in TTL (Transsitor to Transistor logic, that's about 0 and about 5. On or off true or false, 1 and 0 (or sometimes 0 and 1 ...)
Assuming you don't want to learn quantum mechanics. . Make a start with basic transistor theory, then skip over to basic logic cuircuits and boolean algebra.
Then a long with clock circuits you have the basic tools to understand this at this level. Mind you you don't have to know how logic circuits are implemented to get how they are used.
Best bet is to wind the clock back and look at this stuff before we learnt how to put a million transistors in something the size of your thumb.

Collapse -

Well at least no one

by OH Smeg Moderator In reply to How Do CPU's Read Data/In ...

Tried to explain what a PN Junction on a Silicon Wafer is or how Silicon is Doped to Form a series of PN Junctions.

Of course 3D Silicon Wafers are even more complex to try to explain to someone dot versed in High End Silicon Technology.

I still prefer The Chas's explanation though it's easier for a Nontechnical Person to try to understand.


Collapse -

Reponse To Answer

by Charles Bundy In reply to Well at least no one

Aww can't we thrown around CMOS and MOSFET?

I like the Chas document, but also felt like it needed to be said that computation isn't really tied to any physical representation e.g., electrical versus mechanical or even biological (just like Tony said "get back to basics")

Collapse -

Reponse To Answer

by HAL 9000 Moderator In reply to Well at least no one

Back to basic's :^)

Once I was asked to describe a LED to a guy in it's most basic form. You should try it sometime it???s not as easy as it sounds.

The basic description of a LED is a Light without a Filament though the Actual PN Junction is the Filament so it???s not quite correct but the nontechnical Enduser will understand that.


Collapse -

Considering L.E.Ds check this out

by Charles Bundy In reply to How Do CPU's Read Data/In ...

I love MAKE magazine :) I will add that light is produced when energy is released by electrons 'falling' into positive areas. Think about that when Collin demonstrates H.J. Round's cat whisker experiment which wound up being the first documented L.E.D.

Related Discussions

Related Forums