QCM : Understanding Machine, Assembly, and High-Level Languages — 9 questions

Questions et réponses du QCM

1. What is the key characteristic of machine language as described in the source?

It requires an interpreter to execute.
It is independent of CPU architecture.
It is the only language the CPU directly understands.
It is written in symbolic mnemonics for human readability.

It is the only language the CPU directly understands.

Explication

The source explicitly states that 'Machine language is the only language the CPU directly understands,' making it the correct choice. The other options are characteristics of assembly or high-level languages, but they are not the defining feature of machine language according to the source.

2. What is the effect of using symbolic mnemonics in assembly language on the programming process?

It simplifies programming but requires an assembler for conversion.
It makes programming faster because no translation is needed.
It causes assembly language programs to be machine-independent.
It eliminates the need for translation into machine code.

It simplifies programming but requires an assembler for conversion.

Explication

Using symbolic mnemonics in assembly language makes programming more accessible and understandable, but it requires an assembler to convert these mnemonics into the actual machine code that the CPU can execute.

3. What does the term 'high-level languages' primarily refer to?

Languages that directly communicate with the CPU without translation
Languages that are only used for system programming and kernel development
Languages that are closer to human language and abstract hardware details
Languages that are written exclusively in binary code for maximum speed

Languages that are closer to human language and abstract hardware details

Explication

High-level languages are designed to be closer to human language, making programming easier and more abstracted from hardware specifics. They are also portable across various hardware platforms because they are machine-independent, unlike low-level languages which are hardware-dependent.

4. How do compilers and interpreters primarily differ in translating high-level language code?

Compilers are used for low-level programming, while interpreters are used for high-level languages.
Compilers translate the entire program before execution, while interpreters translate and run code line-by-line during execution.
Compilers only check syntax, while interpreters convert code to machine language.
Compilers translate code during execution, whereas interpreters translate the whole program beforehand.

Compilers translate the entire program before execution, while interpreters translate and run code line-by-line during execution.

Explication

The source explicitly states that a compiler translates the entire source code into machine code before execution, creating an executable, whereas an interpreter translates and executes code line-by-line at runtime. This is the primary difference in their translation approach.

5. What is the primary purpose of loading, linking, and relocation in program execution?

To prepare and position programs correctly in memory
To debug and trace program execution
To optimize code performance during runtime
To convert source code into machine code

To prepare and position programs correctly in memory

Explication

Loading, linking, and relocation work together to ensure that programs are correctly prepared and positioned in memory for execution. They do not primarily optimize performance, convert source code, or serve as debugging tools, but focus on arranging the program in memory for proper execution.

6. What is the primary characteristic of a debugger in programming?

It translates high-level code into machine code
It manages program memory allocation
It automates code writing through macros
It controls and inspects program execution

It controls and inspects program execution

Explication

A debugger's main feature is controlling and inspecting program execution, including setting breakpoints and tracing, to help identify and resolve errors.

7. What is the first step an operating system performs to execute a program from disk?

Linking the program with libraries
Initializing hardware components
Loading the program into main memory
Allocating CPU time to the process

Loading the program into main memory

Explication

According to the source, the first step in executing a program is 'loading,' which involves copying the executable from disk into main memory. This step prepares the program for execution by placing it in memory, making it ready for CPU processing.

8. What information is stored in a Process Control Block?

Application source code and documentation
Process state, register values, scheduling information, resource allocations
User credentials and login history
Hardware configuration details

Process state, register values, scheduling information, resource allocations

Explication

The Process Control Block (PCB) contains all necessary information about a process, including its state, register values, scheduling information, and resource allocations, as explicitly mentioned in the source.

9. Which of the following best describes the primary purpose of interprocess communication (IPC) as outlined in the source?

To load programs into main memory for execution
To manage hardware resources directly
To compile high-level code into machine language
To enable data exchange and synchronization between processes

To enable data exchange and synchronization between processes

Explication

The source states that interprocess communication (IPC) is the mechanism that enables data exchange and synchronization between cooperating processes, allowing them to coordinate actions and share information effectively.

Révisez avec les flashcards

Mémorisez les réponses avec 18 flashcards sur Understanding Machine, Assembly, and High-Level Languages.

Machine language — definition?

Binary instructions directly executed by the CPU.

Assembly language — role?

Uses mnemonics to represent machine instructions.

High-Level Languages — advantage?

Portable and easier to program across different hardware.

Voir les flashcards →

Approfondir avec la fiche

Consultez la fiche de révision complète sur Understanding Machine, Assembly, and High-Level Languages.

Voir la fiche →

Cours similaires

Crée tes propres QCM

Importe ton cours et l'IA génère des QCM avec corrections en 30 secondes.

Générateur de QCM