Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Tutorial 1

1. Explain each of the terms in your own words:


a. Translator
b. Interpreter
c. Virtual machine

Answer: A translator is a programming language processor that converts a computer


program from one language to another language to another. It takes a program written in
a source code and converts it into machine code. It discovers and identifies the error
during translation. The main purpose of translator is that it translates the high level
programming language into machine language so that the CPU (Central Processing Unit)
can understand.

An interpreter is a program that executes instructions written in a high level language. It


doesn’t need to compile code into machine language. The interpreter transforms the high-
level program into an intermediate language and then executes, or it could parse the high-
level source code and then performs the commands directly, which is done line by line or
statement by statement.

A Virtual machine is a software computer which runs the operating system and
application. It is an emulation of a computer system. Virtual machines are based
on computer architectures and provide functionality of a physical computer. Their
implementations may involve specialized hardware, software, or a combination.

2. What is the difference between interpretation and translation?


Answer: The differences between interpretation and translation is shown below in the
table
S.N Translation Interpretation
1 A translator is a programming Interpreter is a program that executes
language processor that converts a instructions written in a high level
computer program from one language programming language.
to another language to another.
2 It is in a written form. It is in a verbal form.
3 Translation works on any information Interpretation works on projects involving
in written form like websites, print, live translation like conference and
video subtitles. meeting, live TV coverage, medical
appointment.
4. Translators must capture the content, Interpretation is a much more immediate
style and form of the original text process with no time for second guessing
accurately and precisely and then or wordsmithing.
translate it into the target language.
5. It discovers and identifies the error It detects the error line by line.
during translation

3. Is it conceivable for a compiler to generate output for the microarchitecture level


instead of for the ISA level? Discuss the pros and cons of this proposal.

Answer: It is possible, but there are problems. One difficulty is the large amount of code
produced. Since one ISA instruction does the work of many microinstructions, the
resulting program will be much bigger. Another problem is that the compiler will have to
deal with a more primitive output language, hence it, itself, will become more complex.
Also, on many machines, the microprogram is on ROM. Making it user-changeable
would require putting it in RAM, which is much slower than ROM. On the positive side,
the resulting program might well be much faster, since the overhead of one level of
interpretation would be eliminated.

4. In what sense are hardware and software equivalent? Not equivalent?


Answer: Hardware and software are functionally equivalent. Any function done by one
can, in principle, be done by the other. They are not equivalent in the sense that to make a
computer run the lowest level must be hardware.

5. Name three appliances that are candidates for being run by an embedded CPU?

Answer: The three appliances that are candidates for being run by an embedded CPU are:

 Microwave oven
 Washing machines
 Cordless telephones

6. Suppose that each of the 300 million people in the United States fully consumes two
packages of goods a day bearing RFID tags. How many RFID tags have to be produced
annually to meet that demand? At a penny a tag, what is the total cost of the tags? Given
the size of GDP, is this amount of money going to be an obstacle to their use on every
package offered for sale?

Answer: The given values are calculated below:

Good consume in a single day: 2 package


Good consume in non-leap year: 2*365 = 730 packages

Again,
Good consume by 300 million people is 300*730
= 219000 million packages
= 219 billion packages

7. Provide the building blocks of computer architectures and briefly describe them.

Answer: Computer architecture is often used to refer to an area of specialization within


the academic discipline of computer science.

The building blocks of computer architectures are described below:

 I/O device: The devices which are used to take input and give output the users are
known as I/O devices. Keyboard and monitor are example of I/O device.

 Main memory: main memory actually refers to primary memory of a computer


system that is internal. Main memory can also be referred as RAM (random access
memory).

 Control unit: A control unit or CU is circuitry that directs operations within a


computer's processor. It lets the computer's logic unit, memory, as well as both
input and output devices know how to respond to instructions received from a
program.

 Arithmetic and logical unit: ALU is combinational digital electronic circuit that
performs all the arithmetic and logical operation. ALU has direct input and output
access to the processor controller, main memory and input/output devices.
8. Two basic system designs are shown in Figure (a) and Figure (b). Describe how
input/output might occur in each system. Which one has the potential for better overall
system performance?

(a)

(b)

Answer: In figure a,
9. CPU is one of the most important components for computer system. Describe 3
functional sections of CPU.

Answer: The three functional section of CPU are described below:

 Control unit: A control unit or CU is circuitry that directs operations within a


computer's processor. It lets the computer's logic unit, memory, as well as both
input and output devices know how to respond to instructions received from a
program. It determines which operations or instructions is to be executed next
to coordinates these activities, the control unit uses a system clock which sends
electric signal as it means of communication.

 Arithmetic and logical unit: ALU is combinational digital electronic circuit that
performs all the arithmetic and logical operation that includes addition subtraction,
multiplication and division. ALU has direct input and output access to the
processor controller, main memory and input/output devices.

 Main memory: it refers to physical memory that is internal to the computer. The


word main is used to distinguish it from external mass storage devices such as disk
drives. Other terms used to mean main memory include RAM and primary storage.
The computer can manipulate only data that is in main memory.

10. What is an Operating System and describe its functions?

Answer: An Operating System (OS) is an interface between a computer user and


computer hardware. An operating system is a software which performs all the basic tasks
like file management, memory management, process management, handling input and
output, and controlling peripheral devices such as disk drives and printers.

The function of operating system are:

 Booting: Booting is a process of starting the computer operating system starts the
computer to work. It checks the computer and makes it ready to work.
 Memory Management: It is also an important function of operating system. The
memory cannot be managed without operating system. Different programs and data
execute in memory at one time. if there is no operating system, the programs may
mix with each other. The system will not work properly.
 Data Security: Data is an important part of computer system. The operating system
protects the data stored on the computer from illegal use, modification or deletion.
 Disk Management: Operating system manages the disk space. It manages the stored
files and folders in a proper way.
11. Briefly explain how Operating System handle multiprogramming or multiprocessing.

Answer: Multiprocessing sometimes refers to executing multiple processes (programs) at


the same time. This might be misleading because we have already introduced the term
“multiprogramming” to describe that before.
In fact, multiprocessing refers to the hardware (i.e., the CPU units) rather than
the software (i.e., running processes). If the underlying hardware provides more than one
processor, then that is multiprocessing. Several variations on the basic scheme exist, e.g.,
multiple cores on one die or multiple dies in one package or multiple packages in one
system.
Anyway, a system can be both multiprogrammed by having multiple programs running at
the same time and multiprocessing by having more than one physical processor.

12. Discuss why we need interrupts in Operating System.

Answer: Interrupts are important because they give the user better control over the
computer. Without interrupts, a user may have to wait for a given application to have a
higher priority over the CPU to be ran. This ensures that the CPU will deal with the
process immediately.

You might also like