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

Status
Not open for further replies.

NanoWarrior

In Runtime
Messages
268
Lets say I press the space bar, I heard that techically is represented as 00100000 in a word document in binary language......how would the program such as word know how to represent this as the space in a word document? Doesn't the programmer have to tell the processor what combos of 1's and 0's represent in there program? Does every programmer that programs a word document program have to use the combo 00100000 for space in their word document program OR does the programmer get to tell the processor that any 8 bit combo would work for space?
 
This is what I think (I could be wrong):

Word is written in some language wich is recognised by Windows.
Windows sends CISC commands to your CPU wich the CPU converts to binary code.

That's all I know
 
yeah dude you're skipping a lot of steps and asking about a million questions through the course of only 3 lol. At the point where someone is literally programming something like microsoft word....by that point 0's and 1's aren't even in the picture. They are writing in C, C++, VBScript, all kinds of stuff I don't even know about. Those are all scripting languages and those have commands just like HTML that tell the program what to do. To get to the 0's and 1's you gotta go WAY below that...to windows itself...once again its nothing but MILLIONS of lines of code..but not 0's and 1's ......once again it is just code that tells the computer what to do...its HOW that computer is able to produce code that allows us to talk to them is where the 0's and 1's come in. They can only speak in terms of something being off (0) and something being on (1) ......so literally there are billions of questions being asked to the CPU like 'Hey should this be on or off?' and after it answers 8 of those questions each known as a bit you get a byte! and with that byte you can create ascii which will appear like a letter! ASLKAS <--- ascii characters (I think I'm still on track here...anyone can join in at any times) so yeah it takes 8 bits for a byte and one letter is a byte, thats why it takes like 00100110 just to represent the letter 'A' and realize A would be different than a. So yeah.....hope that clears something up for ya lol
 
whatever dude don't steal my glory! lol...yeah but I doubt he even knew what "Windows sends CISC commands to your CPU " meant......just let me type man just let me type =P
 
yeah I know...oddly enough I don't talk a lot in person lol. I can type comfortably around 80wpm and if I actually need to type something then I'm hittin 100 easily. Was doing 35-40 in 3rd grade! Can't help it...I just get off on explaining stuff....ahh crap! I can't stop this paragraph.....major.....HELP!!!........
 
binary = machine language. when programing, you shorten simple command line structures. so, we'll start at recent and go backwards in time here. programing is basically built on top of previous work. VB6.0, for example, isn't just ONE person, but the compilation of many. To make things shorter, people have writen what are called libraries (DLL's). So, for example, the if statement. Here is an example of code:

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

exit sub

this does a few things. you have a form with a radial button that has been assibned the name optbutton1 and another called optbutton2. the code above goes and says well, if the value of optbutton1 is true (meaning selected) then do this. but if optbutton2 is selected it will do nothing at that point, but continiue down the line of code. then it gets to the next if. well, this one turns out to be true, so it runs the msgbox nested in there. The If statements are now easy to do, but awhile back you would have had to written you own sequence of algorhythms to come up with this. as in, saying what exactly "if" is. but someone has already done this and need not be done anymore.

now, what happens is visual studio (or whatever programming code you are using) has a compiler. This, to make it simple, takes all you've writen and makes it ready for running. So that little code writen above MUST be compiled. This takes what I've just writen and breaks it down into something readable by the machine. Also called machine code (binary). 1's and 0's. You CAN technically write in machine language, but I would shudder to do such a thing as in that little bit written above would be HUGE because of the links to the library to define the If statement, would add to the code, as would msgbox, etc.

so, modern programming is just a simpler way to interface with machine language in a more friendly way, and do it much quicker.

Now as far as how does word know this is a space? Its built into the programming language and the .DLL (dynamic link libraries) built into the operating system. Thats what the o/s also does. Most common controls will be easily understood when writing applications. If you want to get exotic, though, and change the norm of what a space bar does in word, then you HAVE to write it in code. So, for example, I wanted to change what happens when space is pressed in a program I wrote (say my own generic word program). I would write the parameters in the main body of the code itself. That way, when you load up my program, it will temporarily remap and redifine what certain keystrokes do.
 
and as far as do I have to tell a program what pressing space bar does? if I want it to do the default action, then no.. leave it and it does what the o/s default action for it is. remember, 0 and 1 is just a name scheme. the processor actually DOESN"T get 0's and 1's, but more of a current passing through its crystal. if you've ever seen a picture on osciliscope or in a magazine, you've probably seen where there is a wave kind of like rounded humps. those are analog. now DIGITAL is what the processor uses. imagine those same waves but instead of rounded, its in blocks. damn, wish I could draw this instead. but anyhow, they are squar looking, like those battlement thingies on top of castle towers. when at the top peak, thats a 1. at bottom that is a 0. To get even more complex (sorry), processors contain chipsets that allow for instructions to free up processor time. It is very involved to explain these things, and without drawing pictures it is very hard to do.
 
Lately i read some article it said todays CPU's use CISC and convert it to RISC to make the processing faster, and then it would finally become binary...maybe I don't understand the process correctly?

i know this sounds kinda vague, but I can''t help it

help me understand
 
Status
Not open for further replies.
Back
Top Bottom