How does the processor know how to recognize certain 1 and 0's - Page 2 - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Hardware > Monitors, Printers and Peripherals
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 09-02-2004, 08:37 PM   #11 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

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.
__________________

__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Old 09-02-2004, 08:40 PM   #12 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

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!!!
__________________

__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Old 09-02-2004, 08:42 PM   #13 (permalink)
PowerQuest / Opera
 
TheMajor's Avatar
 
Join Date: Jun 2004
Location: Netherlands
Posts: 10,177
Default

thanks...
another question:
is there any way to compare FLOPS with MHz? They always say servers operate at 20Teraflops etc
__________________
TheMajorMMX - Intel P200 MMX @ 225Mhz - V-Tech (PcPartner) Baby-AT mb w/ Intel Triton TX chipset - Nvidia Riva TNT2 M64 w/ 16MB - 256MB M-Tec SDRAM - Still running.....
TheMajor is offline  
Old 09-02-2004, 08:43 PM   #14 (permalink)
Ultra Techie
 
Join Date: Oct 2003
Posts: 504
Default

not that it really matters but shouldn't this have been posted in the programming section of the forum
__________________
<img src = \"http://filebox.vt.edu/users/chuck527/My%20Work/Sig.jpg\">
ThirtySixBelow is offline  
Old 09-02-2004, 08:45 PM   #15 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

flops are related to floating point calculations.
__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Old 09-02-2004, 08:49 PM   #16 (permalink)
PowerQuest / Opera
 
TheMajor's Avatar
 
Join Date: Jun 2004
Location: Netherlands
Posts: 10,177
Default

programs can't communicate with the CPU right? only windows can use the assembly language right?
__________________
TheMajorMMX - Intel P200 MMX @ 225Mhz - V-Tech (PcPartner) Baby-AT mb w/ Intel Triton TX chipset - Nvidia Riva TNT2 M64 w/ 16MB - 256MB M-Tec SDRAM - Still running.....
TheMajor is offline  
Old 09-02-2004, 08:49 PM   #17 (permalink)
Monster Techie
 
Qiranworms's Avatar
 
Join Date: Mar 2003
Posts: 1,635
Default

Quote:
Originally posted by killians45

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


Also,
Quote:
Originally posted by TheMajor
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.
__________________
-->Marc
Error: Keyboard not attached. Please press F1 to continue. <pre>-------OS----------Gentoo Linux-------<br>------Browser-----Mozilla Firefox-----</pre><form action="http://www.srsyo.org/tfsearch.php" method="get"><input type="text" name="search"> <input type="submit" name="submit" value="Search the Forums, thanks to Emily"></form>

|||Official Forum Rules|||<hr>
Qiranworms is offline  
Old 09-02-2004, 08:53 PM   #18 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

Heh, I think your right...
__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Old 09-02-2004, 08:59 PM   #19 (permalink)
PowerQuest / Opera
 
TheMajor's Avatar
 
Join Date: Jun 2004
Location: Netherlands
Posts: 10,177
Default

thanks very much killians45, for all this info!! I really learned a lot.
__________________
TheMajorMMX - Intel P200 MMX @ 225Mhz - V-Tech (PcPartner) Baby-AT mb w/ Intel Triton TX chipset - Nvidia Riva TNT2 M64 w/ 16MB - 256MB M-Tec SDRAM - Still running.....
TheMajor is offline  
Old 09-02-2004, 09:07 PM   #20 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

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.
__________________

__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.