In: Computer Science
Topics 1. Introduction 2. MIPS instruction set architecture (ISA)
Exercise 1 Answer the following questions. (a) List the five classic components of a computer. (b) Describe the steps that transform a program written in a high-level language such as Java into a representation that is directly executed by a computer processor.
(a)
Five Classic components:
1) Datapath
It helps to control and manipulate the data coming through processor.
2) Memory
It helps to store data and hold instructions for currently executing programs.
3) Control
As the name indicates it generates control signals. These signals lead to the operation of Datapath and Memory.
4) Input
It provides input to the processor. Keyboard, Mouse, disks etc are input devices.
5) Output
These are external devices which receive data from processor. Devices like displays, printers, disks are output devices.
(b)
High level languages are converted into Machine language before execution. A computer processor can understand only Machine language. Machine language instructions are encoded as binary numbers, that is zeros and ones.
A java compiler converts the source code into byte code. After compilation a .class file is generated. Eventhough it is similar to Machine language, it is not the actual one. A java class file cannot be directly executed by processor.
A java interpreter is required to run the compiled java bytecode. A java progran is independent of OS. It runs on Java Virtual Machine(JVM).
When a class file is loaded, JIT(Just-in-TIme) compiler convert the loaded bytecode into machine code which is understandable by processor.