Wednesday, October 28, 2015

Compilers/Interpreters/Bits and Bytes

Compilers: A compiler is when you have a program and you translate it into Binary all at once. It goes through your finished product in one go, converting it and checking for your errors.

Interpreters: An interpreter translates your program into Binary line by line. You translate each line on it's own.

If you want to be able to leave your laptop while you are translating your program into Binary, compilers are better because it is one big job done at once. For an interpreter you have to take your time translating all of your program line by line. If you have an error in your program while it is compiling, the program will give an error message so you can look through and find what you did wrong. If you want to continue compiling but you don't want your computer to stop at a certain mistake you can put */ on each side so that it becomes a comment and the computer ignores it.

Bits and Bytes: In binary, every 1 is a bit and every 0 is a bit. 8 bits is a byte and these bytes are the amount of storage that you have. Depending on which amount of storage you get, you computer can hold that many bytes of data.

Every character on the key board has a certain code of 1's and 0's that tell the computer what it is. If i press a key, it sends a signal to the computer (through the flow of electrons) to say (for example) they pressed an "A" and then it types it on the screen.

Source Program and Object Program: The source program is your program (java, c++, log) that you have written your instructions for your computer with. This is the program that we can understand easier. When you are done with your code you then you use either a compiler or interpreter to translate it into Binary code. This is now called the object code. It is your program translated into 0s and 1s.

1 comment:

  1. WOW! Beautiful notes; manifests your participation and enthusiasm for learning.

    ReplyDelete