230
.pdf
keyboard_arrow_up
School
Arizona State University *
*We aren’t endorsed by this school
Course
113
Subject
Computer Science
Date
Jun 9, 2024
Type
Pages
99
Uploaded by GeneralPorcupineMaster370
2.1: Inside the Compiler
0.2 / 0.2 pts
Question 1
Select which of the following are NOT part of the compilation
process:
Program Execution
Correct!
Correct!
Syntax Analysis
Debugging
Correct!
Correct!
Machine Code Generation
Lexical Analysis
Optimization
Testing
Correct!
Correct!
0 / 0.2 pts
Question 2
In the compilation process, the ______ performs program
analysis and optimization.
Linker
Lexical Analyzer (lexer)
Assembler
Middle Stage
rrect Answer
rrect Answer
Syntax Analyzer (parser)
Backend
u Answered
u Answered
0.2 / 0.2 pts
Question 3
Which of the follow best matches the function of the
Backend in the compilation process?
Separates the input source code text into tokens.
Combines partial programs and libraries into a single
executable.
Performs syntax rules checking and constructs a symbol
table and abstract syntax tree.
Performs program analysis and optimization.
Arranges the symbol table in memory and generates final
executable machine code.
Correct!
Correct!
0.2 / 0.2 pts
Question 4
Which of the follow best matches the definition for Syntax
Analysis?
Translates assembly language code into machine code.
Performs program analysis and optimization.
Performs syntax rules checking and constructs a symbol
table and abstract syntax tree.
Correct!
Correct!
Combines partial programs and libraries into a single
executable.
Arranges the symbol table in memory and generates final
executable machine code.
Separates the input source code text into tokens.
0.2 / 0.2 pts
Question 5
In the compilation process, the ______ arranges the symbol
table in memory and generates final executable machine
code.
Linker
Lexical Analyzer (lexer)
Syntax Analyzer (parser)
Backend
Correct!
Correct!
Middle Stage
2.2: Inside a CPU
0.2 / 0.2 pts
Question 1
A computer consists of five major modules. What
module does ALU belong to?
Memory
Control Unit
Data Path
Correct!
Correct!
Peripheral
0.2 / 0.2 pts
Question 2
The ______ of the CPU act(s) as an interface between the
processor and the outside world, including long-term storage
and user interfaces.
ALU
Datapath
Memory
Control Unit
I/O Peripherals
Correct!
Correct!
Registers
0.2 / 0.2 pts
Question 3
Which of the following best matches the definition of the
Registers?
Operates on one or more numerical values to perform
calculations and operations on data.
Contains the ALU and Registers, and the interconnection
between them.
Acts as an interface between the processor and the outside
world, including long-term storage and user interfaces.
Stores a small number of pieces of information, commonly
the temporary results of calculations.
Correct!
Correct!
Stores a large number of pieces of information, including
program data and instructions.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
1-Which of the following is not a part of the overall cost of a programming language?
O Cost of executing programs
O Cost of compilers
O Cost of the host computer
O Cost of training programmers
2-Which of the following is not a primitive data type?
O Boolean
O A single-dimensional array of integers
O Floating point
O Integer
3-A fundamental rule of a subprogram is that
O Each subprogram has a single exit point
O Each subprogram has a single entry point
O Each subprogram has the same entry and exit points
O The number of entry and exit points is arbitrary
arrow_forward
For a compiler's accuracy and efficiency, the following aspects must be considered: Explain.
arrow_forward
Alert dont submit AI generated answer.
arrow_forward
pls help! write a program from the following in assembley language code. you can you the online simulator lc3 https://wchargin.com/lc3web/ .pls help me i am really confused!
arrow_forward
The following criteria should be taken into account by the compiler to ensure its correctness and efficiency: Explain.
arrow_forward
This course covers the compiler overview and testability advice.
arrow_forward
In what ways may compilers be "optimized"? At what point in your career as a programmer would you use one of these? When does it not make any sense to employ such a technology?
arrow_forward
https://www.onlinegdb.com/online_c++_compiler
arrow_forward
It is important for a compiler to take into consideration a variety of elements in order to generate efficient and error-free code. Explain?
arrow_forward
In terms of your professional life, what type of benefits can you anticipate from having knowledge of the compiler?
arrow_forward
Optimization is the fifth stage of the compiler that enhances the performance of code by increasing its speed and reducing the usage of resources.1) Select a portion of code written in a programming language of java and apply four types of optimization techniques on it.2) Explain the applied techniques and their impact on the performance.
Note: The word limit is 250-300 words (without considering the example of code).
arrow_forward
C Compiler Validation
In this activity, you will program your first "Hello World" C program.
Execution
Execute this project according to the following guidelines:
Validate the C compiler is installed:
Start the Ubuntu virtual machine.
Open up the Terminal
Type gcc in the terminal prompt. You might see an error message indicating that 'gcc' is currently not installed.
If 'gcc' is not installed, then run the following commands from the terminal prompt:
sudo apt-get update
sudo apt-get install gcc
Type gcc again in the terminal prompt. You should see that gcc ran, but is looking for input files to compile. This is OK.
Create your first C program:
Open up the Text Editor application.
Type in the following C program:
(image at the bottom)
Save the file as c into your Applications folder created on your desktop.
Compile your program:
Open the Terminal application.
Enter the following command:
gcc HelloWorld.c -oHelloWorld.out
Run a list command (enter ls) from the terminal…
arrow_forward
C++ Language
Please add an execution chart for this code like the example below. I have provided the code and the example execution chart. : JUST NEED EXECUTION CHARTTT. Thanks
Sample Execution Chart Template:
1.0 Main()2.0 CalculatePropertyTax()3.0 displayMessage( input string messageToDisplay)3.1 return double getHomeValue()3.2 return boolean checkHomeValue()3.3 return double applyPropertyTax(input double homeValue)3.4 displayPropertyTax(input homeValue)3.5 return Boolean queryMoreData()4.0 displayMessage(input string messageToDisplay)4.1 return char getYesNo()4.2 return char convertCase(input char)3.6 displayErrorMessage()
CODE:
Maincpp:
#include <iostream>
#include <fstream>
#include "BankAccount.h"
using namespace std;
const int SIZE = 8;
// function declaration for array
void fillArray (ifstream &input,BankAccount accountsArray[]);
int largest(BankAccount accountsArray[]);
int smallest(BankAccount accountsArray[]);
void printArray(BankAccount…
arrow_forward
C++ Language
Please add an execution chart for this code like the example below. I have provided the code and the example execution chart. : JUST NEED EXECUTION CHARTTT. Thanks
Sample Execution Chart Template:
1.0 Main()2.0 CalculatePropertyTax()3.0 displayMessage( input string messageToDisplay)3.1 return double getHomeValue()3.2 return boolean checkHomeValue()3.3 return double applyPropertyTax(input double homeValue)3.4 displayPropertyTax(input homeValue)3.5 return Boolean queryMoreData()4.0 displayMessage(input string messageToDisplay)4.1 return char getYesNo()4.2 return char convertCase(input char)3.6 displayErrorMessage()
CODE:
Maincpp:
#include <iostream>
#include <fstream>
#include "BankAccount.h"
using namespace std;
const int SIZE = 8;
// function declaration for array
void fillArray (ifstream &input,BankAccount accountsArray[]);
int largest(BankAccount accountsArray[]);
int smallest(BankAccount accountsArray[]);
void printArray(BankAccount…
arrow_forward
C++ Language
Please add an execution chart for this code like the example below. I have provided the code and the example execution chart. : JUST NEED EXECUTION CHARTTT. Thanks
Sample Execution Chart Template:
1.0 Main()2.0 CalculatePropertyTax()3.0 displayMessage( input string messageToDisplay)3.1 return double getHomeValue()3.2 return boolean checkHomeValue()3.3 return double applyPropertyTax(input double homeValue)3.4 displayPropertyTax(input homeValue)3.5 return Boolean queryMoreData()4.0 displayMessage(input string messageToDisplay)4.1 return char getYesNo()4.2 return char convertCase(input char)3.6 displayErrorMessage()
CODE:
Maincpp:
#include <iostream>
#include <fstream>
#include "BankAccount.h"
using namespace std;
const int SIZE = 8;
// function declaration for array
void fillArray (ifstream &input,BankAccount accountsArray[]);
int largest(BankAccount accountsArray[]);
int smallest(BankAccount accountsArray[]);
void printArray(BankAccount…
arrow_forward
Which of the following characteristics should be considered by compilers that generate accurate and efficient code? Explain.
arrow_forward
Compilers must consider several things to create proper and efficient code. Explain?
arrow_forward
To what extent is it advantageous to have a functional knowledge of the compiler?
arrow_forward
Which of the following characteristics should be considered by compilers that create accurate and efficient code? Explain.
arrow_forward
نقطة واحدة
Polymorphism process is
* meaning
oop processing O
C++ Exam please be sure
of the solution please
pop processing O
Compile time O
Run time O
compile time and run time O
arrow_forward
How helpful is it to have some understanding of the compiler in practise?
arrow_forward
Find two programming languages that are new to you, and answer the following questions for each:
• When was the language first introduced, and who developed it?
• Why was the language created? What novel about the language?
• Show and describe a fragment of code (in one of these languages) that you think is particularly
interesting, and describe what it does and why it is interesting.
• Is the language still used today for anything?
**You should exclude the following languages from your search: C, C++, C#, Java, Javascript, FORTRAN,
LISP, Pascal, Perl, Python, Racket.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- 1-Which of the following is not a part of the overall cost of a programming language? O Cost of executing programs O Cost of compilers O Cost of the host computer O Cost of training programmers 2-Which of the following is not a primitive data type? O Boolean O A single-dimensional array of integers O Floating point O Integer 3-A fundamental rule of a subprogram is that O Each subprogram has a single exit point O Each subprogram has a single entry point O Each subprogram has the same entry and exit points O The number of entry and exit points is arbitraryarrow_forwardFor a compiler's accuracy and efficiency, the following aspects must be considered: Explain.arrow_forwardAlert dont submit AI generated answer.arrow_forward
- pls help! write a program from the following in assembley language code. you can you the online simulator lc3 https://wchargin.com/lc3web/ .pls help me i am really confused!arrow_forwardThe following criteria should be taken into account by the compiler to ensure its correctness and efficiency: Explain.arrow_forwardThis course covers the compiler overview and testability advice.arrow_forward
- In what ways may compilers be "optimized"? At what point in your career as a programmer would you use one of these? When does it not make any sense to employ such a technology?arrow_forwardhttps://www.onlinegdb.com/online_c++_compilerarrow_forwardIt is important for a compiler to take into consideration a variety of elements in order to generate efficient and error-free code. Explain?arrow_forward
- In terms of your professional life, what type of benefits can you anticipate from having knowledge of the compiler?arrow_forwardOptimization is the fifth stage of the compiler that enhances the performance of code by increasing its speed and reducing the usage of resources.1) Select a portion of code written in a programming language of java and apply four types of optimization techniques on it.2) Explain the applied techniques and their impact on the performance. Note: The word limit is 250-300 words (without considering the example of code).arrow_forwardC Compiler Validation In this activity, you will program your first "Hello World" C program. Execution Execute this project according to the following guidelines: Validate the C compiler is installed: Start the Ubuntu virtual machine. Open up the Terminal Type gcc in the terminal prompt. You might see an error message indicating that 'gcc' is currently not installed. If 'gcc' is not installed, then run the following commands from the terminal prompt: sudo apt-get update sudo apt-get install gcc Type gcc again in the terminal prompt. You should see that gcc ran, but is looking for input files to compile. This is OK. Create your first C program: Open up the Text Editor application. Type in the following C program: (image at the bottom) Save the file as c into your Applications folder created on your desktop. Compile your program: Open the Terminal application. Enter the following command: gcc HelloWorld.c -oHelloWorld.out Run a list command (enter ls) from the terminal…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning