Unit - 1
Introduction to Computer System
What is a Computer?
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.
Characteristics of Computer
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.
Input-Process-Output Model
Computer input is called data and the output obtained after processing it, based on the user's instructions is called information. Raw facts and figures which can be processed using arithmetic and logical operations to obtain information are called data.
The processes that can be applied to data are of two types −
● Arithmetic operations− Examples include calculations like addition, subtraction, differentials, square root, etc.
● Logical operations− Examples include comparison operations like greater than, less than, equal to, opposite, etc.
Booting
Starting a computer or a computer-embedded device is called booting. Booting takes place in two steps −
● Switching on power supply
● Loading operating system into computer’s main memory
● Keeping all applications in a state of readiness in case needed by the user
The first program or set of instructions that run when the computer is switched on is called BIOS or Basic Input Output System. BIOS is a firmware, i.e. a piece of software permanently programmed into the hardware.
If a system is already running but needs to be restarted, it is called rebooting. Rebooting may be required if a software or hardware has been installed or system is unusually slow.
There are two types of booting −
● Cold Booting− When the system is started by switching on the power supply it is called cold booting. The next step in cold booting is loading of BIOS.
● Warm Booting− When the system is already running and needs to be restarted or rebooted, it is called warm booting. Warm booting is faster than cold booting because BIOS is not reloaded.
The computer has become a part of our life. There are plenty of things that we do in a day are dependent on a computer. Some of the common examples are as follows:
- ATM: While withdrawing cash from an ATM, you are using a computer that enables the ATM to take instructions and dispense cash accordingly.
- Digital currency: A computer keeps a record of your transactions and balance in your account and the money deposited in your account in a bank is stored as a digital record or digital currency.
- Trading: Stock markets use computers for day-to-day trading. There are many advanced algorithms based on computers that handle trading without involving humans.
- Smartphone: The smartphone that we use throughout the day for calling, texting, browsing is itself a computer.
- VoIP: All voice over IP communication (VoIP) is handled and done by computers.
Types of Computers
We can categorize computer 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 minicomputer. Work stations are generally used for specialized applications such as desktop publishing, software development, and engineering designs.
Functional Units
- A computer organization describes the functions and design of the various units of a digital system.
- A general-purpose computer system is the best-known example of a digital system. Other examples include telephone switching exchanges, digital voltmeters, digital counters, electronic calculators and digital displays.
- Computer architecture deals with the specification of the instruction set and the hardware units that implement the instructions.
- Computer hardware consists of electronic circuits, displays, magnetic and optic storage media and also the communication facilities.
- Functional units are a part of a CPU that performs the operations and calculations called for by the computer program.
- Functional units of a computer system are parts of the CPU (Central Processing Unit) that performs the operations and calculations called for by the computer program. A computer consists of five main components namely, Input unit, Central Processing Unit, Memory unit Arithmetic & logical unit, Control unit and an Output unit.
Fig 1: Process state
Input unit
- Input units are used by the computer to read the data. The most commonly used input devices are keyboards, mouse, joysticks, trackballs, microphones, etc.
- However, the most well-known input device is a keyboard. Whenever a key is pressed, the corresponding letter or digit is automatically translated into its corresponding binary code and transmitted over a cable to either the memory or the processor.
Central processing unit
- Central processing unit commonly known as CPU can be referred as an electronic circuitry within a computer that carries out the instructions given by a computer program by performing the basic arithmetic, logical, control and input/output (I/O) operations specified by the instructions.
Memory unit
- The Memory unit can be referred to as the storage area in which programs are kept which are running, and that contains data needed by the running programs.
- The Memory unit can be categorized in two ways namely, primary memory and secondary memory.
- It enables a processor to access running execution applications and services that are temporarily stored in a specific memory location.
- Primary storage is the fastest memory that operates at electronic speeds. Primary memory contains a large number of semiconductor storage cells, capable of storing a bit of information. The word length of a computer is between 16-64 bits.
- It is also known as the volatile form of memory, means when the computer is shut down, anything contained in RAM is lost.
- Cache memory is also a kind of memory which is used to fetch the data very soon. They are highly coupled with the processor.
- The most common examples of primary memory are RAM and ROM.
- Secondary memory is used when a large amount of data and programs have to be stored for a long-term basis.
- It is also known as the Non-volatile memory form of memory, means the data is stored permanently irrespective of shut down.
- The most common examples of secondary memory are magnetic disks, magnetic tapes, and optical disks.
Arithmetic & logical unit
- Most of all the arithmetic and logical operations of a computer are executed in the ALU (Arithmetic and Logical Unit) of the processor. It performs arithmetic operations like addition, subtraction, multiplication, division and also the logical operations like AND, OR, NOT operations.
Control unit
- The control unit is a component of a computer's central processing unit that coordinates the operation of the processor. It tells the computer's memory, arithmetic/logic unit and input and output devices how to respond to a program's instructions.
- The control unit is also known as the nerve centre of a computer system.
- Let's us consider an example of addition of two operands by the instruction given as Add LOCA, RO. This instruction adds the memory location LOCA to the operand in the register RO and places the sum in the register RO. This instruction internally performs several steps.
Output Unit
- The primary function of the output unit is to send the processed results to the user. Output devices display information in a way that the user can understand.
- Output devices are pieces of equipment that are used to generate information or any other response processed by the computer. These devices display information that has been held or generated within a computer.
- The most common example of an output device is a monitor.
Key takeaways:
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.
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.
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 2: 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 3: 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.
Components of Computer System
The hardware and software exist on the computer. The information which is stored through the device is known as computer software. The hardware components of the computer system are related to electronic and mechanical parts, and the software component is related to data and computer programs. Many elements are connected to the main circuit board of the computer system called a “motherboard.”
Fig 4: Components of computer system
● Processor.
● Main Memory.
● Secondary Memory.
● Input Devices.
● Output Devices.
These are mainly five components of the computer system. The computer hardware, computer software, and liveware exist in the element of the computer system.
Processor
The processor is an electric circuitry within the computer system. The Central processing unit is the central processor or main processor of the computer system. The processor carries out the instructions of the computer program with the help of basic arithmetic and logic, input/output operations.
Main Memory
The Random Access Memory is the main memory of the computer system, which is known as RAM. The main memory can store the operating system software, application software, and other information. The Ram is one of the fastest memory, and it allows the data to be readable and writeable.
Secondary memory
We can store the data and programs on a long-term basis in the secondary memory. The hard disks and the optical disks are the common secondary devices. It is slow and cheap memory as compare to primary memory. This memory is not connected to the processor directly.
It has a large capacity to store the data. The hard disk has a capacity of 500 gigabytes. The data and programs on the hard disk are organized into files, and the file is the collection of data on the disk. The secondary storage is direct access by the CPU; that’s why it is different from the primary storage.
The hard disk is about 100 times the capacity of the main memory. The main difference between primary and secondary storage is speed and capacity. There are several large blocks of data which are copied from the hard disk into the main memory.
Input Devices
The user provides the set of instruction or information to the computer system with the help of input devices such as the keyboard, mouse, scanner, etc. The data representation to the computer system is in the form of binary language after that the processor processes the converted data. The input unit implements the data which is instructed by the user to the system.
We can enter the data from the outside world into the primary storage as the input through input devices. The input devices are the medium of communication between the outside world and the computer system. There are some important features of input devices which are given below:
- The input devices receive or accept the data or instruction from the user, who exist in the outside world.
- These devices convert the data or instruction into the machine-readable form for further processing.
- The input device performs like the connection between the outside world and our computer system.
- The keyboard and mouse are common examples of input devices.
- When the whole procedure is finished, we get the desired output from the output devices such as monitor, printer, etc.
Output Devices
The output devices produce or generate the desired result according to our input, such as a printer, monitor, etc. These devices convert the data into a human-readable form from binary code.
The computer system is linked or connected to the outside world with the help of output devices. The primary examples of output devices are a printer, projector, etc. These devices have various features which are given below:
- These devices receive or accept the data in the binary form.
- The output devices convert the binary code into the human-readable form.
- These devices produce the converted result and show to the user.
Limitations of Computer
● 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.
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.
Disadvantages of Using Computer
Despite so many advantages, computers have some disadvantages of their own −
● Computers have no intelligence; they follow the instructions blindly without considering the outcome.
● Regular electric supply is necessary to make computers work, which could prove difficult everywhere especially in developing nations.
Minicomputer
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.
Applications of minicomputers:
A minicomputer is mainly used to perform three primary functions, which are as follows:
- Process control: It was used for process control in manufacturing. It mainly performs two primary functions that are collecting data and feedback. If any abnormality occurs in the process, it is detected by the minicomputer and necessary adjustments are made accordingly.
- Data management: It is an excellent device for small organizations to collect, store and share data. Local hospitals and hotels can use it to maintain the records of their patients and customers respectively.
- Communications Portal: It can also play the role of a communication device in larger systems by serving as a portal between a human operator and a central processor or computer.
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.
Characteristics of Mainframe Computers:
- It can process huge amount of data, e.g., millions of transactions in a second in the banking sector.
- It has a very long life. It can run smoothly for up to 50 years after proper installation.
- It gives excellent performance with large scale memory management.
- It has the ability to share or distribute its workload among other processors and input/output terminals.
- There are fewer chances of error or bugs during processing in mainframe computers. If any error occurs it can fix it quickly without affecting the performance.
- It has the ability to protect the stored data and other ongoing exchange of information and data.
Applications of mainframe computers:
- In health care, it enabled hospitals to maintain a record of their millions of patients in order to contact them for treatment or related to their appointment, medicine updates or disease updates.
- In the field of defence, it allows the defence departments to share a large amount of sensitive information with other branches of defence.
- In the field of education, it helps big universities to store, manage and retrieve data related to their courses, admissions, students, teachers, employees and affiliated schools and colleges.
- In the retail sector, the retail companies that have a huge customer base and branches use mainframe computers to handle and execute information related to their inventory management, customer management, and huge transactions in a short duration.
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.
Characteristics or applications of supercomputers:
- It has the ability to decrypt your password to enhance protection for security reasons.
- It produces excellent results in animations.
- It is used for virtual testing of nuclear weapons and critical medical tests.
- It can study and understand climate patterns and forecast weather conditions. It can run in NOAA's system (National Oceanic and Atmospheric Administration) that can execute any type of simple and logical data.
- It helps in designing the flight simulators for pilots at the beginner level for their training.
- It helps in extracting useful information from data storage centres or cloud system. For example, in insurance companies.
- It has played a vital role in managing the online currency world such as stock market and bitcoin.
- It helps in the diagnosis of various critical diseases and in producing accurate results in brain injuries, strokes, etc.
- It helps in scientific research areas by accurately analysing data obtained from exploring the solar system, satellites, and movement of Earth.
- It also used in a smog control system where it predicts the level of fog and other pollutants in the atmosphere.
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.
Characteristics of a microcomputer:
- It is the smallest in size among all types of computers.
- A limited number of software can be used.
- It is designed for personal work and applications. Only one user can work at a time.
- It is less expansive and easy to use.
- It does not require the user to have special skills or training to use it.
- Generally, comes with single semiconductor chip.
- It is capable of multitasking such as printing, scanning, browsing, watching videos, etc.
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.
Fig 5: Laptop
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 cell phones.
Fig 6: Tablet
Characteristics
● Only a few types of software can be employed in this situation.
● It's the tiniest of the bunch.
● It's intended for personal use only.
● It's simple to use.
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
The image which is given below describes the abstraction level from hardware. As we can observe from the below image that the machine language provides no abstraction, assembly language provides less abstraction whereas high-level language provides a higher level of abstraction.
Low-level language
The low-level language is a programming language that provides no abstraction from the hardware, and it is represented in 0 or 1 forms, which are the machine instructions. The languages that come under this category are the Machine level language and Assembly language.
Machine-level language
The machine-level language is a language that consists of a set of instructions that are in the binary form 0 or 1. As we know that computers can understand only machine instructions, which are in binary digits, i.e., 0 and 1, so the instructions given to the computer can be only in binary codes.
Creating a program in a machine-level language is a very difficult task as it is not easy for the programmers to write the program in machine instructions. It is error-prone as it is not easy to understand, and its maintenance is also very high. A machine-level language is not portable as each computer has its machine instructions, so if we write a program in one computer will no longer be valid in another computer.
The different processor architectures use different machine codes, for example, a PowerPC processor contains RISC architecture, which requires different code than intel x86 processor, which has a CISC architecture.
Assembly Language
The assembly language contains some human-readable commands such as mov, add, sub, etc. The problems which we were facing in machine-level language are reduced to some extent by using an extended form of machine-level language known as assembly language. Since assembly language instructions are written in English words like mov, add, sub, so it is easier to write and understand.
As we know that computers can only understand the machine-level instructions, so we require a translator that converts the assembly code into machine code. The translator used for translating the code is known as an assembler.
The assembly language code is not portable because the data is stored in computer registers, and the computer has to know the different sets of registers.
The assembly code is not faster than machine code because the assembly language comes above the machine language in the hierarchy, so it means that assembly language has some abstraction from the hardware while machine language has zero abstraction.
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. |
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.
Types of high level languages
The high-level programming languages can be categorized into different types on the basis of the application area in which they are employed as well as the different design paradigms supported by them. The high-level programming languages are designed for use in a number of areas. Each high-level language is designed by keeping its target application area in mind. Some of the high-level languages are best suited for business domains, while others are apt in the scientific domain only.
The high-level language can be categorized on the basis of the various programming paradigms approved by them. The programming paradigms refer to the approach employed by the programming language for solving the different types of problem.
1. Categorisation based on Application
On the basis of application area the high level language can be divided into the following types:
i) Commercial languages
These programming languages are dedicated to the commercial domain and are specially designed for solving business-related problems. These languages can be used in organization for processing handling the data related to payroll, accounts payable and tax building applications. COBOL is the best example of the commercial based high-level programming language employed in the business domain.
Ii) Scientific languages
These programming languages are dedicated to the scientific domain and are specially designed for solving different scientific and mathematical problems. These languages can be used to develop programs for performing complex calculation during scientific research. FORTRAN is the best example of scientific based language.
Iii) Special purpose languages
These programming languages are specially designed for performing some dedicated functions. For example, SQL is a high-level language specially designed to interact with the database programs only. Therefore we can say that the special purpose high-level language is designed to support a particular domain area only.
Iv) General purpose languages
These programming languages are used for developing different types of software application regardless of their application area. The various examples of general purpose high-level programming languages are BASIC, C, C++, and java.
2. Categorisation based on Design paradigm
On the basis of design paradigms the high level programming languages can be categorised into the following types:
i) Procedure-oriented languages
These programming languages are also called an imperative programming language. In this language, a program is written as a sequence of procedures. Each procedure contains a series of instruction for performing a specific task. Each procedure can be called by the other procedures during the program execution.
In this type of programming paradigms, a code once written in the form of a procedure can be used any number of times in the program by only specifying the corresponding procedure name. Therefore the procedure-oriented language allows the data to move freely around the system. The various examples of procedure-oriented language are FORTRAN, ALGOL, C, BASIC, and ADA.
Ii) Logic-oriented languages
These languages use logic programming paradigms as the design approach for solving various computational problems. In this programming paradigms predicate logic is used to describe the nature of a problem by defining the relationship between rules and facts. Prolog is the best example of the logic-oriented programming language.
Iii) Object-oriented languages
These languages use object-oriented programming paradigms as the design approach for solving a given problem. In this programming language, a problem is divided into a number of objects which can interact by passing messages to each other. C++ and C# are the examples of object-oriented programming language.
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 can not 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.
ASSEMBLERS
A computer program interprets programing language into machine language.
A computer program could be a program that makes code by translating combos of method and syntax for operations and addressing modes into their numerical equivalents.
Assembly language
● It consists of method for machine opcodes thus assemblers perform a 1:1 translation from mnemotechnical to an on the spot instruction.
● An programing language (or computer program language) could be a low-level programing language for a pc, or different programmable device, during which there's a really sturdy (generally one-to-one) correspondence between the language and therefore the architecture's machine language directions.
● Each programing language is particular to a selected pc design, in distinction to most high-level programming languages, that ar typically transportable across multiple architectures, however need deciphering or compilation.
● Assembly language is reborn into practicable machine language by a utility mentioned as associate degree assembler; the conversion method is mentioned as assembly, or collecting the code.
For example:
LDA #4 converts to 0001001000100100
Conversely, one instruction during a high level language can translate to 1 or additional directions at machine level.
TYPES OF ASSEMBLERS
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.
APPLICATIONS OF ASSEMBLERS
1. Programming language is usually employed in a system's boot code, the low-level code that initializes and tests the system hardware before booting the software package and is commonly keep inROM. (BIOS on IBM-compatible laptop systems associated CP/M is an example.)
2. Some compilers translate high-level languages into assembly 1st before totally assembling, permitting the assembly code to be viewed for debugging and improvement functions.
3. Comparatively low-level languages, such as C, enable the coder to plant programming language directly within the ASCII text file. Programs victimisation such facilities, like the UNIX kernel, will then construct abstractions victimisation totally different programming language on every hardware platform. The system's moveable code will then use these processor-specific elements through a standardized interface.
4. Programming language is helpful in reverse engineering. Several programs area unit distributed solely in machine language type that is simple to translate into programming language, however harder to translate into a higher-level language. Tools like the Interactive Disassembler build in depth use of dismantlement for such a purpose.
5. Assemblers will be wont to generate blocks of information, with no problem-oriented language overhead, from formatted and commented ASCII text file, to be employed by different code.
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 optimised 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.
Compiler
A Compiler is a program that converts a number of statements of program into binary language, but it is more intelligent than interpreter because it goes through the entire code at once and can tell the possible errors and limits and ranges. But this makes its operating time a little slower.it is platform-dependent. Its help to detect error and get displayed after reading the entire code by compiler.
In other words we can say that, “Compilers turns the high level language to binary language or machine code at only time once”, it is known as Compiler.
COMPILERS
A compiler may be a worm (or set of programs) that transforms ASCII text file written in an exceedingly artificial language (the supply language) into another computer-oriented language (the target language, typically having a binary kind called object code).
The most common reason for changing a ASCII text file is to form associate feasible program.
The name "compiler" is primarily used for programs that translate ASCII text file from a high-level artificial language to a lower level language (e.g., programing language or machine code).
If the compiled program will run on a laptop whose electronic equipment or package is completely different from the one on that the compiler runs, the compiler is understood as a cross-compiler. Additional usually, compilers area unit a selected sort of translators.
A program that interprets from an occasional level language to a better level one may be a decompiler.
A program that interprets between high-level languages is sometimes known as a source-to-source compiler or transpiler.
A language redact is sometimes a program that interprets the shape of expressions while not a modification of language.
The term compiler-compiler is usually wont to see a computer program generator, a tool typically wont to facilitate produce the lexer and computer program.
A compiler is probably going to perform several or all of the subsequent operations:
1. Lexical analysis,
2. Preprocessing,
3. Parsing,
4. Linguistics analysis (syntax-directed translation),
5. Code generation, and code optimisation.
Program faults caused by incorrect compiler behavior is terribly tough to trace down and work around; so, compiler implementors invest vital effort to confirm compiler correctness.
Compilers enabled the event of programs that area unit machine-independent.
Before the event of FORTRAN, the primary higher-level language, within the Nineteen Fifties, machine-dependentassembly language was wide used.
While programing language produces additional abstraction than machine language on constant design, even as with machine language, it's to be changed or rewritten if the program is to be dead on completely different component design.
With the arrival of high-level programming languages that followed FORTRAN, like COBOL, C, and BASIC, programmers may write machine-independent supply programs. A compiler interprets the high-level supply programs into target programs in machine languages for the precise hardware. Once the object program is generated, the user will execute the program.
STRUCTURE OF COMPILER
Compilers bridge supply programs in high-level languages with the underlying hardware.
A compiler verifies code syntax, generates economical code, performs run-time organization, and formats the output in line with program and linker conventions.
A compiler consists of:
1.THE face
● It verifies syntax and linguistics, associated generates an intermediate illustration or IR of the ASCII text file for process by the middle-end.
● Performs sort checking by assembling sort info.
● Generates errors and warning, if any, in an exceedingly helpful approach.
● Aspects of the face embrace lexical analysis, syntax analysis, and linguistics analysis.
● The compiler frontend analyzes the ASCII text file to create an inside illustration of the program, known as the intermediate illustration or IR.
● It additionally manages the image table, {a data|acknowledge|an info} structure mapping every image within the ASCII text file to associated information like location, sort and scope.
● While the frontend is one monolithic perform or program, as in an exceedingly scannerless computer program, it's additional usually enforced and analyzed as many phases, which can execute consecutive or at the same time.
● In some cases further phases area unit used, notably line reconstruction and preprocessing, however these area unit rare.
● A careful list of potential phases includes:
1. Line reconstruction:
● Languages that strop their keywords or permit capricious areas inside identifiers need a part before parsing, that converts the input character sequence to a canonical kind prepared for the computer program.
● The top-down, recursive-descent, table-driven parsers employed in the Sixties generally scan the supply one character at a time and failed to need a separate tokenizing part.
● Atlas Autocode, and Imp (and some implementations ofALGOL and Coral 66) area unit samples of stropped languages that compilers would have a Line Reconstruction part.
2. Lexical analysis
● It breaks the ASCII text file text into little items known as tokens. Every token may be a single atomic unit of the language, as an example a keyword, symbol or image name.
● The token syntax is often a daily language, therefore a finite state automaton made from a daily expression is wont to acknowledge it.
● This part is additionally known as lexing or scanning, and therefore the package doing lexical analysis is termed a lexical analyser or scanner.
● This might not be a separate step – it is combined with the parsing step in scannerless parsing, within which case parsing is finished at the character level, not the token level.
3. Preprocessing.
● Some languages, e.g., C, need a preprocessing part that supports macro substitution and conditional compilation. Generally the preprocessing part happens before grammar or linguistics analysis; e.g. Within the case of C, the preprocessor manipulates lexical tokens instead of grammar forms. However, some languages like Scheme Support macro substitutions supported grammar forms.
4. Syntax analysis
● It involves parsing the token sequence to spot the grammar structure of the program.
● This section generally builds a analyse tree, that replaces the linear sequence of tokens with a tree structure engineered in keeping with the foundations of a proper descriptive linguistics that outline the language's syntax.
● The analyse tree is usually analyzed, augmented, and reworked by later phases within the compiler.
5. Linguistics analysis
● It is introduced that the compiler adds linguistics data to the analyse tree and builds the image table. This section performs linguistics checks like sort checking (checking for sort errors), or object binding (associating variable and performance references with their definitions), or definite assignment (requiring all native variables to be initialized before use), rejecting incorrect programs or provision warnings.
● Semantic analysis typically needs an entire analyse tree, which means that this section logically follows the parsing phase, and logically precedes the code generation section, tho' it's typically attainable to fold multiple phases into one omit the code in a very compiler implementation.
2.THE MIDDLE finish:
● Performs optimizations, together with removal of useless or out of reach code, discovery and propagation of constant values, relocation of computation to a less ofttimes dead place (e.g., out of a loop), or specialization of computation supported the context. Generates another IR for the backend.
3. The rear finish
Generates the assembly code, acting register allocation in method. (Assigns processor registers for the program variables wherever attainable.)
Optimizes target code utilization of the hardware by deciding the way to keep parallel execution units busy, filling delay slots.
Although most algorithms for improvement square measure in NP, heuristic techniques square measure well-developed.
The main phases of the rear finish embrace the following:
1. Analysis: this can be the gathering of program data from the intermediate illustration derived from the input; data-flow analysis is employed to create use-define chains, along with dependence analysis, alias analysis, pointer analysis, escape analysis, etc. correct analysis is that the basis for any compiler improvement. The decision graph and management flow graph square measure typically additionally engineered throughout the analysis section.
2. Optimization: the intermediate language illustration is reworked into functionally equivalent however quicker (or smaller) forms. In style optimizations square measure inline enlargement, dead code elimination, constant propagation, loop transformation, register allocation and even automatic parallelization.
3. Code generation: the reworked intermediate language is translated into the output language, typically the native machine language of the system. This involves resource and storage selections, like deciding that variables to suit into registers and memory {and the|and therefore the|and additionally the} choice and programming of applicable machine directions together with their associated addressing modes (see also Sethi-Ullman algorithm). Right knowledge may got to be generated to facilitate debugging.
Compiler analysis is that the necessity for any compiler improvement, and that they tightly work along. As an example, dependence analysis is crucial for loop transformation.
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 analyse one expression over and over however solely analyse 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.
ADVANTAGES OF COMPILER
1. ASCII text file isn't enclosed, thus compiled code is safer than understood code.
2. Tends to provide quicker code than deciphering ASCII text file.
3. Produces associate degree practicable file, and so the program are often run while not would like of the ASCII text file.
DISADVANTAGES OF COMPILER
1. code must be made before a final practicable file, this could be a slow method.
2. The ASCII text file should be 100 percent correct for the practicable file to be made.
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.
EXAMPLE
• The Java interpreter java translate a .class file into code which will be dead natively on the underlying machine.
• The program VirtualPC interprets programs written for the Intel Pentium design (IBM-PC clone) for the PowerPC design (Macintosh). This change Macintosh users to run Windows programs on their pc.
An interpreter typically uses one in every of the subsequent ways for program execution:
1. Take apart the ASCII text file and perform its behavior directly.
2. Translate ASCII text file into some economical intermediate illustration and forthwith execute this.
3. Expressly execute hold on precompiled code created by a compiler that is an element of the interpreter system.
APPLICATIONS
1. Interpreters are of wont to execute command languages, associate degreed glue languages since every operator dead in search language is typically associate degree invocation of a fancy routine like an editor or compiler.
2. Self-modifying code will simply be enforced in associate degree understood language. This relates to the origins of interpretation in Lisp and computer science analysis.
3. Virtualization. Machine language meant for one hardware design are often run on another employing a virtual machine, that is actually associate degree interpreter.
4. Sandboxing: associate degree interpreter or virtual machine isn't compelled to truly execute all the directions the ASCII text file it's process. Specifically, it will refuse to execute code that violates any security constraints it's operational underneath.
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 ar typically slower than compiled programs because of the per-line translation methodology.
Difference Between Compilers Interpreters and Assemblers
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 |
Primary memory holds only those data and instructions on which the computer is currently working. It has a limited capacity and data is lost when power is switched off. It is generally made up of semiconductor device. These memories are not as fast as registers. The data and instruction required to be processed resides in the main memory.
RAM (Random Access Memory)
● 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 7: 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.
Typical applications of RAM
● The fast and directly accessible temporary (working) memory needed by a computer
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
Type of RAM
● Static RAM
● Dynamic RAM
Static RAM
The term "static" refers to the fact that the memory's contents are retained as long as power is available. Data is lost, however, when the power goes off due to the volatile nature of the environment. SRAM chips have a 6-transistor matrix and no capacitors. SRAM does not need to be refreshed on a regular basis because transistors do not require electricity to avoid leakage.
Because there is more space in the matrix, SRAM takes more chips than DRAM to store the same amount of data, resulting in greater production costs. As a result, SRAM is used as a cache memory and has a very rapid access time.
Dynamic RAM
DRAM, unlike SRAM, needs to be refreshed on a regular basis to keep the data current. This is accomplished by connecting the memory to a refresh circuit, which rewrites the data hundreds of times per second. DRAM is the most common type of system memory since it is inexpensive and compact. Memory cells, which are made up of one capacitor and one transistor, are used in all DRAMs.
ROM
What is ROM?
Fig 8: 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.
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 connects 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.
Fig 9: Block Diagram of ROM
The block of ROM has 'n' input lines and 'm' output lines. Each bit combination of the input variables is known as an address. Each bit combination that comes out through output lines is called a word. The number of bits per word is equal to the number of output lines, m.
The address of a binary number refers to one of the addresses of n variables. So, the number of possible addresses with 'n' input variables is 2n. An output word has a unique address, and as there are 2n distinct addresses in a ROM, there are 2n separate words in the ROM. The words on the output lines at a given time depends on the address value applied to the input lines.
Internal Structure of ROM:
The internal structure comprises two basic components: decoder and OR gates. A decoder is a circuit that decodes an encoded form (such as binary coded decimal, BCD) to a decimal form. So, the input is in binary form, and the output is its decimal equivalent. All the OR gates present in the ROM will have outputs of the decoder as their output. Let us take an example of 64 x 4 ROM. The structure is shown in the following image.
Fig 10: Internal construction
This Read Only Memory consists of 64 words of 4 bits each. So, there would be four output lines, and one of the 64 words available on the output lines is determined from the six input lines as we have only six inputs because in this ROM we have 26 = 64, so we can specify 64 addresses or minterms. For each address input, there is a unique selected word. For example, if the input address is 000000, word number 0 will be selected and applied to the output lines. If the input address is 111111, word number 63 is selected and applied to the output lines.
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.
Key takeaways
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.
Difference between PROM, EPROM and EEPROM
PROM VS EPROM VS EEPROM | ||
PROM | EPROM | EEPROM |
A Read Only Memory (ROM) that can be modified only by a users | A programmable ROM that can be erased and reused. | A user-modifiable ROM that can be erased and reprogrammed repeatedly through a normal electrical voltage |
Stands for Programmable Read Only Memory | Stands for Erasable Programmable Read Only Memory | Stands for Electrically Erasable Programmable Read Only Memory |
Developed by Wen Tsing Chow in 1956 | Developed by Dov Frohman in 1971 | Developed by George Perlegos in 1978 |
Reprogrammable only once | Can be reprogramed using ultraviolet light | Can be reprogramed using electrical charge |
Difference between RAM and ROM
RAM | ROM |
1. Temporary Storage. | 1. Permanent storage |
2. Store data in MBs. | 2. Store data in GBs. |
3. Volatile. | 3. Non-volatile. |
4. Used in normal operations. | 4. Used for startup process of computer. |
5. Writing data is faster. | 5. Writing data is slower |
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 |
You know that processor memory, additionally called primary memory, is dear likewise as restricted. The quicker primary memory are volatile. If we want to store great deal of knowledge or programs for good, we want a less expensive and permanent memory. Such memory is named secondary memory. Here we are going to discuss secondary memory devices which will be wont to store great deal of knowledge, audio, video and multimedia system files.
Characteristics of Secondary Memory
These area unit some characteristics of secondary memory, that distinguish it from primary memory −
- It is non-volatile, i.e. it retains knowledge once power is shifted
- It is massive capacities to the tune of terabytes
- It is cheaper as compared to primary memory
Depending on whether or not secondary storage device is a component of C.P.U. Or not, there are 2 kinds of secondary memory – fastened and removable.
Let us look at some of the secondary memory devices available.
Hard Disk Drive
Hard disk drive is formed from a series of circular disks known as platters organized one over the opposite nearly ½ inches apart around a spindle. Disks area unit fabricated from non-magnetic material like aluminium alloy and coated with 10-20 nm of magnetic material.
Standard diameter of those disks is fourteen inches and that they rotate with speeds variable from 4200 rev (rotations per minute) for private computers to 15000 rev for servers. Knowledge is keep by magnetizing or demagnetizing the magnetic coating. A magnetic browser arm is employed to read knowledge from and write knowledge to the disks. A typical fashionable HDD has capability in terabytes (TB).
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.
Pen Drive
Pen drive may be a moveable storage device that uses solid state memory instead of magnetic fields or lasers to record knowledge. It uses a technology kind of like RAM, except that it's nonvolatile. It's additionally known as USB drive, key drive or nonvolatile storage.
Portable Hard Disc
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.
References:
1. Computer Today –Basandara
2. Fundamentals of Computers --V. Rajaraman.
3. Computer Fundamentals – By P .K Sinha