Module 2 - Program Execution Flashcards

1
Q
  1. 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.
A

Arranges the symbol table in memory and generates final executable machine code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
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
A

Linker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
3.	In the compilation process, the \_\_\_\_\_\_ performs program analysis and optimization.
•	Assembler
•	Backend
•	Linker
•	Lexical Analyzer (lexer)
•	Syntax Analyzer (parser)
•	Middle Stage
A

Middle Stage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
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)
A

Lexical Analyzer (lexer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. 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.
A

Separates the input source code text into tokens.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
6.	Select which of the following are part of the compilation process:
•	Testing
•	Code Generation
•	Lexical Analysis
•	Optimization
•	Program Execution
•	Linking
•	Syntax Analysis
•	Debugging
A
  • Code Generation
  • Lexical Analysis
  • Optimization
  • Linking
  • Syntax Analysis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. 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.
A

Performs program analysis and optimization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
8.	In the compilation process, the \_\_\_\_\_\_ performs program analysis and optimization.
•	 Lexical Analyzer (lexer)
•	Assembler
•	Backend
•	Linker
•	Syntax Analyzer (parser)
•	Middle Stage
A

Middle Stage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. 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.
A

• Combines partial programs and libraries into a single executable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. 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.
A

Arranges the symbol table in memory and generates final executable machine code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
11.	The \_\_\_\_\_\_ of the CPU coordinates the flow of information around the processor.
•	Memory
•	IO / Peripherals
•	Registers
•	Control Unit
•	Bus
•	Datapath
•	ALU
A

Control Unit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
12.	A computer consists of five major modules. What module does ALU belong to?
•	Peripheral
•	Data Path
•	Control Unit
•	Memory
A

Data Path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. 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.
A

Coordinates the flow of information around the processor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
14.	If two computers made by different companies have the same machine language, that means they have the same:
•	Realization
•	Organization
•	Architecture
•	Processor Design
A

Architecture

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
15.	A computer consists of five major modules. What module do registers belong to?
•	Data Path
•	Memory
•	Peripheral
•	Control Unit
A

Data Path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
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
A

Realization

17
Q
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
A

Registers

18
Q
18.	The \_\_\_\_\_\_ of the CPU coordinates the flow of information around the processor.
•	IO / Peripherals
•	ALU
•	Control Unit
•	Bus
•	Registers
•	Datapath
•	Memory
A

Control Unit

19
Q
  1. 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.
A

Acts as an interface between the processor and the outside world, including long-term storage and user interfaces.

20
Q
20.	A computer consists of five major modules. What module do registers belong to?
•	Data Path
•	Peripheral
•	Control Unit
•	Memory
A

Data Path

21
Q
21.	Select the hardware that is active during the Execute Stage of the instruction cycle:
•	  ALU
•	  Instruction Memory
•	  Data Memory
•	  Program Counter
•	  Control Unit
A

ALU

22
Q
  1. 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?
A

348

23
Q
23.	Which of the following are stages in the instruction cycle?
•	  Execute
•	  Decode
•	  Jump
•	  Fetch
•	  Store
•	  Link
A

Execute
Decode
Fetch
Store

24
Q
24.	Select the hardware that is active during the Store stage of the instruction cycle:
•	  Instruction Memory
•	  Program Counter
•	  Data Memory
•	  ALU
•	  Control Unit
A

Program Counter

Data Memory

25
Q
25.	Select the hardware that is active during the Fetch Stage of the instruction cycle:
•	  Data Memory
•	  Program Counter
•	  Control Unit
•	  ALU
•	  Instruction Memory
A

Instruction Memory

Program Counter

26
Q
25.	Select the hardware that is active during the Fetch Stage of the instruction cycle:
•	  Data Memory
•	  Program Counter
•	  Control Unit
•	  ALU
•	  Instruction Memory
A

Instruction Memory

Program Counter

27
Q
  1. 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
A

6

28
Q
28.	Which of the following are NOT stages in the instruction cycle?
•	  Jump
•	  Link
•	  Execute
•	  Decode
•	  Fetch
•	  Store
A
  • Jump

* Link

29
Q
29.	Select the hardware that is active during the Decode Stage of the instruction cycle:
•	  Program Counter
•	  Control Unit
•	  Data Memory
•	  Instruction Memory
•	  ALU
A

Control Unit

Data Memory

30
Q
30.	Select the hardware that is active during the Fetch Stage of the instruction cycle:
•	  Program Counter
•	  Instruction Memory
•	  Data Memory
•	  ALU
•	  Control Unit
A

Program Counter

Instruction Memory