Computer System Overview
1. Difference between RAM and ROM
- RAM (Random Access Memory):
- It is temporary (volatile) memory.
- Data is lost when the computer is turned off.
- Used to store data and programs currently in use.
- Faster in speed.
- ROM (Read Only Memory):
- It is permanent (non-volatile) memory.
- Data is not lost when power is off.
- Stores important instructions like boot programs.
- Slower compared to RAM.
2. What is the purpose of language translator? What are the different types of language translator?
A language translator is a system software that converts a program written in a high-level language or assembly language into machine language (binary code) so that the computer can understand and execute it. It acts as a bridge between the user’s language and the computer’s language.
Types of Language Translators:
There are three main types:
- Assembler
- Converts assembly language programs into machine language.
- Works on low-level instructions.
- Compiler
- Translates the entire HLL program at once into machine code.
- Generates an object/executable file.
- Errors are shown after compilation.
- Interpreter
- Translates and executes the HLL program line by line into machine language.
- Does not create a separate object file.
- Stops execution when an error is found.
3. Difference between Interpreter and Compiler
- Interpreter:
- Translates the program written in HLL into machine language and executes one line at a time (line by line).
- Errors are shown line by line.
- Slower execution.
- During execution Interpreter must be present in memory.
- Example: Python (generally uses an interpreter).
- Compiler:
- Translates the program written in HLL into machine language in one go (entire program at once).
- Shows errors after compiling the whole program.
- Faster execution after compilation.
- Compiler translates the program once and then is not needed in memory to run the compiled program.
- Example: C, C++.
4. Basic Units of a Computer
The basic units of a computer are:
- Input Unit – Takes input from the user (keyboard, mouse).
- Central Processing Unit (CPU) – Processes data. It has:
- ALU (Arithmetic Logic Unit) – Performs calculations and logical operations.
- Control Unit (CU) – Controls and manages all operations.
- Memory Unit – Stores data and instructions (RAM, ROM).
- Output Unit – Displays results (monitor, printer).