CompSci notes2

CompSci notes2 - 28 September 2011 Computer Languages The...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
28 September 2011 Computer Languages The hardware of a computer cannot do anything without a program, or the software Computer Program: a to-do list of machine instructions for the CPU to carry out and execute one at a time in the given order. Computer Programmer: responsible for making the to-do list. Needs to put the instructions in the proper order to get the desired result. Hierarchy of Languages Machine Code (binary language) Computers understand this language. Ex: 0000001110010101001101010…. Even for a small task ^ is difficult to implement It is possible to create a program using this, but not easy. Assembly Language (low-level language) The first artificial programming languages that was developed. Use symbols and codes to represent each machine language instruction. Ex. ADD $1, 14 MOV $2, 6 This is easier than machine code, but still not easy Assembler: converts assembly language code into the underlying machine language High-level Languages (HLL) Java, C++, C, COBOL, Pascal, etc. .. Machine-independent, sophisticated programming languages that use familiar English- like syntax. Even if you don’t know the language, it is easy to read and understand a high level language Translators Once a program is created using a HLL, it must be turned back to machine code to that the CPU understands it. This is where a translator is used. There are 2 types of translators Interpreter: Takes the HLL and translates it to machine code ONE LINE AT A TIME. The code is executed before the next line is translated Com pile r: Takes the HLL and translates it to machine code ALL AT ONCE. No code is executed until the entire file is translated. Which is better? Depends…. Interpreter: downfall is that it is slower but it does make it easier to see the mistakes while executing Compiler: although it is very fast it is harder to pinpoint your mistake Computer Languages The hardware of a computer cannot do anything without a program, or the software Computer Program: a to-do list of machine instructions for the CPU to carry out and execute one at a time in the given order. Computer Programmer: responsible for making the to-do list. Needs to put the instructions in the proper order to get the desired result.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Hierarchy of Languages Machine Code (Binary Level) o Computer s understand this language. Ex 001010000101010101011111010101 o Even for a small task, these are difficult to implement. o
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

CompSci notes2 - 28 September 2011 Computer Languages The...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online