Computer Systems pt.2 Flashcards
What is a low level programming language?
A programming language that sits close to the computer’s instruction set e.g. assembly and machine code
What is high level programming language?
A programming language that is close to natural spoken language e.g. Python, Javascript
What is a translator?
A program that converts source code to machine code
What are the 3 types of translators?
Compilers - high level
Assemblers - assembly
Interpreters - high level
What is a compiler?
A program which takes source code, and translates it into machine code all in one go. Once converted, the object code can run unassisted at any time. Will not run unless all errors in the source code are fixed.
What are the advantages and disadvantages of compilers?
File can be run without assistance - A
Can take a long time
Cannot be run if there is an error in the code - D
Errors only shown at the end - D
What is an interpreter?
Converts source code into machine code 1 line at a time. Must be present before a computer program is able to run
What are the advantages and disadvantages of interpreters?
Program runs very slowly - D
Translator must be present before a program is able to run - D
Programmers can identify errors
What is the use of interpreters?
Used during testing/ developing stages, programmers can quickly identify errors and correct them
What is an assembler?
Only used for assembly language - converts assembly mnemonics to machine code
What is assembly language and where is it used?
Often used in embedded systems - set of commands which represent machine code. Often used for controlling hardware components.
It is closely related to machine code
It has a 1:1 correspondence with machine code = 1 instruction in assembly corresponds to one instruction in machine code
Why does every type of processor have its own type of instruction set?
It sets the rules for hardware and software interface, defines what the CPU does and ensure compatibility. Essential when working with application development, assemblers and compilers.
Machine code is specific to the type or family of processors
What are the characteristics of assembly language?
Assembly - programmers can express programs using simple commands, these could be easily translated into machine code. These languages were closely mapped to machine architecture.
They are written for a specific processor.
They are difficult to understand, but programs are incredibly efficient.
What is short code?
The first ever high level language:
Statements were expressed as mathematic expressions rather than machine instructions. Source code was not compiled, but executed through an interpreter every time the program was run.
It is 50 times slower than machine code.
What is source code?
Introduced as computers became more complex and got more memory and faster processor speed, therefore it was now possible for the program to interact with the hardware directly.
Common examples include Python, C# or Javascript.