+ 5
How does computer understand my commands? The coding language? But how?
computer understands coding language but why?
7 Respuestas
+ 12
To get from human to computer, it usually takes several steps. I'll stick with the more basic case of older complied languages (multiplatform ones like Java break the work up differently).
First the compiler translates the program into a series of commands and reformatted data specific to the machine (assembly language), which breaks your code down into the basic operations for the processor. This is still a higher level of work than the processor can run, but it lets this code be executed on any machine that understands that instruction set and can be represented in the more compact hexadecimal representation. People can, and do, write this directly, but the details are often too intricate to let you think about the larger design well.
Then those commands are translated again into microcode. This is a binary language, limited to even more basic command that are then interpreted by the CPU (things like: move this data, add this, send this here) . These commands are what actually causes the electrons to move. The chip doesn't know how to write a number to the screen, but it can flip the state of some of it's output bits to the requested configuration and flag the monitor to come get this stuff it is done working on.
That, however, was a highly incomplete discussion of something that most CS departments devote a sophomore year class to. If this interests you, there is a lot more to learn!
+ 10
Thank you! I do try to be useful, but I fear I may be tl:dr sometimes!
+ 9
your program is compiled to machine code (binary code or nativer Code)!
then the cpu understands the code and can run it!
you can say 0/1 means true/false or power/no-power!
read:
https://en.wikipedia.org/wiki/Machine_code
+ 7
All kinds of computers in order to being operational and useful have to interpreting 0's and 1's. And all programming languages are going through the compilation/interpretation process to convert the high level code to those binary numbers which is understandable for computers.
+ 6
Great explanation Jim.
+ 4
Very roughly:
- high level language is converted to machine code
- machine code is converted to electric signal
- electric signal trigger actions, such as turning on or off pixel on the screen.
+ 4
Java, C++, etc., high-level computer programming languages are being converted to binary codes (0s or 1s) which our computers understand.