Unit - 1
Introduction to Computer System
Q1) What is a Computer?
A1) A computer is a programmable electronic device that accepts raw data as input and processes it with a set of instructions (a program) to produce the result as output. It renders output just after performing mathematical and logical operations and can save the output for future use. It can process numerical as well as non-numerical calculations. The term "computer" is derived from the Latin word "computare" which means to calculate.
A computer is designed to execute applications and provides a variety of solutions through integrated hardware and software components. It works with the help of programs and represents the decimal numbers through a string of binary digits. It also has a memory that stores the data, programs, and result of processing. The components of a computer such as machinery that includes wires, transistors, circuits, hard disk are called hardware. Whereas, the programs and data are called software.
It is believed that the Analytical Engine was the first computer which was invented by Charles Babbage in 1837. It used punch cards as read-only memory. Charles Babbage is also known as the father of the computer.
The basic parts without which a computer cannot work are as follows:
- Processor: It executes instructions from software and hardware.
- Memory: It is the primary memory for data transfer between the CPU and storage.
- Motherboard: It is the part that connects all other parts or components of a computer.
- Storage Device: It permanently stores the data, e.g., hard drive.
- Input Device: It allows you to communicate with the computer or to input data, e.g., a keyboard.
- Output Device: It enables you to see the output, e.g., monitor.
Definition
Being a modern-day kid you must have used, seen, or read about computers. This is because they are an integral part of our everyday existence. Be it school, banks, shops, railway stations, hospital or your own home, computers are present everywhere, making our work easier and faster for us. As they are such integral parts of our lives, we must know what they are and how they function. Let us start with defining the term computer formally.
The literal meaning of computer is a device that can calculate. However, modern computers can do a lot more than calculate. Computer is an electronic device that receives input, stores or processes the input as per user instructions and provides output in desired format.
Q2) Explain the types of computer?
A2) Types of computers
We can categorize computers in two ways: on the basis of data handling capabilities and size.
On the basis of data handling capabilities, the computer is of three types:
- Analogue Computer
- Digital Computer
- Hybrid Computer
1) Analogue Computer
Analogue computers are designed to process analogue data. Analogue data is continuous data that changes continuously and cannot have discrete values. We can say that analogue computers are used where we don't need exact values always such as speed, temperature, pressure and current.
Analogue computers directly accept the data from the measuring device without first converting it into numbers and codes. They measure the continuous changes in physical quantity and generally render output as a reading on a dial or scale. Speedometer and mercury thermometer are examples of analogue computers.
Advantages of using analogue computers:
- It allows real-time operations and computation at the same time and continuous representation of all data within the rage of the analogue machine.
- In some applications, it allows performing calculations without taking the help of transducers for converting the inputs or outputs to digital electronic form and vice versa.
- The programmer can scale the problem for the dynamic range of the analogue computer. It provides insight into the problem and helps understand the errors and their effects.
Types of analogue computers:
- Slide Rules: It is one of the simplest types of mechanical analogue computers. It was developed to perform basic mathematical calculations. It is made of two rods. To perform the calculation, the hashed rod is slid to line up with the markings on another rod.
- Differential Analysers: It was developed to perform differential calculations. It performs integration using wheel-and-disc mechanisms to solve differential calculations.
- Castle Clock: It was invented by Al-Jarazi. It was able to save programming instructions. Its height was around 11 feet and it was provided with the display of time, the zodiac, and the solar and lunar orbits. This device also could allow users to set the length of the day as per the current season.
- Electronic Analogue Computer: In this type of analogue computer, electrical signals flow through capacitors and resistors to simulate physical phenomena. Here, the mechanical interaction of components does not take place. The voltage of the electrical signal generates the appropriate displays.
2) Digital Computer
Digital computer is designed to perform calculations and logical operations at high speed. It accepts the raw data as input in the form of digits or binary numbers (0 and 1) and processes it with programs stored in its memory to produce the output. All modern computers like laptops, desktops including smartphones that we use at home or office are digital computers.
Advantages of digital computers:
- It allows you to store a large amount of information and to retrieve it easily whenever you need it.
- You can easily add new features to digital systems more easily.
- Different applications can be used in digital systems just by changing the program without making any changes in hardware
- The cost of hardware is less due to the advancement in the IC technology.
- It offers high speed as the data is processed digitally.
- It is highly reliable as it uses error correction codes.
- Reproducibility of results is higher as the output is not affected by noise, temperature, humidity, and other properties of its components.
3) Hybrid Computer
Hybrid computer has features of both analogue and digital computers. It is fast like an analogue computer and has memory and accuracy like digital computers. It can process both continuous and discrete data. It accepts analogue signals and convert them into digital form before processing. So, it is widely used in specialized applications where both analogue and digital data is processed. For example, a processor is used in petrol pumps that converts the measurements of fuel flow into quantity and price. Similarly, they are used in airplanes, hospitals, and scientific applications.
Advantages of using hybrid computers:
- Its computing speed is very high due to the all-parallel configuration of the analogue subsystem.
- It produces precise and quick results that are more accurate and useful.
- It has the ability to solve and manage big equation in real-time.
- It helps in the on-line data processing.
On the basis of size, the computer can be of five types:
1. Micro Computer:
It is a single-user computer which has less speed and storage capacity than the other types. It uses a microprocessor as a CPU. The first microcomputer was built with 8-bit microprocessor chips. The common examples of microcomputers include laptops, desktop computers, personal digital assistant (PDA), tablets, and smartphones. Microcomputers are generally designed and developed for general usage like browsing, searching for information, internet, MS Office, social media, etc.
2. Mini Computer:
Mini-computers are also known as "Midrange Computers." They are not designed for a single. They are multi-user computers designed to support multiple users simultaneously. So, they are generally used by small businesses and firms. Individual departments of a company use these computers for specific purposes. For example, the admission department of a University can use a Mini-computer for monitoring the admission process.
3. Mainframe Computer:
It is also a multi-user computer capable of supporting thousands of users simultaneously. They are used by large firms and government organizations to run their business operations as they can store and process large amounts of data. For example, Banks, universities, and insurance companies use mainframe computers to store the data of their customers, students, and policyholders, respectively.
4. Supercomputer:
Super-computers are the fastest and most expensive computers among all types of computers. They have huge storage capacities and computing speeds and thus can perform millions of instructions per second. The super-computers are task-specific and thus used for specialized applications such as large-scale numerical problems in scientific and engineering disciplines including applications in electronics, petroleum engineering, weather forecasting, medicine, space research and more. For example, NASA uses supercomputers for launching space satellites and monitoring and controlling them for space exploration.
5. Work stations:
It is a single-user computer. Although it is like a personal computer, it has a more powerful microprocessor and a higher-quality monitor than a microcomputer. In terms of storage capacity and speed, it comes between a personal computer and a minicomputer. Work stations are generally used for specialized applications such as desktop publishing, software development, and engineering designs.
Q3) What is the block diagram of a computer?
A3) Computer Block Diagram
Mainly computer system consists of three parts that are central processing unit (CPU), Input Devices, and Output Devices. The Central Processing Unit (CPU) is divided into two parts again: arithmetic logic unit (ALU) and the control unit (CU). The set of instruction is in the form of raw data.
A large amount of data is stored in the computer memory with the help of primary and secondary storage devices. The CPU is like the heart/brain of the computer. The user does not get the desired output, without the necessary option taken by the CPU. The Central processing unit (CPU) is responsible for the processing of all the instructions which are given by the user to the computer system.
Fig 1: Block Diagram of the computer
The data is entered through input devices such as the keyboard, mouse, etc. This set of instruction is processed by the CPU after getting the input by the user, and then the computer system produces the output. The computer can show the output with the help of output devices to the user, such as monitor, printer, etc.
● CPU (Central Processing Unit)
● Storage Unit
● ALU(Arithmetic Logic Unit)
● Control Unit
Central Processing Unit (CPU)
The computer system is nothing without the Central processing Unit so, it is also known as the brain or heat of computer. The CPU is an electronic hardware device which can perform different types of operations such as arithmetic and logical operation.
The CPU contains two parts: the arithmetic logic unit and control unit. We have discussed briefly the arithmetic unit, logical unit, and control unit which are given below:
Fig 2: CPU
Control Unit
The control unit (CU) controls all the activities or operations which are performed inside the computer system. It receives instructions or information directly from the main memory of the computer.
When the control unit receives an instruction set or information, it converts the instruction set to control signals then; these signals are sent to the central processor for further processing. The control unit understands which operation to execute, accurately, and in which order.
Arithmetic and Logical Unit
The arithmetic and logical unit is the combinational digital electronic circuit that can perform arithmetic operations on integer binary numbers.It presents the arithmetic and logical operation. The outputs of ALU will change asynchronously in response to the input. The basic arithmetic and bitwise logic functions are supported by ALU.
Storage Unit
The information or set of guidelines are stored in the storage unit of the computer system. The storage unit provides the space to store the data or instruction of processed data. The information or data is saved or hold in computer memory or storage device. The data storage is the core function and fundamental of the computer components.
Q4) Write the advantages of computers?
A4) Benefits of Using a Computer:
● Increases your productivity: A computer increases your productivity. For example, after having a basic understanding of a word processor, you can create, edit, store, and print the documents easily and quickly.
● Connects to the Internet: It connects you to the internet that allows you to send emails, browse content, gain information, use social media platforms, and more. By connecting to the internet, you can also connect to your long-distance friends and family members.
● Storage: A computer allows you to store a large amount of information, e.g., you can store your projects, ebooks, documents, movies, pictures, songs, and more.
● Organized Data and Information: It not only allows you to store data but also enables you to organize your data. For example, you can create different folders to store different data and information and thus can search for information easily and quickly.
● Improves your abilities: It helps write good English if you are not good at spelling and grammar. Similarly, if you are not good at math, and don't have a great memory, you can use a computer to perform calculations and store the results.
● Assist the physically challenged: It can be used to help the physically challenged, e.g., Stephen Hawking, who was not able to speak used computer to speak. It also can be used to help blind people by installing special software to read what is on the screen.
● Keeps you entertained: You can use the computer to listen to songs, watch movies, play games and more.
Q5) What are the Characteristics of Computers?
A5) The following are the characteristics of the computer system:
- Speed
When it comes to conducting mathematical computations, a computer outperforms humans in terms of speed and accuracy. Millions (1,000,000) of instructions can be processed every second by computers. Microseconds and nanoseconds are the lengths of time that computers take to do their tasks.
2. Accuracy
Computers are 100 percent accurate in their calculations. Data inconsistency or inaccuracy can cause errors.
3. Diligence
A computer can consistently and accurately do millions of jobs or calculations. There are no signs of exhaustion or a lack of concentration. It also has a memory that is superior to that of humans.
4. Memory
Data is stored in primary memory, which is built into a computer. Secondary storage refers to removable media such as CDs, pen drives, and other similar devices that are used to store data.
5. Versatility
Versatility refers to a computer's capacity to do a variety of tasks with the same accuracy and efficiency.
6. Reliability
A computer is dependable because it produces consistent results for similar sets of data, i.e., we will obtain the same result no matter how many times we input the same data.
7. Automation
The computer does all functions automatically, that is, without the need for human interaction.
8. Power of remembering
A computer has the ability to store any quantity of data or information. Any information can be stored and retrieved for as long as you need it, for as many years as you like. How much data you want to store in a computer and when you want to lose or retrieve that data is totally up to you.
9. No IQ
A computer is a dumb machine that can't do anything unless the user tells it to. It follows the instructions at a breakneck pace and with pinpoint accuracy. It is up to you to select what you want to do and how you want to do it. As a result, unlike you, a computer cannot make its own decisions.
10. No Feelings
It lacks sensations and emotions, as well as flavor, knowledge, and experience. As a result, even after long hours of work, it does not become exhausted. It doesn't differentiate between users.
Q6) Write the limitations of computers?
A6) Limitations of Computers
● No IQ - A computer can't react to events that aren't fed or programmed into it. They have no intelligence (Intelligent Quotient). These results are entirely reliant on the user's input. That is, instead of correcting incorrect input, they produce incorrect output.
● No feelings - The computer, on the other hand, may work nonstop. However, just a few tasks necessitate thoughts and proposals. This is only possible if a person has a favourable, negative, or neutral attitude toward the work.
● Lack of Decision Making - A computer is incapable of making decisions on its own. For each operation, the computer is fed an algorithm that allows it to do alternative tasks depending on the situation. However, if it encounters an issue that has not been programmed into the system, the computer will be unprepared. It either becomes corrupt or stops responding.
Humans have knowledge, wisdom, intelligence, the ability to make decisions, and so on. These are not available on computers. They are designed to use logic and algorithms rather than judgement.
● Lack of Common Sense - Even though a computer is an automated mechanism, it still requires human intervention. It only functions if you give it something to do. For example, your math homework requires you to perform calculations. To receive the output, you'll have to feed each sum. The machine is unable to read the entire homework assignment and deliver results.
A spell in MS Word is another example. The computer highlights spelling and grammatical problems with red ink. It cannot, however, rectify it on its own. It also highlights mistakes in proper nouns such as names. Because a computer can only recognise words from a conventional dictionary, this is the case.
● Human dependency - A computer is a machine that, once turned on, is totally automated. However, it is unable to turn itself on. Unless it is fed with such a programme, the computer does not know when to start and stop.
In most instances, some form of human help is essential. It cannot function entirely on its own without human assistance.
● Cannot Implement - A computer can hold a hundred times more information than a human brain. However, it is rendered useless due to a lack of implementation. A computer can store a legal book but not execute it.
It has the capacity to hold hundreds of solutions to various situations. However, it can only tackle problems that are provided to it through algorithms. Humans outperform computers in this area.
Q7) Describe the types of computers?
A7) Types of Computers
Mini computer
It is a midsize multiprocessing computer. It consists of two or more processors and can support 4 to 200 users at one time. Miniframe computers are used in institutes and departments for tasks such as billing, accounting and inventory management.
A minicomputer lies between the mainframe and microcomputer as it is smaller than mainframe but larger than a microcomputer.
Characteristics of minicomputer:
- It is light weight that makes it easy to carry and fit anywhere.
- It is less expensive than mainframe computers.
- It is very fast compared to its size.
- It remains charged for a long time.
- It does not require a controlled operational environment.
Mainframe computer
Mainframe computers are designed to support hundreds or thousands of users simultaneously. They can support multiple programs at the same time. It means they can execute different processes simultaneously. These features of mainframe computers make them ideal for big organizations like banking and telecom sectors, which need to manage and process high volume of data.
Mainframe computers are designed to support hundreds or thousands of users simultaneously. They can support multiple programs at the same time. It means they can execute different processes simultaneously. These features of mainframe computers make them ideal for big organizations like banking and telecom sectors, which need to manage and process a high volume of data that requires integer operations such as indexing, comparisons, etc.
Supercomputer
Supercomputers are the biggest and fastest computers. They are designed to process huge amount of data. A supercomputer can process trillions of instructions in a second. It has thousands of interconnected processors.
Supercomputers are particularly used in scientific and engineering applications such as weather forecasting, scientific simulations and nuclear energy research. The first supercomputer was developed by Roger Cray in 1976.
Microcomputer
Microcomputer is also known as a personal computer. It is a general-purpose computer that is designed for individual use. It has a microprocessor as a central processing unit, memory, storage area, input unit and output unit. Laptops and desktop computers are examples of microcomputers. They are suitable for personal work that may be making an assignment, watching a movie, or at office for office work.
Laptop and Tablet
A microcomputer is another name for it. It is essentially a general-purpose computer that is intended for personal use. It consists of a central processing unit (CPU), memory, input unit, and output unit, as well as a microprocessor. This type of computer is appropriate for personal use, such as writing an assignment or viewing a movie, or for office use, such as office work. Laptops and desktop PCs, for example.
Laptop - It's a portable computer that you can take with you everywhere you go.
A battery-powered portable personal computer small enough to fit on the user's lap. A flip-down screen and a keyboard with a touchpad are included.
Tablet - Modern technology has progressed even farther. It has aided in the development of pocket-sized computers. The best examples of such computers are tablets and cellphones.
Q8) What is assembly language?
A8) Assembly Language
Each personal computer has a microprocessor that manages the computer's arithmetical, logical, and control activities.
Each family of processors has its own set of instructions for handling various operations such as getting input from keyboard, displaying information on screen and performing various other jobs. These set of instructions are called 'machine language instructions'.
A processor understands only machine language instructions, which are strings of 1's and 0's. However, machine language is too obscure and complex for using in software development. So, the low-level assembly language is designed for a specific family of processors that represents various instructions in symbolic code and a more understandable form.
Advantages of Assembly Language
Having an understanding of assembly language makes one aware of −
● How programs interface with OS, processor, and BIOS;
● How data is represented in memory and other external devices;
● How the processor accesses and executes instruction;
● How instructions access and process data;
● How a program accesses external devices.
Other advantages of using assembly language are −
● It requires less memory and execution time;
● It allows hardware-specific complex jobs in an easier way;
● It is suitable for time-critical jobs;
● It is most suitable for writing interrupt service routines and other memory resident programs.
A programming language defines a set of instructions that are compiled together to perform a specific task by the CPU (Central Processing Unit). The programming language mainly refers to high-level languages such as C, C++, Pascal, Ada, COBOL, etc.
Each programming language contains a unique set of keywords and syntax, which are used to create a set of instructions. Thousands of programming languages have been developed till now, but each language has its specific purpose. These languages vary in the level of abstraction they provide from the hardware. Some programming languages provide less or no abstraction while some provide higher abstraction. Based on the levels of abstraction, they can be classified into two categories:
● Low-level language
● High-level language
Q9) Write the difference between machine and assembly language?
A9) Differences between Machine-Level language and Assembly language
The following are the differences between machine-level language and assembly language:
Machine-level language | Assembly language |
The machine-level language comes at the lowest level in the hierarchy, so it has zero abstraction level from the hardware. | The assembly language comes above the machine language means that it has less abstraction level from the hardware. |
It cannot be easily understood by humans. | It is easy to read, write, and maintain. |
The machine-level language is written in binary digits, i.e., 0 and 1. | The assembly language is written in simple English language, so it is easily understandable by the users. |
It does not require any translator as the machine code is directly executed by the computer. | In assembly language, the assembler is used to convert the assembly code into machine code. |
It is a first-generation programming language. | It is a second-generation programming language. |
Q10) Write short notes on high level language?
A10) High-Level Language
The high-level language is a programming language that allows a programmer to write the programs which are independent of a particular type of computer. The high-level languages are considered as high-level because they are closer to human languages than machine-level languages.
When writing a program in a high-level language, then the whole attention needs to be paid to the logic of the problem.
A compiler is required to translate a high-level language into a low-level language.
Advantages of a high-level language
● The high-level language is easy to read, write, and maintain as it is written in English like words.
● The high-level languages are designed to overcome the limitation of low-level language, i.e., portability. The high-level language is portable; i.e., these languages are machine-independent.
Q11) Explain assembler?
A11) Assembler
In computer science, assembler is a program which converts assembly language into machine code. A computer doesn’t understand human languages like English or french, but it deals in a much simpler language called binary language, but a programmer cannot write the whole program with its complexity in a binary language therefore we need a program that can convert the human written language (assembly language) into binary language, these software’s are called assemblers.
In assembler, a programmer can write a program into sequence of assembler instructions, the sequence of assembler instruction is known as source code and source program.
Types of assembler
There area unit 2 kinds of assemblers supported what number passes through the supply area unit required to supply the workable program.
1. One-pass assemblers bear the ASCII text file once. Any image used before it's outlined would require "errata" at the tip of the item code (or, at least, no prior to the purpose wherever the image is defined) telling the linker or the loader to "go back" and write a placeholder that had been left wherever the heretofore indefinite image was used.
2. Multi-pass assemblers produce a table with all symbols and their values within the 1st passes, then use the table in later passes to get code.
In each cases, the assembly program should be ready to confirm the scale of every instruction on the initial passes so as to calculate the addresses of ulterior symbols.
This means that if the scale of associate operation bearing on associate quantity outlined later depends on the kind or distance of the quantity, the assembly program can build a disheartened estimate once 1st encountering the operation, and if necessary pad it with one or additional "no-operation" directions during a later pass or the errata. In associate assembly program with spyhole improvement, addresses is also recalculated between passes to permit exchange disheartened code with code tailored to the precise distance from the target.
The original reason for the utilization of one-pass assemblers was speed of assembly – usually a second pass would need rewinding and rereading a tape or rereading a deck of cards.
With fashionable computers this has ceased to be a difficulty. The advantage of the multi-pass assembly program is that the absence of errata makes the linking method (or the program load if the assembly program directly produces workable code) quicker.
Q12) Write the advantages and disadvantages of assembler?
A12) Advantages of Assembler:
1. in no time in translating programming language to machine language as one to one relationship.
2. Assembly code is commonly terribly economical (and thus fast) as a result of it's an occasional level language.
3. Assembly code is fairly straightforward to know thanks to the utilization of English-like method.
Disadvantages of Assemblers:
1. programming language is written for an exact instruction set and/or processor.
2. Assembly tends to be optimized for the hardware it's designed for, that means it's usually incompatible with totally different hardware.
3. variant assembly code is required to try and do comparatively easy tasks, and sophisticated programs need variant programming time.
Q13) Define interpreter?
A13) Interpreter
An interpreter is also a program like a compiler that converts assembly language into binary but an interpreter goes through one line of code at a time and executes it and then goes on to the next line of the code and then the next and keeps going on until there is an error in the line or the code has completed. It is 5 to 25 times faster than a compiler but it stops at the line where error occurs and then again if the next line has an error too, where as a compiler gives all the errors in the code at once. If changes are made on that code which is already compiled then the changed code will need to be compiled and added to compiled code or the entire code need to be re-compiled.
Also, a compiler saves the machine codes for future use permanently but an interpreter doesn’t, but an interpreter occupies less memory.
Interpreter is differ from compiler such as,
● Interpreter is faster than compiler.
● It contains less memory.
● Interpreter executes the instructions in to source programming language.
There are several types of interpreter:
● Syntax-directed interpreter
● Threaded interpreter
● Bytecode interpreter
In computing, an associate degree interpreter could be a computer virus that directly executes, i.e. performs, directions written during a programming or scripting language, while not antecedently compilation them into a machine language program.
An interpreter could be a program that reads in as input a computer program, along side information for the program, and interprets the computer program instruction by instruction.
Advantages of Interpreter
1. Easier to debug(check errors) than a compiler.
2. Easier to make multi-platform code, as every totally different platform would have associate degree interpreter to run a similar code.
3. helpful for prototyping package and testing basic program logic.
Disadvantages of Interpreter
1. ASCII text file is needed for the program to be dead, and this ASCII text file are often browse creating it insecure.
2. Interpreters are typically slower than compiled programs because of the per-line translation methodology.
Q14) Write the difference between compiler, interpreter and assembler?
A14) Difference between compiler, Interpreter and Assembler
BASIS | COMPILERS | INTERPRETER | ASSEMBLER |
DEFINITION | A compiler is a computer program that converts an entire program written in a high-level language (called source code) and translates it into an executable form (called object code). | An interpreter is a computer program that takes source code and converts each line in succession. | Assembler converts assembly languages to machine code than high-level programs languages. |
INPUT | Compiler Takes Entire program as input | Interpreter Takes Single instruction as input . | Input source program in Assembly Language through an input device. |
MEMORY REQUIREMENT | Memory Requirement : More(Since Object Code is Generated) | Memory Requirement is Less |
|
ERRORS | Errors are displayed after entire program is checked. | Errors are displayed for every instruction interpreted (if any) | Error messages generated during an assembly may originate from the assembler or from a higher level language such as C (many assemblers are written in C) or from the operating system environment |
Q15) Write the difference between primary and secondary memory?
A15) Difference between primary and secondary memory
| Primary Memory | Secondary Memory |
Nature | Can be volatile (RAM) and non-volatile (ROM) | Non-volatile |
Alias | Internal memory | Auxiliary memory |
Price | Typically more pricy than secondary memory | Cheaper than primary memory |
Access | Accessed directly by processing unit | Accessed indirectly, need to be transferred to the primary memory before accessed by CPU |
Accesses | Accessed by the data bus | Accessed by I/O channels |
Formation | Volatile memory won’t retain data | Non-volatile memory will be able to retain data |
Capacity | Usually smaller storage than secondary memory | Has much more power to store data |
Q16) Define RAM and ROM?
A16) RAM
● RAM is used to temporarily store information that is currently in use by the computer. This can include anything from word documents to videos.
● RAM can be read from and written to and so the information stored in RAM can change all the time.
● RAM is a fast memory. Data can be written to and read from RAM very quickly. RAM is generally measured in GB (Gigabytes).
● RAM is Volatile Memory. This means that information stored in RAM is deleted as soon as the computer is turned off.
Fig 3: RAM
RAM is a volatile memory, which means that data and instructions are not stored indefinitely. When you turn on the computer, the operating system (OS) and the program are loaded into RAM, usually from an HDD or SSD, and when you open a program, the operating system (OS) and the program are loaded into RAM, normally from an HDD or SSD. This data is used by the CPU to complete the tasks. The data in the RAM is lost as soon as the machine is turned off. As a result, data remains in RAM as long as the computer is turned on and is lost when it is turned off. Reading data from RAM is substantially faster than reading data from a hard drive, which is one of the advantages of loading data into RAM.
Benefits of RAM
● Directly accessible to the CPU, making processing data faster
● Fast solid state storage, making processing data faster
Drawbacks of RAM
● Relatively expensive memory
● Volatile – any data stored in RAM is lost when power is removed
ROM
ROM, which stands for read only memory, is a memory device or storage medium that stores information permanently. It is also the primary memory unit of a computer along with the random access memory (RAM). It is called read only memory as we can only read the programs and data stored on it but cannot write on it. It is restricted to reading words that are permanently stored within the unit.
Fig 4: ROM
The manufacturer of ROM fills the programs into the ROM at the time of manufacturing the ROM. After this, the content of the ROM can't be altered, which means you can't reprogram, rewrite, or erase its content later. However, there are some types of ROM where you can modify the data.
ROM contains special internal electronic fuses that can be programmed for a specific interconnection pattern (information). The binary information stored in the chip is specified by the designer and then embedded in the unit at the time of manufacturing to form the required interconnection pattern (information). Once the pattern (information) is established, it stays within the unit even when the power is turned off. So, it is a non-volatile memory as it holds the information even when the power is turned off, or you shut down your computer.
The information is added to a RAM in the form of bits by a process known as programming the ROM as bits are stored in the hardware configuration of the device. So, ROM is a Programmable Logic Device (PLD).
A simple example of ROM is the cartridge used in video game consoles that allows the system to run many games. The data which is stored permanently on personal computers and other electronic devices like smartphones, tablets, TV, AC, etc. is also an example of ROM.
For example, when you start your computer, the screen does not appear instantly. It takes time to appear as there are startup instructions stored in ROM which are required to start the computer during the booting process. The work of the booting process is to start the computer. It loads the operating system into the main memory (RAM) installed on your computer. The BIOS program, which is also present in the computer memory (ROM) is used by the microprocessor of the computer to start the computer during the booting process. It allows you to open the computer and connect the computer with the operating system.
ROM is also used to store Firmware, which is a software program which remains attached to the hardware or programmed on a hardware device like a keyboard, hard drive, video cards, etc. It is stored in the flash ROM of a hardware device. It provides instructions to the device to communicate and interact with other devices.
Q17) Describe the types of ROM?
A17) Types of ROM
1) Masked Read Only Memory (MROM):
It is the oldest type of read only memory (ROM). It has become obsolete so it is not used anywhere in today's world. It is a hardware memory device in which programs and instructions are stored at the time of manufacturing by the manufacturer. So it is programmed during the manufacturing process and can't be modified, reprogrammed, or erased later.
The MROM chips are made of integrated circuits. Chips send a current through a particular input-output pathway determined by the location of fuses among the rows and columns on the chip. The current has to pass along a fuse-enabled path, so it can return only via the output the manufacturer chooses. This is the reason the rewriting and any other modification is not impossible in this memory.
2) Programmable Read Only Memory (PROM):
PROM is a blank version of ROM. It is manufactured as blank memory and programmed after manufacturing. We can say that it is kept blank at the time of manufacturing. You can purchase and then program it once using a special tool called a programmer.
In the chip, the current travels through all possible pathways. The programmer can choose one particular path for the current by burning unwanted fuses by sending a high voltage through them. The user has the opportunity to program it or to add data and instructions as per his requirement. Due to this reason, it is also known as the user-programmed ROM as a user can program it.
To write data onto a PROM chip; a device called PROM programmer or PROM burner is used. The process or programming a PROM is known as burning the PROM. Once it is programmed, the data cannot be modified later, so it is also called as one-time programmable device.
Uses: It is used in cell phones, video game consoles, medical devices, RFID tags, and more.
3) Erasable and Programmable Read Only Memory (EPROM):
EPROM is a type of ROM that can be reprogramed and erased many times. The method to erase the data is very different; it comes with a quartz window through which a specific frequency of ultraviolet light is passed for around 40 minutes to erase the data. So, it retains its content until it is exposed to the ultraviolet light. You need a special device called a PROM programmer or PROM burner to reprogram the EPROM.
Uses: It is used in some micro-controllers to store program, e.g., some versions of Intel 8048 and the Freescale 68HC11.
4) Electrically Erasable and Programmable Read Only Memory (EEPROM):
ROM is a type of read only memory that can be erased and reprogrammed repeatedly, up to 10000 times. It is also known as Flash EEPROM as it is similar to flash memory. It is erased and reprogrammed electrically without using ultraviolet light. Access time is between 45 and 200 nanoseconds.
The data in this memory is written or erased one byte at a time; byte per byte, whereas, in flash memory data is written and erased in blocks. So, it is faster than EEPROM. It is used for storing a small amount of data in computer and electronic systems and devices such as circuit boards.
Uses: The BIOS of a computer is stored in this memory.
5) FLASH ROM:
It is an advanced version of EEPROM. It stores information in an arrangement or array of memory cells made from floating-gate transistors. The advantage of using this memory is that you can delete or write blocks of data around 512 bytes at a particular time. Whereas, in EEPROM, you can delete or write only 1 byte of data at a time. So, this memory is faster than EEPROM.
It can be reprogrammed without removing it from the computer. Its access time is very high, around 45 to 90 nanoseconds. It is also highly durable as it can bear high temperature and intense pressure.
Uses: It is used for storage and transferring data between a personal computer and digital devices. It is used in USB flash drives, MP3 players, digital cameras, modems and solid-state drives (SSDs). The BIOS of many modern computers are stored on a flash memory chip, called flash BIOS.
Q18) What is portable hard disc?
A18) A USB-connected pocket storage device that connects to a computer or laptop through a USB connection. Available in two sizes: 2.5 inch and 3.5 inch.
Features
● Interface: Portable hard discs are compatible with USB 2.0 interfaces, and some are compatible with both USB 2.0 and 3.0 interfaces, however the most common interface is USB 2.0. In comparison to USB 2.0, USB 3.0 drives can transport data at a 10 times faster pace.
● Storage capacity: Ranges from 160 GB to 1 TB (1 TB = 1024 GB) of storage.
● Non-volatile storage: When the drives are withdrawn from the USB port or the power is switched off, the contents of the drives are not lost.
● Rotational speed: 5400-7200 RPM (Rotations Per Minute) or higher. The higher the RPM, the faster data can be read, resulting in improved system performance.
● The hard drive is plug-and-play, hot-swappable, and hot-pluggable, making it straightforward and simple to use.
● Because the essential power is obtained from the USB, no additional power supply is required.
● Compatible with all operating systems, including Windows, Mac OS X, and Linux.
● In comparison to a standard hard disc, the price is exorbitant.
Applications
● Secure storage in its own compartment.
● As a back-up plan.
● As though you were cloning a disc.
● Data restoration is possible.
● Data transfer from one computer to another.
Q19) What do you mean by CD and DVD drive?
A19) CD Drive
CD stands for optical disk. CDs area unit circular disks that use optical rays, sometimes lasers, to browse and write knowledge. They're all-time low as you'll get 700 MB of space for storing for fewer than a dollar. CDs area unit inserted in CD drives designed into C.P.U. Cupboard. They're moveable as you'll eject the drive, take away the CD and carry it with you. There area unit 3 kinds of kinds of
- CD-ROM (Compact Disk – browse solely Memory) − the info on these CDs area unit recorded by the manufacturer. Proprietary software package, audio or video area unit free on CD-ROMs.
- CD-WO (Compact Disk – Recordable) − knowledge is written by the user once on the CD-R. It can not be deleted or changed later.
- CD-RW (Compact Disk – Rewritable) − knowledge is written and deleted on these optical disks once more and once more.
DVD Drive
DVD stands for Digital computer screen. Videodisk area unit optical devices which will store fifteen times the info control by CDs. They're sometimes wont to store made multimedia system files that require high storage capability. DVDs additionally are available in 3 varieties – browse solely, recordable and rewritable.
Q20) Explain the types of compilers?
A20) TYPES OF COMPILERS
1. SINGLE PASS COMPILER
● The ability to compile in a very single pass has classically been seen as a profit as a result of it simplifies the duty of writing a compiler and one-pass compilers usually perform compilations quicker than multi-pass compilers.
● Thus, partially driven by the resource limitations of early systems, several early languages were specifically designed in order that they might be compiled in a very single pass (e.g., Pascal).
● In some cases the look of a language feature could need a compiler to perform quite one omit the supply. For example, think about a declaration showing on line twenty of the supply that affects the interpretation of an announcement showing on line ten. During this case, the primary pass has to gather data concerning declarations showing when statements that they have an effect on, with the particular translation happening throughout a future pass.
● The disadvantage of aggregation in a very single pass is that it's unimaginable to perform several of the delicate optimizations required to get top quality code. It is troublesome to count specifically what number passes Associate in Nursing optimizing compiler makes. For example, completely different phases of improvement could analyze one expression over and over however solely analyze another expression once.
● Splitting a compiler up into tiny programs could be a technique employed by researchers curious about manufacturing incontrovertibly correct compilers. Proving the correctness of a collection of tiny programs typically needs less effort than proving the correctness of a bigger, single, equivalent program.
2. MULTI PASS COMPILER
● While the everyday multi-pass compiler outputs computer code from its final pass, there square measure many alternative types:
● A "source-to-source compiler" could be a form of compiler that takes a high level language as its input and outputs a high level language. As an example, Associate in Nursing automatic parallelizing compiler can ofttimes soak up a high level language program as Associate in Nursing input and so rework the code and annotate it with parallel code annotations (e.g. OpenMP) or language constructs (e.g. Fortran's DOALL statements).
3. Progressive COMPILER
● Individual functions is compiled in a very run-time surroundings that additionally includes taken functions. Progressive compilation dates back to 1962 and therefore the 1st LISP compiler, and continues to be utilized in Common Lisp systems.
● Lisp systems
4. STAGE COMPLIER
● The compilers that compiles to programming language of a theoretical machine, like some logic programming implementations.
● This logic programming machine is additionally referred to as the Warren abstract machine (or WAM). Byte-code compilers for Java, Python (and several more) are a subtype of this.
5. JUST IN TIME COMPILER
In computing, just-in-time (JIT) compilation, conjointly referred to as dynamic translation, is compilation done throughout execution of a program – at run time – instead of before execution.
● Most usually this consists of translation to machine language, that is then dead directly, however can even discuss with translation to a different format.
● JIT compilation could be a combination of the 2 ancient approaches to translation to machine language – ahead-of-time compilation (AOT), and interpretation – and combines some blessings and downsides of each.
● JIT compilation combines the speed of compiled code with the pliability of interpretation, with the overhead of associate degree interpreter and therefore the extra overhead of compilation (not simply interpreting).
● JIT compilation could be a style of dynamic compilation, and permits adaptative optimisation like dynamic recompilation – so in theory JIT compilation will yield quicker execution than static compilation. Interpretation and JIT compilation ar notably fitted to dynamic programming languages, because the runtime system will handle late-bound information sorts and enforce security guarantees.