4.6.2 Classification of Programming Languages Flashcards
Define High level language.
A programming language with a strong abstraction from a processor’s internal instruction set that is much more human readable with natural language keywords, such as Python or Java.
Define Low level language.
A programming language with little to no abstraction from a processor’s internal instruction set, such as machine code or assembly language.
Define Machine Code.
A low level programming language written in binary that is directly understood by the CPU.
Define Assembly Language.
A low level programming language consisting of a set of mnemonic instructions that directly corresponds to the processor architecture’s machine code instruction set.
Advantages of low level languages
- they allow a programmer to create optimized programs
- when a computer system has limited resources, low level languages allow a programmer to more directly control how the resources are used
Disadvantages of low level language
- more difficult to write programs in low level languages than in high level languages -> programmers need to have a very good understanding of the hardware being used
- not portable, they are specific to a particular instruction set
- do not have libraries of functions that can be imported -> programmer has to write every process required for a program themselves
What are some uses low level languages?
- embedded systems, dedicated function, to complete a limited number of specific tasks very efficiently.
- device drivers, programs that allow a computer to interact with a peripheral.
Define Imperative Language.
A programming language built on the programming paradigm of using subroutines and procedures as instructions to change a program’s state and describe how a program operates.
e.g Python, Java, C#, C++
Define Declarative Language.
A programming approach in which coders write code that describes what they want to do and what results they want to achieve, rather than how they will achieve the results.
Characteristics of High level languages
- written in language that is designed to be easily understood by humans
- uses syntax that is similar to human language to form instructions
- a single line of code can accomplish multiple tasks
- allow the programmer to focus on what the program is trying to achieve rather than how the computer or specific hardware operates
- source code is translated into machine code for the computer to process
Advantages of High Level Language.
- Portable: programs can be run on different types of computer after recompiling
- Easier and faster to write
- Easier to debug and maintain programs
Disadvantages of High Level Language.
- Slower speed: Code or program may run slower than assembly or machine code as need to be translated
- More memory storage: Code may occupy more space in RAM
- Unable to manipulate individual bits like machine and assembly code
What is the Opcode and Operand?
Opcode is the actual instruction that is performed. e.g ADD or STR
Operand is the value of the instruction, either the memory location or actual value used to perform calculations shown by a # sign in the front.
What is an addressing mode?
The addressing mode is specified as part of the opcode of an instruction. The addressing mode specifies the way in which the operand will be interpreted.
What are the addressing modes?
- Immediate Addressing: operand interpreted as a value
- Direct Addressing: operand interpreted as a memory address
What is the relationship between assembly code and machine code?
They have a 1 to 1 relationship. Meaning one line in assembly code correlates to one line of machine code.
What is the relationship between assembly code/ machine code to high level language?
They have a 1 to many relationship as one line of high level language is many lines of machine/assembly code.
What are the characteristics of low level language?
- A 1 to 1 relationship with processor instructions
- non portable
- allow for individual control of a processor’s components and registers
- programs typically require less memory and execute faster than a high level language performing the same task.
Advantages of High level language than low level language.
- Have built in functions for programmers to use (libraries), only for high level language
- Easier to write programs in high than low
- Portable, can be translated to run on a wide range of computer architectures, not specific to a particular instruction set
Disadvantage of high level language than low level language
- Programmers not able to directly manipulate the computer’s components and registers, less efficient
- need to be translated to be run
Advantage of low level language than high level language
- more efficient use of resources
- machine code does not need to be translated to be run
Disadvantage of low level than high level
- more difficult to write programs in low level
- not portable
- no libraries