How does the processor know how to recognize certain 1 and 0's

Status
Not open for further replies.
well, that is true to. I'm using very general terms and also trying to paint a picture by words when it should actual be displayed. usually what happens is the processor does certain things like add, subtract, muliply, etc but in VERY complex ways (floating point instructions) and has instructions built into it to determine decision making factors and then can goto other instructions based on factors. to make things quicker, there are chipsets on the MBD that can further break down writen code into machine language. this essentially makes it so its not o/s dependent, freeing it up to do other things AND processing/compiling the data to assembly language. the processor also sets addresses in memory (writes) and also retrieves (gets) addresses in memory.
 
Ah, here is an example that is much more thought out ;) :

Even the incredibly simple microprocessor shown in the previous example will have a fairly large set of instructions that it can perform. The collection of instructions is implemented as bit patterns, each one of which has a different meaning when loaded into the instruction register. Humans are not particularly good at remembering bit patterns, so a set of short words are defined to represent the different bit patterns. This collection of words is called the assembly language of the processor. An assembler can translate the words into their bit patterns very easily, and then the output of the assembler is placed in memory for the microprocessor to execute.

Here's the set of assembly language instructions that the designer might create for the simple microprocessor in our example:

* LOADA mem - Load register A from memory address
* LOADB mem - Load register B from memory address
* CONB con - Load a constant value into register B
* SAVEB mem - Save register B to memory address
* SAVEC mem - Save register C to memory address
* ADD - Add A and B and store the result in C
* SUB - Subtract A and B and store the result in C
* MUL - Multiply A and B and store the result in C
* DIV - Divide A and B and store the result in C
* COM - Compare A and B and store the result in test
* JUMP addr - Jump to an address
* JEQ addr - Jump, if equal, to address
* JNEQ addr - Jump, if not equal, to address
* JG addr - Jump, if greater than, to address
* JGE addr - Jump, if greater than or equal, to address
* JL addr - Jump, if less than, to address
* JLE addr - Jump, if less than or equal, to address
* STOP - Stop execution

If you have read How C Programming Works, then you know that this simple piece of C code will calculate the factorial of 5 (where the factorial of 5 = 5! = 5 * 4 * 3 * 2 * 1 = 120):

a=1;
f=1;
while (a <= 5)
{
f = f * a;
a = a + 1;
}

At the end of the program's execution, the variable f contains the factorial of 5.







Note from me: This is NOT binary, but assembly!! It will be read binary in latter process by the processor, its just a step down in breaking into binary and these are VERY few examples, there is in face MUCH MUCH MUCH more assembly!!!
 
thanks...
another question:
is there any way to compare FLOPS with MHz? They always say servers operate at 20Teraflops etc
 
killians45 said:

If optbutton1.value = true then
msgbox "I am awesome"
elseif optbutton2.value = true then
msgbox "I am still awesome"
end if

elseif optbutton3.value = true then
msgbox "killians45 has now lost his awesomeness"
end if


All in good fun :D


Also,
TheMajor said:
thanks...
another question:
is there any way to compare FLOPS with MHz? They always say servers operate at 20Teraflops etc

A 20 Teraflop server is quite an impressive server...considering the worlds fastest Supercomputer (the 'Earth Simulator' in Japan) has been measured to peak at about 35.
 
oh no, lost the coolness ;) well, flops are a measurment of how many floating point instructions per second and Mhz are how many ticks a processor does per second. Kind of depends on processor and chipset, I would think. As far as accessing CPU, thats a hard one to answer.
 
Status
Not open for further replies.
Back
Top Bottom