Module 2 - Program Execution Flashcards
- Which of the follow best matches the function of the Backend in the compilation process?
• Performs syntax rules checking and constructs a symbol table and abstract syntax tree.
• Translates assembly language code into machine code.
• Separates the input source code text into tokens.
• Combines partial programs and libraries into a single executable.
• Performs program analysis and optimization.
• Arranges the symbol table in memory and generates final executable machine code.
Arranges the symbol table in memory and generates final executable machine code.
2. In the compilation process, the \_\_\_\_\_\_ combines partial programs and libraries into a single executable. • Syntax Analyzer (parser) • Assembler • Middle Stage • Lexical Analyzer (lexer) • Backend • Linker
Linker
3. In the compilation process, the \_\_\_\_\_\_ performs program analysis and optimization. • Assembler • Backend • Linker • Lexical Analyzer (lexer) • Syntax Analyzer (parser) • Middle Stage
Middle Stage
4. In the compilation process, the \_\_\_\_\_\_ separates the input source code text into tokens. • Middle Stage • Assembler • Backend • Linker • Syntax Analyzer (parser) • Lexical Analyzer (lexer)
Lexical Analyzer (lexer)
- Which of the follow best matches the definition for Lexical Analysis?
• Performs program analysis and optimization.
• Combines partial programs and libraries into a single executable.
• Separates the input source code text into tokens.
• Performs syntax rules checking and constructs a symbol table and abstract syntax tree.
• Arranges the symbol table in memory and generates final executable machine code.
• Translates assembly language code into machine code.
Separates the input source code text into tokens.
6. Select which of the following are part of the compilation process: • Testing • Code Generation • Lexical Analysis • Optimization • Program Execution • Linking • Syntax Analysis • Debugging
- Code Generation
- Lexical Analysis
- Optimization
- Linking
- Syntax Analysis
- Which of the follow best matches the function of the Middle Stage in the compilation process?
• Performs syntax rules checking and constructs a symbol table and abstract syntax tree.
• Arranges the symbol table in memory and generates final executable machine code.
• Performs program analysis and optimization.
• Combines partial programs and libraries into a single executable.
• Separates the input source code text into tokens.
• Translates assembly language code into machine code.
Performs program analysis and optimization.
8. In the compilation process, the \_\_\_\_\_\_ performs program analysis and optimization. • Lexical Analyzer (lexer) • Assembler • Backend • Linker • Syntax Analyzer (parser) • Middle Stage
Middle Stage
- Which of the follow best matches the function of the Linker in the compilation process?
• Translates assembly language code into machine code.
• Arranges the symbol table in memory and generates final executable machine code.
• Combines partial programs and libraries into a single executable
• Separates the input source code text into tokens.
• Performs program analysis and optimization.
• Performs syntax rules checking and constructs a symbol table and abstract syntax tree.
• Combines partial programs and libraries into a single executable
- Which of the follow best matches the function of the Backend in the compilation process?
• Arranges the symbol table in memory and generates final executable machine code.
• Performs program analysis and optimization.
• Separates the input source code text into tokens.
• Combines partial programs and libraries into a single executable.
• Translates assembly language code into machine code.
• Performs syntax rules checking and constructs a symbol table and abstract syntax tree.
Arranges the symbol table in memory and generates final executable machine code.
11. The \_\_\_\_\_\_ of the CPU coordinates the flow of information around the processor. • Memory • IO / Peripherals • Registers • Control Unit • Bus • Datapath • ALU
Control Unit
12. A computer consists of five major modules. What module does ALU belong to? • Peripheral • Data Path • Control Unit • Memory
Data Path
- Which of the following best matches the definition of the Control Unit?
• Acts as an interface between the processor and the outside world, including long-term storage and user interfaces.
• Contains the ALU and Registers, and the interconnection between them.
• Stores a small number of pieces of information, commonly the temporary results of calculations.
• Stores a large number of pieces of information, including program data and instructions.
• Operates on one or more numerical values to perform calculations and operations on data.
• Carries data between the ALU, registers, memory, and peripherals.
• Coordinates the flow of information around the processor.
Coordinates the flow of information around the processor.
14. If two computers made by different companies have the same machine language, that means they have the same: • Realization • Organization • Architecture • Processor Design
Architecture
15. A computer consists of five major modules. What module do registers belong to? • Data Path • Memory • Peripheral • Control Unit
Data Path
16. If two computers made by the same company have the same transistor design, but different machine language, that means they have the same: • Processor Design • Architecture • Realization • Organization
Realization
17. The \_\_\_\_\_\_ of the CPU stores a small number of pieces of information, commonly the temporary results of calculations. • ALU • Datapath • Control Unit • Bus • IO / Peripherals • Memory • Registers
Registers
18. The \_\_\_\_\_\_ of the CPU coordinates the flow of information around the processor. • IO / Peripherals • ALU • Control Unit • Bus • Registers • Datapath • Memory
Control Unit
- Which of the following best matches the definition of the IO or Peripherals?
• Coordinates the flow of information around the processor.
• Contains the ALU and Registers, and the interconnection between them.
• Carries data between the ALU, registers, memory, and peripherals.
• Stores a large number of pieces of information, including program data and instructions.
• Acts as an interface between the processor and the outside world, including long-term storage and user interfaces.
• Operates on one or more numerical values to perform calculations and operations on data.
• Stores a small number of pieces of information, commonly the temporary results of calculations.
Acts as an interface between the processor and the outside world, including long-term storage and user interfaces.
20. A computer consists of five major modules. What module do registers belong to? • Data Path • Peripheral • Control Unit • Memory
Data Path
21. Select the hardware that is active during the Execute Stage of the instruction cycle: • ALU • Instruction Memory • Data Memory • Program Counter • Control Unit
ALU
- A program consisting of 116 instructions is executing on a simple processor. Each instruction takes 3 cycles to complete. How many clock cycles will it take to execute the program?
348
23. Which of the following are stages in the instruction cycle? • Execute • Decode • Jump • Fetch • Store • Link
Execute
Decode
Fetch
Store
24. Select the hardware that is active during the Store stage of the instruction cycle: • Instruction Memory • Program Counter • Data Memory • ALU • Control Unit
Program Counter
Data Memory
25. Select the hardware that is active during the Fetch Stage of the instruction cycle: • Data Memory • Program Counter • Control Unit • ALU • Instruction Memory
Instruction Memory
Program Counter
25. Select the hardware that is active during the Fetch Stage of the instruction cycle: • Data Memory • Program Counter • Control Unit • ALU • Instruction Memory
Instruction Memory
Program Counter
- A program consisting of 317 instructions is executing on a simple processor. Each instruction takes 3 cycles to complete, with a clock rate of 159 KHz. How long will it take to execute the program? Give your answer in units of milliseconds with at least 1 decimal place of precision
6
28. Which of the following are NOT stages in the instruction cycle? • Jump • Link • Execute • Decode • Fetch • Store
- Jump
* Link
29. Select the hardware that is active during the Decode Stage of the instruction cycle: • Program Counter • Control Unit • Data Memory • Instruction Memory • ALU
Control Unit
Data Memory
30. Select the hardware that is active during the Fetch Stage of the instruction cycle: • Program Counter • Instruction Memory • Data Memory • ALU • Control Unit
Program Counter
Instruction Memory