Programming Languages Flashcards
What are the three generations of programming languages?
First Generation: Machine code, Second Generation: Assembler, Third Generation: Imperative high level programming languages
What does ‘imperative’ mean in the context of high-level programming languages?
Command
What is a key characteristic of high-level programming languages?
Closer to English language, easier to understand
What is the role of a translator in high-level programming languages?
Converts instructions into code that the computer understands
What advantage do high-level programming languages offer regarding processor architecture?
Greater portability
What is one instruction in high-level programming languages mapped to in machine code?
Several machine code instructions
What programming constructs do high-level languages support?
- Sequencing
- Selection
- Iteration
- Assignment
- Functions
How do declarative programming languages operate?
Determine what is to be computed rather than how it is computed
Name three examples of declarative high-level programming languages.
- SQL
- HTML
- CSS
What do low-level programming languages refer to?
Machine code and assembly language
What does ‘low level’ indicate in low-level programming languages?
A low level of abstraction
What can low-level programming languages control?
The hardware of the computer
Why are low-level programming languages considered not portable?
They depend on the architecture of the processor
What are low-level programming languages appropriate for?
- Developing new operating systems
- Embedded systems
- Hardware device drivers
In what format is machine code expressed?
Binary values 0 and 1
What is the language that computers understand?
Machine code
What are the two parts of a machine code instruction?
- Operator
- Operand
What does the processor decode in a machine code instruction?
The operator to identify the task to be carried out
What does the operand in a machine code instruction represent?
The value or memory address that the instruction is to be operated on
Fill in the blank: Machine code instructions are made up of the ______ and the operand.
Operator
Fill in the blank: Machine code is specific to a ______.
Processor
What does assembly language provide?
Basic computer instructions for programs to run
What is the relationship between machine code and assembly code?
One-to-one relationship; one assembly instruction maps to one machine code instruction
How does assembly language differ from machine code in terms of readability?
Assembly language uses names (mnemonics), making it easier for programmers to understand
What is unique about the instruction set of assembly language?
Each type of processor has its own instruction set and assembly language
Fill in the blank: Assembly code developed for one processor architecture will not run on _______.
another
What is a sample instruction to load a value in assembly language?
LOAD #23
What does the instruction ‘MOV a 23’ do?
Transfers the number 23 into the variable a
What does the instruction ‘ADD 2 3’ do?
Adds the two values 2 and 3
What is the purpose of the ‘STORE’ instruction?
Store data in RAM
What is one advantage of low-level languages?
Produces better optimized and more efficient code
In what scenarios are low-level languages appropriate?
Developing new operating systems, embedded systems, and hardware device drivers
What is a disadvantage of low-level languages?
Very difficult to understand and modify
True or False: Assembly code is portable across different computer architectures.
False
Why is writing assembly code time-consuming compared to high-level languages?
There is a one-to-one correspondence with machine code and instruction
What is a disadvantage regarding the availability of compilers or interpreters for low-level languages?
Not always available, particularly for embedded systems
How do high-level languages compare to low-level languages in terms of portability?
High-level languages are more portable across different computer systems
What allows high-level code to be easier to understand?
More abstract and closer to natural language
Fill in the blank: High-level languages take _______ time to write because a single instruction maps to several machine code instructions.
less
What is one reason low-level code runs slower?
Layers of abstraction and inefficiency in the translator