how does a cpu work?

Smags87

Member
Mar 4, 2002
49
0
0
well...how does a cpu work!?!?

is there any major differences between an amd and an intel cpu?
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
based on the way you asked your question, I would have to answer: no, not really... the AMD chip is targeted at more work done every clock, the intel chip is targeted at a faster clock.

I think there have been a few threads about how CPUs work here... do a search in highly technical ;)
edit: eh, i didn't find anything when I searched.

very basic explanation cause i'm tired:
A cpu is a collectoin of transistors, which make up gates. a transistor is like a switch. if you put current at theinput, it conducts, otherwise it blocks. by using a few transistors, you can make a gate. a gate can do somethign like conductlyonly if BOTH inputs are on (AND gate) any one input is on (XOR gate), one or more is on (OR), etc, or conduct if the input is off (NOT gate). by combining these gates, you can get complex functions, like an adder. (a very simple half-adder has two inputs and two outputs. the first output is set if both inputs are on, and the other is set if one of the inputs is on).

tomorrow I can post more info, but i'm sure others will also have replied :)
 

Evadman

Administrator Emeritus<br>Elite Member
Feb 18, 2001
30,990
5
81
Question #1: How does a CPU work
If you get realy basic, you end up with a half adder. ( way way way oversimplified, so don't shoot me )

Say you have a "register" ( that is where the CPU stores the binary #'s that it is going to do the "operation" on. ) assume you want to add 2 numbers together. Lets say 10 and 8. Lets further assume this is a simple 8 bit address for simplicity.

First the CPU will get the decimal #'s in binary form. 10 = 0 1 0 1 0 0 0 0 and 8 = 0 0 0 1 0 0 0 0

Then the CPU will "add" the binary 1's and 0's together. ( forgive below, text is always hard to draw in, and I am only going to show the first 5 bits, as the rest do not matter, as they are all 0's )

0 1 0 1 0
0 0 0 1 0 +
-------------

If the CPU shows 2 0's being add ed together, that equals a 0 in the sum ( totals ) line. If it sees a 0 and a 1, then that = 1. If it sees a 1 and a 1, then it will make that a 0, and add a 1 to the next line.

So the answer we get for the above is:

0 1 0 1 0
0 0 0 1 0+
-------------
0 1 0 0 1 = 18 ( 2 + 16 )

Does that kind of help? That operation would be called a "cycle" or such.

Since you seem to be asking this as a non-computer person, I will show you how the "bits" are counted so the above makes more sence. AKA how to turn a # into a binary #.

The 0's and 1's are in a horizontal row above. That means that the 0 ( or 1 ) farthest to the left, counts as the numeral 1. the next is a 2. after that a 4, then an 8, 16 yada yada. see below

0 0 0 0 0 0 0 0 0 <---- 8 bits. every 0 that turns into a 1 gets counted as it's decimal equivalent.
1 2 4 8 16 32 64 128 <------ Sorry, but the forum automaticly deletes extra spaces.

So if the first and last 0's in the above 8 bits are 1's then we would get 1+128=129. If they are all ones, you would get 255, but including "0" we get the magicial # of 256.

( Yes I know this is a HUGE simplication of what a CPU does, but I was trying to get it to the most basic so we can help Smags87.)

Quetion 2: AMD vs. Intel Design Differences

Frankly, I do not know a whole lot about CPU archetecture, but I do know a little. As was said above, AMD tends to do more work per cycle ( MHZ comparison ) than an Intel CPU does. Intel has what is called a "longer pipeline". in Intel's Hyper Pipelined Technology, there are 20 steps ( AFAIK ). The longer the pipeline is, the higher (theoreticly) the clock speed can go. ( without a die shrink ). As long as the processor anticipates what information it needs at the next step,( Branch Tree Prediction) then the longer pipeline will have no effect on the "work" that a CPU does in a given time frame. The problem lies in when the data is not ready for the next step. Then the processor has to wait, or start that cycle over. and 20 steps is a big jump compaired to the P3's 10 steps, that would all have to be done over, so the CPU tends to do less work per clock. ( PM Would be able to tell you much more than I ever could. Hope he stops by. )

<edit>
Names have been changed to protect the innocent. :D
</edit>