UNIT 1 INTRODUCTION TO COMPUTERS 1.1 INTRODUCTION Word “Compute means calculate” Definition of Computer: The computer is a device or machine that performs pre-defined or programmed computations or control operations that are expressible in numerical or logical terms at a high speed and with great accuracy. It is used to store, transfer and transform information. 1.2 CHARACTERISTICS OF COMPUTERS Important Characteristics of Computers Speed: The speed of the computer is calculated in(MHz) that is 1 million instructions per second and this provides the computers process data at an extremely fast rate. Reliability: The Computers never make mistakes of their own accord. Because it has the built-in diagnostics capabilities, which help in continuously monitoring the system. Accuracy: The computers we use today provide extremely high accuracy. Digilience:It performs all the operations with the same speed and accuracy.(it does not tire as like human beings. Storage Capacity: Computers are capable of storing enormous amounts of data that can be located and retrieved very quickly. Versatility: Multi-processing of computer allows it to perform multiple tasks simultaneously with equal ease. Resource Sharing: In organizations and institutions computer can be connected as network. The costly resources (printers .plotters and scanners are shared among the computers connected to the network. Interactive Computing: It provides the user to interact with each other during their computation section. Thus user can periodically update the information Limitations of Computer It can only perform what it is programmed to do. It has no sense of meaning, cannot perceive and are only able to make simple robotic decisions about the data they receive. 1.3 EVOLUTION OF COMPUTERS 1.3 EVOLUTION OF COMPUTERS The need for counting, computing or processing data has been with man from the beginning. The most significant early computing tool is the ABACUS, a wooden rack holding parallel rods on which beads are strung. This simple device was used for addition and subtraction. A Scottish scholar, John Napier (1550-1617) invented the logarithm and in 1661, William Oughtred invented both the rectilinear and circular slide rules. These are analog computers which have been replaced in modern times by pocket calculators. A significant advance in the evolution of computing systems was the invention of a mechanical adding machine in 1642 by the French scientist Blaise Pascal (1623-1662). Having observed Pascal's machine in Paris, the German mathematician Gottfried Wilhelm von Leibniz (1646-1716) designed a better one in 1671. While Pascal's machine could only count, Leibniz device could also multiply, divide, and find square root. In 1820, Thomas of Colmar (Charles Xavier Thomas) produced the first commercially available mechanical calculator. This desktop calculator could add, subtract, multiply, and divide. This was followed by a succession of advanced and improved versions of mechanical calculators. While Thomas of Colmar was working on the mechanical calculator, Charles Babbage (1792-1871) at Cambridge, England, was developing the first digital computer. By 1822, he built an automatic mechanical calculator called the "difference engine." In 1833 he began to work on a general-purpose, programmable, automatic mechanical digital computer called the “analytic machine”. Unfortunately, Babbage's analytical engine was never completed because its design required fabrication precision beyond what was feasible at that time. A major step forward in the evolution of computer systems is the invention of punch cards which was first used during the U.S. census of 1890 by Herman Hollerith and James Powers while working for the U.S. Census Bureau. With the punch cards, the calculating machines became fully automatic. In 1896 Hollerith formed the Tabulating Machine Company which manufactured punch card machines. After his retirement in 1913, Thomas J. Watson, Sr. became president of the company, which became International Business Machines Corporation in 1924. This company was later to play a significant role in the evolution of computer systems. Modern Digital Systems Although the punched machine was well established and reliable by the late 1930’s, several research groups worked hard to build automatic digital computer. A group of IBM team of four workers led by Howard Hathaway Aiken, a physicist and mathematician at Harvard University, began work on a fully automatic calculator in 1939. The calculator, commonly called the International Business Machines Automatic Sequence Controlled Calculator or Harvard Mark I, was completed in August 1944. This was the first information- processing machine. As an electromechanical computer, it has 760,000 wheels, 500 miles of wire, and a panel 51 ft long and 8ft high. Input data was entered through the punched cards, and the output was by punched card or electric typewriter. Aiken's machine was similar in principle to Babbage's analytical machine although Aiken did not know about Babbage's work when he started his research. The first all-digital electronic computer made its appearance during the World War II. In the United States, there was the desperate need for computers that would quickly compute firing tables for the variety of new weapons used by the U.S. army. In 1942, electrical engineer J. Presper Eckert and physicist John W. Mauchly, at the Moore School of Engineering, University of Pennsylvania, Philadelphia, met the need and developed ENIAC (Electronic Numerical Integrator and Calculator). ENIAC went into operation in 1946. It was the first all-purpose, digital electronic computer. It used vacuum tubes instead of relays as the logic elements. Because of this, it was more than 1,000 faster than its electromechanical predecessors. However, ENIAC was of an unprecedented size and complexity. In 1950, ENIAC was succeeded by EDVAC (Electronic Discrete Variable Automatic Computer), a stored-program computer. In 1947, Eckert and Mauchly established their own company, Eckert-Mauchly Computer Corporation, to manufacture computers commercially. In 1951, the company produced the UNIVAC I (Universal Automatic Computer) for the U.S. Census Bureau. Although this first commercial computer was produced for the Census Bureau, it was used extensively by the scientific community. UNIVAC I achieved the greatest fame among the early digital computers because it was used to predict correctly the presidential election in 1952. The results projected Dwight Eisenhower's election over Adlai Stevenson 45 minutes after the polls closed 1.4 COMPUTER GENERATIONS The history of computer development is often referred to in reference to the different generations of computing devices. 1.4.1. First Generation (1940-1956): Vacuum Tubes These vacuum tubes are very huge in size and they taking up entire rooms and it generates a lot of heat. First generation computers relied on machine language to perform operations, and they could only solve one problem at a time. Input was based on punched cards and paper type and output was displayed on printouts. Example: UNIVAC and ENIAC. Characteristics of First Generation Computers: Vacuum tube technology was used and Computation time was in milliseconds. Computers were very large in size and required a lot of space for installation. Magnetic drums were used for memory. They lacked in versatility and speed. They were not portable. They were very expensive to operate since they consume a large amount of power. Since thousand of vacuum tubes were used, they generated a large amount of heat. As a result, air conditioning was essential. They were unreliable and prone to frequent hardware failures. Hence, constant maintenance was required. Computers were difficult to program since they used machine language. Components of computer were manually assembled. Punch cards and paper tapes were used as inputs and output was displayed on printouts. 1.4.2 Second Generation (1956-1963) : Transistors Transistors replaced the vacuum tubes. This was very superior to the vacuum tubes allowing the computer to become faster ,smaller cheaper, more energy –efficient and more reliable than their first generation computers. High level programming also developed at this time such as early versions of COBOL and FORTRAN Example: PDP-8, IBM 1401 and IBM 7090 Characteristics of Second Generation Computers Transistor technology was used. Magnetic cores were used as primary memory and magnetic dick as secondary storage device. They were smaller as compared to first generation computers. Computation time was in microseconds They were more reliable and less prone to hardware failure. Hence, required less frequent maintenance. They were more portable and produced less amount of heat. They still required air conditioning. Programming became more time efficient and less cumbersome since they used assembly language programming. Components were still manually assembled and Punch cards were used for input and printouts for output. 1.4.3 Third Generation (1966-1971) : Integrated Circuits In this generation the transistors were miniaturized and placed on silicon Chips called semiconductors which increase the speed and efficiency of the computes. Punch cards and printouts are replaced by the user interactive devices such as keyboard and monitors. With an operating System the device can run many different applications at one time with a central program that monitored the memory. Characteristics of Third Generation Computers Integrated circuit technology was used. They were smaller as compared to previous generations. Computation time was in nanoseconds. They were smaller in size and easily portable. They were more reliable than previous generations and they consumed less power and hence generated less heat. Since hardware was more reliable, the maintenance cost was quite low. Programming became easy since they used higher level language for programming. Components were assembled using automated machines. Commercial production became easier and cheaper. Keyboards and monitors were used for input and output, respectively. 1.4.4 Fourth Generation (1971-Present) : Microprocessors Thousands of IC’s were built onto a single silicon Chip. As this small computers became more powerful, and they form a network, which eventually led to the development of the internet Characteristics and Fourth Generations Computers Microprocessor technology is used. They are very small is size. They are portable and more reliable. They are cheaper since production cost is low. They generate less amount of heat, hence they do not require air conditioning; only cooling fan is sufficient. Minimum maintenance is required since hardware failures are negligible. They support graphics user interface (GUI) and hand held devices to make input/output task more easily and efficiently. They allow interconnections between themselves to form a network. Network enables data communication and resource sharing. 1.4.5 Fifth Generation – (Present and Beyond) : Artificial Intelligence Fifth generation computing devices, based on artificial and intelligence, are still in development, though there are some applications, such as voice recognition, that are being used today. Artificial Intelligence is the branch of computer science converted with making computers behave like humans. Artificial intelligence includes: Games Playing Expert systems Natural language Neural networks Robotics Currently, no computers exhibit full artificial intelligence (that is, are able to simulate human behavior). 1.5 CLASSIFICATION OF COMPUTERS Nowadays, computers are available in many sizes and types. Some computers can fill in the palm of the hand, and some can occupy the entire room. Some are suitable for individual users, and some are suitable for organizations. The figure shows the classifications of computers. Classification of Computers Micro Mini Main Frame Work stations Desktop Super Network Servers Note books / Laptops Tablet Handheld Smart Phones Classifications of computers 1.5.1 Microcomputer A Microcomputer is a small, low cost digital computer. It consists of microprocessor a storage unit, an input channel, and an output channel. One distinguishing feature of a microcomputer is that the CPU is usually a single integrated circuit called a microprocessor. 1.5.1.1 Desktop Computers A desktop compute is the most common type of a personal computer made for use on a desk (mostly in an office home and school) and is distinguished from portable computers such as laptops or PDAs and specialized computers such as servers. Desktop computers come in a variety of case styles ranging from large vertical towers to small form factor models that can be tucked behind an LCD monitor. They are full size computers and hence cannot be carried easily. 1.5.1.2 Note book / Laptop Computers As the name indicates, the size of notebook computer is 8.5 inch by 11 inch usually weighing from one to three kilograms, depending on size, materials and other factors. The terms “notebook” and “laptop” are often used interchangeably. Like desktop system. Notebook computer can be connected to different devices or a network with the additional ports provided by docking stations. 1.5.1.3 Tablet Computers A Tablet PC a computer shaped in the form of a notebook or a slate with the capabilities of being written on through the use of digitizing tablet technology or a touch screen. A user can use a stylus of digital pen and operate the computer without having to have a keyboard or mouse. All the functions provided by notebook computers are available in tablet computers, but they are lighter than notebook computers. 1.5.1.4 Handheld computers Handheld PCs, as their name implies, small enough to fit in your hand. Personal Digital Assistant (PDA) is a popular type of handheld computer. Most PDAs come with a pen which allows the user to write on the screen. Many PDAs can be connected to larger computers and allows to exchange data. Many PDAs provide internet access through a wireless connection. Many handheld PC models offer feature such as cellular telephones, cameras, music players and global positioning systems. 1.5.1.5 Smart Phones A Smart Phone or sphone is any electronic handheld device that integrates the functionality of a mobile phone, personal digital assistant (PDA) or other information appliance. This often achieved by adding telephone functions to an existing PDA (PDA Phone) or putting “smart” capabilities such as PDA functions, into a mobile phone. Smart Phone features tend to include Internet access, email access scheduling software, built-in-camera, music players, contact management. 1.5.2 Minicomputers The term “minicomputer” evolved in the 1960s to describe the “small” third generations computers that became possible with the use of transistor and core memory technologies. They usually took up one or a few cabinets the size of a large refrigerator of two, compared with mainframes that would usually fill a room. Minicomputer (colloquially, mini) is a largely obsolete term for a class of multi-user computers which make up the middle range of the computing spectrum, in between the largest multi-user systems (traditionally, mainframe computers) and the smallest single-user systems (microcomputers or personal computers). The Minicomputers are best suitable for small business organizations where about 4 to 200 computers users need simultaneous access. Since minicomputers support mutli-user system, they are used in interactive applications in industries, research organizations, business organizations, colleges and universities. They are also used in real time controns and engineering design work. The examples of minicomputers are: PDF 11, IBM (8000 series) and VAX 7500. 1.5.2.1 Workstations A workstation, often referred to as Unix workstation, RJSC Workstations or engineering workstations, is a high-end technical computing, desktop microcomputer designed primarily to be used by one person at a time, but can also be connected remotely to other users when necessary. It has typically specialized features and more power than a standard desktop PC. The workstations are popular among scientists, engineers and animators because of their greater-than-average speed and power to perform sophisticated tasks. 1.5.2.2 Network Servers A network server is a powerful computer system with special software that work as the centralized primary computer in the network. It controls and manages the computers of individual users connected in that network. As per the requirement, the organizations use a few to hundreds of server working together. Such group of servers is called server farms or clusters. 1.5.3 Mainframe Computers Mainframe computers are the computers used mainly by large companies for mission critical applications, government institutions, typically bulk data processing such as census, industry/consumer statistics and financial transaction processing (banks) where the same date is frequently used by many people. Each user in the mainframe’s systems can access the provided resources through a device called a “terminal”. There are two types of terminals, intelligent terminal and dumb terminal. The intelligent terminal can perform some processing operations, but usually any storage is not provided for it. A dumb terminal is simply an input/output (I/O) device. It cannot process or store data. Mainframes are large and powerful systems. Mainframes often support thousands of simultaneous users who gain access through ‘dumb’ terminals or terminal emulation. Most mainframe systems are specially designed to handle only a specific set to tasks. The examples of mainframe computers are : IBM’s ES 000, VAX 8000 and CDC 6600. 1.5.4 Supercomputers A Supercomputer is the most powerful and physically one of the largest computer that leads the world interms of processing capacity particularly speed of calculation. Unlike mainframes and minicomputers, supercomputers are used for the heavy stuff like weather maps, constructions of atom bombs, finding oil, earthquake prediction and sciences where a lot of calculations must be done. The fastest supercomputers can perform more than one trillion calculations must be done. They can process huge amounts of data. In India, C-CDAC (Center for Development of Advanced Computer) has developed supercomputer named PARAM Padma. It has a processing speed of up to one teraflops ( 1 trillion processes per second). The examples of supercomputers are CRAY-3, CYBER 205 and PARAM. 1.6 BASIC COMPUTER ORGANIZATIONS A computer as shown in Figure performs basically five major operations or functions irrespective of their size and make. These are 1) it accepts data or instructions by way of input, 2) it stores data, 3) it can process data as required by the user, 4) it gives results in the form of output, and 5) it controls all operations inside a computer. We discuss below each of these operations. 1. Input: This is the process of entering data and programs in to the computer system. You should know that computer is an electronic machine like any other machine which takes as inputs raw data and performs some processing giving out processed data. Therefore, the input unit takes data from us to the computer in an organized manner for processing. Basic computer Operations 2. Storage: The process of saving data and instructions permanently is known as storage. Data has to be fed into the system before the actual processing starts. It is because the processing speed of Central Processing Unit (CPU) is so fast that the data has to be provided to CPU with the same speed. Therefore the data is first stored in the storage unit for faster access and processing. This storage unit or the primary storage of the computer system is designed to do the above functionality. It provides space for storing data and instructions. The storage unit performs the following major functions: All data and instructions are stored here before and after processing. Intermediate results of processing are also stored here. 3. Processing: The task of performing operations like arithmetic and logical operations is called processing. The Central Processing Unit (CPU) takes data and instructions from the storage unit and makes all sorts of calculations based on the instructions given and the type of data provided. It is then sent back to the storage unit. 4. Output: This is the process of producing results from the data for getting useful information. Similarly the output produced by the computer after processing must also be kept somewhere inside the computer before being given to you in human readable form. Again the output is also stored inside the computer for further processing. 5. Control: The manner how instructions are executed and the above operations are performed. Controlling of all operations like input, processing and output are performed by control unit. It takes care of step by step processing of all operations in side the computer. FUNCTIONAL UNITS In order to carry out the operations mentioned in the previous section the computer allocates the task between its various functional units. The computer system is divided into three separate units for its operation. They are 1) arithmetic logical unit, 2) control unit, and 3) central processing unit. Arithmetic Logical Unit (ALU) After you enter data through the input device it is stored in the primary storage unit. The actual processing of the data and instruction are performed by Arithmetic Logical Unit. The major operations performed by the ALU are addition, subtraction, multiplication, division, logic and comparison. Data is transferred to ALU from storage unit when required. After processing the output is returned back to storage unit for further processing or getting stored. Control Unit (CU) The next component of computer is the Control Unit, which acts like the supervisor seeing that things are done in proper fashion. The control unit determines the sequence in which computer programs and instructions are executed. Things like processing of programs stored in the main memory, interpretation of the instructions and issuing of signals for other units of the computer to execute them. It also acts as a switch board operator when several users access the computer simultaneously. Thereby it coordinates the activities of computer’s peripheral equipment as they perform the input and output. Therefore it is the manager of all operations mentioned in the previous section. Central Processing Unit (CPU) The ALU and the CU of a computer system are jointly known as the central processing unit. You may call CPU as the brain of any computer system. It is just like brain that takes all major decisions, makes all sorts of calculations and directs different parts of the computer functions by activating and controlling the operations. Personal Computer Configuration Now let us identify the physical components that make the computer work. These are 1. Central Processing Unit (CPU) 2. Computer Memory (RAM and ROM) 3. Data bus 4. Ports 5. Motherboard 6. Hard disk 7. Output Devices 8. Input Devices All these components are inter-connected for the personal computer to work. MEMORY SYSTEM IN A COMPUTER There are two kinds of computer memory: primary and secondary. Primary memory is accessible directly by the processing unit. RAM is an example of primary memory. As soon as the computer is switched off the contents of the primary memory is lost. You can store and retrieve data much faster with primary memory compared to secondary memory. Secondary memory such as floppy disks, magnetic disk, etc., is located outside the computer. Primary memory is more expensive than secondary memory. Because of this the size of primary memory is less than that of secondary memory. We will discuss about secondary memory later on.Computer memory is used to store two things: i) instructions to execute a program and ii) data. Capacity of Primary Memory You know that each cell of memory contains one character or 1 byte of data. So the capacity is defined in terms of byte or words. Thus 64 kilobyte (KB) memory is capable of storing 64 ´ 1024 = 32,768 bytes. (1 kilobyte is 1024 bytes). A memory size ranges from few kilobytes in small systems to several thousand kilobytes in large mainframe and super computer. In your personal computer you will find memory capacity in the range of 64 KB, 4 MB, 8 MB and even 16 MB (MB = Million bytes). The following terms related to memory of a computer are discussed below: 1. Random Access Memory (RAM): The primary storage is referred to as random access memory (RAM) because it is possible to randomly select and use any location of the memory directly store and retrieve data. It takes same time to any address of the memory as the first address. It is also called read/write memory. The storage of data and instructions inside the primary storage is temporary. It disappears from RAM as soon as the power to the computer is switched off. The memories, which loose their content on failure of power supply, are known as volatile memories .So now we can say that RAM is volatile memory. 2. Read Only Memory (ROM): There is another memory in computer, which is called Read Only Memory (ROM). Again it is the ICs inside the PC that form the ROM. The storage of program and data in the ROM is permanent. The ROM stores some standard processing programs supplied by the manufacturers to operate the personal computer. The ROM can only be read by the CPU but it cannot be changed. The basic input/output program is stored in the ROM that examines and initializes various equipment attached to the PC when the switch is made ON. The memories, which do not loose their content on failure of power supply, are known as non-volatile memories. ROM is non-volatile memory. 3. PROM There is another type of primary memory in computer, which is called Programmable Read Only Memory (PROM). You know that it is not possible to modify or erase programs stored in ROM, but it is possible for you to store your program in PROM chip. Once the programmes are written it cannot be changed and remain intact even if power is switched off. Therefore programs or instructions written in PROM or ROM cannot be erased or changed. 4. EPROM: This stands for Erasable Programmable Read Only Memory, which over come the problem of PROM & ROM. EPROM chip can be programmed time and again by erasing the information stored earlier in it. Information stored in EPROM exposing the chip for some time ultraviolet light and it erases chip is reprogrammed using a special programming facility. When the EPROM is in use information can only be read. 5. Cache Memory: The speed of CPU is extremely high compared to the access time of main memory. Therefore the performance of CPU decreases due to the slow speed of main memory. To decrease the mismatch in operating speed, a small memory chip is attached between CPU and Main memory whose access time is very close to the processing speed of CPU. It is called CACHE memory. CACHE memories are accessed much faster than conventional RAM. It is used to store programs or data currently being executed or temporary data frequently used by the CPU. So each memory makes main memory to be faster and larger than it really is. It is also very expensive to have bigger size of cache memory and its size is normally kept small. 6. Registers: The CPU processes data and instructions with high speed, there is also movement of data between various units of computer. It is necessary to transfer the processed data with high speed. So the computer uses a number of special memory units called registers. They are not part of the main memory but they store data or information temporarily and pass it on as directed by the control unit. SECONDARY STORAGE You are now clear that the operating speed of primary memory or main memory should be as fast as possible to cope up with the CPU speed. These high-speed storage devices are very expensive and hence the cost per bit of storage is also very high. Again the storage capacity of the main memory is also very limited. Often it is necessary to store hundreds of millions of bytes of data for the CPU to process. Therefore additional memory is required in all the computer systems. This memory is called auxiliary memory or secondary storage. In this type of memory the cost per bit of storage is low. However, the operating speed is slower than that of the primary storage. Huge volume of data are stored here on permanent basis and transferred to the primary storage as and when required. Most widely used secondary storage devices are magnetic tapes and magnetic disk. 1. Magnetic Tape: Magnetic tapes are used for large computers like mainframe computers where large volume of data is stored for a longer time. In PC also you can use tapes in the form of cassettes. The cost of storing data in tapes is inexpensive. Tapes consist of magnetic materials that store data permanently. It can be 12.5 mm to 25 mm wide plastic film-type and 500 meter to 1200 meter long which is coated with magnetic material. The deck is connected to the central processor and information is fed into or read from the tape through the processor. It similar to cassette tape recorder. Advantages of Magnetic Tape: Compact: A 10-inch diameter reel of tape is 2400 feet long and is able to hold 800, 1600 or 6250 characters in each inch of its length. The maximum capacity of such tape is 180 million characters. Thus data are stored much more compactly on tape. Economical: The cost of storing characters is very less as compared to other storage devices. Fast: Copying of data is easier and fast. Long term Storage and Re-usability: Magnetic tapes can be used for long term storage and a tape can be used repeatedly with out loss of data. 2. Magnetic Disk: You might have seen the gramophone record, which is circular like a disk and coated with magnetic material. Magnetic disks used in computer are made on the same principle. It rotates with very high speed inside the computer drive. Data is stored on both the surface of the disk. Magnetic disks are most popular for direct access storage device. Each disk consists of a number of invisible concentric circles called tracks. Information is recorded on tracks of a disk surface in the form of tiny magnetic spots. The presence of a magnetic spot represents one bit and its absence represents zero bit. The information stored in a disk can be read many times without affecting the stored data. So the reading operation is non-destructive. But if you want to write a new data, then the existing data is erased from the disk and new data is recorded. 3. Floppy Disk: It is similar to magnetic disk discussed above. They are 5.25 inch or 3.5 inch in diameter. They come in single or double density and recorded on one or both surface of the diskette. The capacity of a 5.25-inch floppy is 1.2 mega bytes whereas for 3.5 inch floppy it is 1.44 mega bytes. It is cheaper than any other storage devices and is portable. The floppy is a low cost device particularly suitable for personal computer system. 4. Optical Disk: With every new application and software there is greater demand for memory capacity. It is the necessity to store large volume of data that has led to the development of optical disk storage medium. Optical disks can be divided into the following categories: 1. Compact Disk/ Read Only Memory (CD-ROM): CD-ROM disks are made of reflective metals. CD-ROM is written during the process of manufacturing by high power laser beam. Here the storage density is very high, storage cost is very low and access time is relatively fast. Each disk is approximately 4 1/2 inches in diameter and can hold over 600 MB of data. As the CD-ROM can be read only we cannot write or make changes into the data contained in it. 2. Write Once, Read Many (WORM): The inconvenience that we can not write any thing in to a CD-ROM is avoided in WORM. A WORM allows the user to write data permanently on to the disk. Once the data is written it can never be erased without physically damaging the disk. Here data can be recorded from keyboard, video scanner, OCR equipment and other devices. The advantage of WORM is that it can store vast amount of data amounting to gigabytes (109 bytes). Any document in a WORM can be accessed very fast, say less than 30 seconds. 3. Erasable Optical Disk: These are optical disks where data can be written, erased and re-written. This also applies a laser beam to write and re-write the data. These disks may be used as alternatives to traditional disks. Erasable optical disks are based on a technology known as magnetic optical (MO). To write a data bit on to the erasable optical disk the MO drive's laser beam heats a tiny, precisely defined point on the disk's surface and magnetises it. INPUT OUTPUT DEVICES A computer is only useful when it is able to communicate with the external environment. When you work with the computer you feed your data and instructions through some devices to the computer. These devices are called Input devices. Similarly computer after processing, gives output through other devices called output devices. For a particular application one form of device is more desirable compared to others. We will discuss various types of I/O devices that are used for different types of applications. They are also known as peripheral devices because they surround the CPU and make a communication between computer and the outer world. Input Devices Input devices are necessary to convert our information or data in to a form which can be understood by the computer. A good input device should provide timely, accurate and useful data to the main memory of the computer for processing followings are the most useful input devices. 1. Keyboard: - This is the standard input device attached to all computers. The layout of keyboard is just like the traditional typewriter of the type QWERTY. It also contains some extra command keys and function keys. It contains a total of 101 to 104 keys. A typical keyboard used in a computer is shown in Fig. 2.6. You have to press correct combination of keys to input data. The computer can recognise the electrical signals corresponding to the correct key combination and processing is done accordingly. 2 Mouse: - Mouse is an input device shown in Fig. 2.7 that is used with your personal computer. It rolls on a small ball and has two or three buttons on the top. When you roll the mouse across a flat surface the screen censors the mouse in the direction of mouse movement. The cursor moves very fast with mouse giving you more freedom to work in any direction. It is easier and faster to move through a mouse. 3 Scanner: The keyboard can input only text through keys provided in it. If we want to input a picture the keyboard cannot do that. Scanner is an optical device that can input any graphical matter and display it back. The common optical scanner devices are Magnetic Ink Character Recognition (MICR), Optical Mark Reader (OMR) and Optical Character Reader (OCR). o Magnetic Ink Character Recognition (MICR): - This is widely used by banks to process large volumes of cheques and drafts. Cheques are put inside the MICR. As they enter the reading unit the cheques pass through the magnetic field which causes the read head to recognise the character of the cheques. o Optical Mark Reader (OMR): This technique is used when students have appeared in objective type tests and they had to mark their answer by darkening a square or circular space by pencil. These answer sheets are directly fed to a computer for grading where OMR is used. o Optical Character Recognition (OCR): - This technique unites the direct reading of any printed character. Suppose you have a set of hand written characters on a piece of paper. You put it inside the scanner of the computer. This pattern is compared with a site of patterns stored inside the computer. Whichever pattern is matched is called a character read. Patterns that cannot be identified are rejected. OCRs are expensive though better the MICR. Output Devices 1. Visual Display Unit: The most popular input/output device is the Visual Display Unit (VDU). It is also called the monitor. A Keyboard is used to input data and Monitor is used to display the input data and to receive massages from the computer. A monitor has its own box which is separated from the main computer system and is connected to the computer by cable. In some systems it is compact with the system unit. It can be color or monochrome. 2. Terminals: It is a very popular interactive input-output unit. It can be divided into two types: hard copy terminals and soft copy terminals. A hard copy terminal provides a printout on paper whereas soft copy terminals provide visual copy on monitor. A terminal when connected to a CPU sends instructions directly to the computer. Terminals are also classified as dumb terminals or intelligent terminals depending upon the work situation. 3. Printer: It is an important output device which can be used to get a printed copy of the processed text or result on paper. There are different types of printers that are designed for different types of applications. Depending on their speed and approach of printing, printers are classified as impact and nonimpact printers. Impact printers use the familiar typewriter approach of hammering a typeface against the paper and inked ribbon. Dot-matrix printers are of this type. Non-impact printers do not hit or impact a ribbon to print. They use electro-static chemicals and ink-jet technologies. Laser printers and Ink-jet printers are of this type. This type of printers can produce color printing and elaborate graphics. 1.7 NUMBER SYSTEM The common numbering system we use in our daily lives is called the 'denary' system, or counting using 'base 10'. In practice, what this means is that we count using 10 different digits: 0, 1, 2,3,4,5,6,7,8 and 9. We have also seen that it isn't just a digit that is important. It is the position of the digit relative to the other digits in a number that is also important. For example, consider the digit 6. It is worth one amount if it is on its own. It is worth a different amount in 63, and worth a lot more in 6324, and a lot less in 54.68. In all these examples, the amount that the digit is worth is determined by where exactly it is in relation to the other digits in the number. Let's look at a number, for example 658, and remind ourselves what we said in a previous chapter. How do we know how much this number is 'worth'? We know because without thinking about it, we judge the digits that make up the number relative to the other digits! When you were at primary school, you may have been helped to learn your numbers by writing down column headings for a particular number, just so you could get used to the idea that position is important. For example, consider what the number 658 means. Of course, when you are working doing maths you (probably) don't write down the headings anymore. You don't need to because you're so used to counting in base 10. Until you are experts in the other counting systems you need to look at, you should get into the habit of writing down the 'worth' of each position. The binary number system Computers make heavy use of the binary counting system. The reason for this is that the electronic circuits that make up a computer are essentially made up of millions and millions of switches. The switches can have two states - on or off. The actual position of any particular switch relative to other switches is also very important. (In fact, a switch can have three states: on, off and ‘not connected’, but that is beyond this book)! The base 10 system (denary) uses 10 digits, zero to nine. The base 2 system (binary) uses just 2 digits (or 'bits') zero and one. We are going to start our work by using groups of 8 bits, known as a ‘byte’. Here is one possible allocation of the 'worth' of each bit in my byte. 128 64 32 The weighting of each bit in a byte. It is not just whether a bit is a one or a zero that is important. The position of the bit in the whole byte is also important. The bit on the left is 'worth' far more than the bit on the right, for example. This is for no other reason than it is the way I have defined it. Incidentally, you can see when I used the denary system, there was a pattern to working out the 'worth' of each position. It went 103, 102, 101, 100 and so on. (Any number to the power of zero is one)! There is a similar pattern when using base 2. How the ‘worth’ of each position is calculated in the binary system. An example of using the binary system Imagine I want to keep a record of the score of one set of throws in a darts match! The minimum score we need to hold is zero. The maximum is 180, and the score will always be an integer, a whole number i.e. you cannot score 34.5, for example. So now, to represent 180, I would set the bits as shown on the next page. (Note: when I talk about 'setting a bit' I mean that it is made a 'one'. When I talk about resetting a bit, it is made a 'zero'). 18010 in binary. Incidentally, the maximum number that I can represent using my system is 255. I don't need numbers this high for my darts score, but it is always nice to know what the maximum number you can store is. This is shown next. 128 64 32 16 8 4 2 1 25510 is the maximum number that can be represented in binary. It's also nice to know what the smallest number is using any number system. The smallest number you can represent here is zero. How you do this is shown below. 010 is the minimum number that can be represented in binary. So with this numbering system I can represent any whole number from zero to 255. Computers are digital devices! If we had to work in binary all the time, we would soon go mad! The numbers are very long. It takes a while to work them out and it isn't very convenient. There are other numbering systems around that, because of their very close relationship with binary, make them highly suitable. Programmers will sometimes work in binary, for example, but may far more often work in Hex! Using Hex, we can group 4 bits together, to create a 'Hex code'. It is a lot easier to remember 4 Hex numbers than 16 bits, for example! To see how this system works, we need to start at the beginning! Hexadecimal (Hex - base 16) We have already seen that a digit's worth depends on what position it is in relative to the other digits in the number. • Base 10 positions are worth 107, 106, 105,104,103, 102, 101, 100 • Base 2 positions are worth 27, 26, 25, 24 23, 22, 21, 20 • Base 16 positions are worth 167, 166, 165, 164 163, 162, 161, 160 How does the hexadecimal system work? The first thing to note is that there are 16 'numbers' in this system:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. It may well seem a little odd using letters to represent numbers: 10=A, 11=B, 12=C, 13=D,14=E, 15=F. With a little practice, you will see what an excellent system this is. Just to remind you, to show what system is being used when you write down a number, it is common to use a subscript. So for example: 3410 means (3 x 10) + (4 x 1) whereas 3416 means (3 x 16) + (4 x 1) = 58 + 4 = 6210 As you know, when we write down numbers in our daily life, we omit the subscript because we assume that every one is using base 10. Sometimes, especially in computer circles, it is a dangerous assumption to make! If there is any doubt, then add a subscript! When doing exam questions, always use a subscript, just to show how clever you are! Let's convert a few more Hex numbers into denary: • 3C16 is the same as (3 x 16) + (12 x 1) = 6010 • 816 is the same as (8 x 1) = 810 • 3AF16 is the same as (3 x 256) + (10 x 16) + (15 x 1) = 94310 TASK 6 - Convert these numbers into their denary form: 3616 and 316 and FA16 and 2DE16 A better way to convert into and out of Hex Going from Hex to denary is relatively easy after you've done a few of them. You have to think a little bit harder going the other way, from denary to Hex. But there is a better way! If you remember, we said that Hex and binary were very closely related. As long as we can do binary to denary conversion off the top of our heads, there is a method for converting denary to Hex, and also back again, very quickly. See if you can follow this example. We are going to convert 12510 into a Hex number. STEP 1 - Convert 12510 into binary.8 STEP 2 - Split the binary number into two halves. STEP 3 - Treat each half as a 4 bit binary number. Convert each half back into a decimal again. STEP 4 - Now convert each of the two decimal numbers into Hex using the Hex number numbering system. Remember, 10=A, 11=B, 12=C, 13=D, 14=E, 15=F. STEP 5 - Recombine the answer and then proudly display it! 12510 is 7D16 You should always check the Hex answer you got. 7D16 = (7 x 16) + (13 x 1) = 125 10 so our answer is correct.(Of course, you could always check your answer using a calculator! In Windows, Go to WINDOWS - ACCESSORIES -CALCULATOR VIEW - SCIENTIFIC). Let’s do another example. We are going to convert 7510 into a Hex number. STEP 1 - Convert 7510 into binary. STEP 2 - Split the binary number into two halves. STEP 3 - Treat each half as a 4 bit binary number. Convert each half back into a decimal again. STEP 4 - Now convert each of the two decimal numbers into Hex using the Hex number numbering system. Remember, 10=A, 11=B, 12=C, 13=D, 14=E, 15=F. Write a C program that reads a number and display whether the number is prime or not. STEP 5 - Recombine the answer and then proudly display it!7510 is 4B16 You should always check the Hex answer you got. 4B16 = (4 x 16) + (11x 1) = 7510 so our answer is correct. t may seem a little long-winded, but this method is very mechanical. Once you've done a few, you'll be an expert. Besides, it's good practice for binary conversion!.You can use this method to convert from Hex to decimal, too! Start at Step 5 and work backwards to Step 4, then 3, 2 and 1. 8 – Using the above method, and showing Octal (base 8) This number system is another important numbering system in computing. Octal, or the base 8 system, uses 8 digits: 0, 1, 2, 3,4, 5, 6 and 7. We have already seen that a digit's worth depends on what position it is in relative to the other digits. • Base 10 positions are worth 107, 106, 105, 104, 103, 102, 101, 100 • Base 2 positions are worth 27, 26, 25, 24, 23, 22, 21, 20 • Base 16 positions are worth 167, 166, 165, 164, 163, 162, 161, 160 You probably have guessed what the positions in the base 8 system are worth:87, 86, 85, 84 83, 82, 81, 80 So, for example: • 248 in decimal is (2 * 8) + (4 x 1) = 2010 • 3618 in decimal is (3 x 64) + (6 x 8) + (1 x 1) = 24110 • 41258 in decimal is (4 x 512) (1 x 64) + (2 x 8) + (5 x 1) = 213310 As with Hex, it is slightly easier going from Octal to decimal than from decimal to Octal. Again like Hex, we can make use of the fact that Octal is related very closely to binary! We are going to convert 7810 into an Octal number. STEP 1 - Convert 7810 into binary. STEP 2 - Add an extra zero bit on the left, so you have 9 bits in total. 001001110 STEP 3 - Split the number into thirds. STEP 4 - Treat each third as a 3-bit number. Convert each 3-bit number straight into Octal! (Remember, in Octal, you use 0, 1, 2, 3, 4, 5, 6 and 7). STEP 5 - Recombine the numbers and proudly display the answer! 7810 is 1168 You should always check the Octal answer you got. 1168 = (1 x 64) + (1 x 8) + (6 x 1) = 7810 so our answer is correct. Let’s do another example. We are going to convert 3110 into an Octal number. STEP 1 - Convert 3110 into binary. STEP 2 - Add an extra zero bit on the left, so you have 9 bits in total. 000011111 STEP 3 - Split the number into thirds. STEP 4 - Treat each third as a 3-bit number. Convert each 3-bit number straight into Octal! (Remember, in Octal, you use 0, 1,2, 3, 4, 5, 6 and 7). STEP 5 - Recombine the numbers and proudly display the answer!3110 is 0378 which is 378 (as leading zeros in front of numbers are irrelevant).You should always check the Octal answer you got. 378 = (3 x 8) + (7 x 1) = 3110 so our answer is correct. You can use this method to convert from Octal to decimal, too! All you do is start at Step 5 and go backwards to Step 1! After a bit of practice, you can miss out Step 2! It's only there for 'balance' and can be omitted once you know what you are doing. hod, and showing. Binary Coded Decimal (BCD) So far, we have stored numbers as binary, or in a form very close to binary such as Octal and Hex. This is very useful, and allows us to do maths on the codes. In some applications, however, it is more important to maintain a link between the position of a decimal number and the way it is represented in binary. It is useful where you need to store the digits as data type 'character', where you don't do any actual processing on them. An example is a coded sales number. A mail order company uses codes such as 24361885. This isn't a number! It's a code made up of characters (not 'numbers' in the sense of 'an amount'). The first two characters might be a product code, the third character might be a country code and so on. Now you never 'add' or 'subtract' or do any other maths operations on these codes, but you might need to strip out parts of the code at some point. For example, if you needed to know the country, you would strip out the country character. You could store each character as a byte. If you did this you would need 8 bytes in total (because there are 8 characters). But that is inefficient compared to storing it using BCD. In this system, each character would only need 4 bits, so you would only need a total of 4 bytes to store 8 characters. Another example of the use of BCD is when you need to store the codes that get displayed on a calculator. Binary Coded Decimal (BCD) is a method for doing just this. You can store each separate digit in a number as a 4 bit code. Each one can then be sent to each part of the display unit that displays just one digit. The BCD can be quickly decoded and turned into instructions that tell the calculator which digit to display. BCD conversion is very straightforward!! Work through this example Convert 34529110 into BCD. STEP 1 - Break up the individual digits in the denary number STEP 2 - Convert each digit into a 4 bit binary number. STEP 3 - Proudly display your answer! 0011 0100 0101 0010 1001 0001 Representations of Fractions Binary Fractions f n-1 f n-2 . . . f2 f 1 f 0 . f-2 f-3 f ... | | binary point The decimal value is calculated in the same way as for non-fractional numbers, the exponents are now negative. Example: 101.001 (binary) 1 x 22 + 1 x 20 + 1 x 2-3 4 + 1 + 1/8 5 1/8 = 5.125 (decimal) 2-1 = .5 2-2 = .25 2-3 = .125 2-4 = .0625 etc. Converting Decimal to Binary Fractions Consider left and right of the decimal point separately. The stuff to the left can be converted to binary as before. Use the following algorithm to convert the fraction: Fraction fraction x 2 digit right of point .8 1.6 1 <-- most significant (f ) .6 1.2 1 .2 0.4 0 .4 0.8 0 -1 .8 (it must repeat from here!) Ans: .8 is .1100 Non-Binary Fractions Same as with binary, only the base changes! f n-1 f n-2 . . . f2 f 1 f 0 . f-2 f-3 f ... | | radix point The decimal value is calculated in the same way as for non-fractional numbers, the exponents are now negative. Example: 101.001 (octal) 1 x 82 + 1 x 80 + 1 x 8-3 64 + 1 + 1/512 65 1/512 = 65.0019 (approx) 13.a6 (hexadecimal) 1 x 161 + 3 x 160 + a x 16-1 + 6 x 16-2 16 + 3 + 10/16 + 6/256 19 166/256 = 19.64 (approx) QUESTION AND ANSWERS PART A(2 Marks) 1. WRITE THE VARIOUS CHARACTERISTICS OF COMPUTERS. The various characteristics of computer are: Speed Endurance Memory Reliability Versatility Resource sharing Accuracy Decision-making Diligence 2. WRITE THE TECHNOLOGIES USED IN VARIOUS COMPUTER GENERATIONS. The various technologies used in carious generations are: First generation – Vacuum tubes Second generation – Transistors Third generation – Integrated circuits (IC s) Fourth generation – Microprocessors (Large scale integrated circuits -LSI) Fifth generation – very large scale integrated circuits (VLSI) 3. WRITE THE STEPS INVOLVED IN SOFTWARE DEVELOPMENT PROCESS. The various steps involved in the software development process are: Analyzing Designing Prototyping Development Evaluation Documentation Integration Maintenance Review 4. WRITE SOME OF THE APPLICATIONS OF COMPUTERS. There are many commendable applications of computers. Some of them are: Science and technology Entertainment Business Education Publishing Communication Hospitals Defense 5. DEFINE CACHE MEMORY? A small memory between CPU and main memory is called cache. The speed is equal to the CPU. Cache memory acts as a high speed buffer between CPU and Main memory. 6 .DEFINE LAPTOP Laptop is called as portable computers. They have normal features of Desktop computers. As the name specifies it can be used anywhere/anytime. 7. WHAT ARE THE BASIC OPERATIONS OF COMPUTER? Input Process Storing Controlling and Output. 8. DEFINE DATA AND INFORMATION. Data: Raw material for information processing Information: The processed data is called information. 9. WHAT ARE THE DIFFERENT TYPES OF ROM? Masked ROM, PROM EPROM EEPROM Flash ROM 10. . DEFINE ANALOG COMPUTERS ,DIGITAL COMPUTERS AND HYBRID COMPUTERS Analog Computers:Input data is continuously changing electrical and nonelectrical information. The computation is carried out through physical quantities such as voltage, length and current. Output is in the form of graph. These computers are less accurate and slow. Digital Computers:In digital computers the input and output data is discrete in nature. It is usually represented by binary notation (0’s & 1’s). It is highly suitable for business and scientific application. Hybrid computer is a computer, which has features of both analog and digital computers. It is used in weather monitoring, intensive care unit (ICU) in hospitals. PART B (16 Marks) 1. Briefly Explain the Computer Generation Answer: First Generation :Vacuum Tubes o Characteristics of first generation Second Generation: Transistors o Characteristics of Second Generation Computers Third Generation: Integrated Circuits o Characteristics of Third Generation Computers Fourth Generation: Microprocessors o Characteristics and Fourth Generations Computers Fourth Generation: Microprocessors Characteristics and Fourth Generations Computers Fifth Generation – (Present and Beyond) : Artificial Intelligence 2. Write detail note about Classification of Computers Answer: Classifications of computers Microcomputer Minicomputers Workstations Network Servers Mainframe Computers Supercomputers 3. Explain the different components o f a computer system with block diagram Answer: Input: Storage: Processing Output: Control: Functional Units Memory System 4. Explain the memory unit in a Computer. Answer: Memory System In A Computer capacity of primary memory o RAM o ROM o PROM o EPROM o Cache memory o Registers secondary storage 5. What is number System? Explain all the number conversion with an example. Answer: The binary number system An example of using the binary system Hexadecimal (Hex - base 16) A better way to convert into and out of Hex Octal (base 8) Binary Coded Decimal (BCD) Representations of Fractions Binary Fractions 6. Discuss about the evolution of computers. Answer: 1. ABACUS, 2. Analog computers 3. Pascal's machine 4. Digital computer 5. Punch cards 6. Modern Digital Systems 7. a).What are the characteristics of a computer? Discuss Answer: 1. Speed 2. Reliability 3. Accuracy 4. Digilience 5. Storage Capacity 6. Versatility 7. Resource Sharing 8. Interactive Computing b)Write short notes on functional units of computers. Answer: Arithmetic Logical Unit (ALU) Control Unit (CU) Central Processing Unit (CPU) 8. Briefly explain the various types of Microcomputers. Answer: o Desktop Computers o Note book / Laptop Computers o Tablet Computers o Handheld computers o Smart Phones 9. a) Convert the decimal number 0.8125 into binary equivalent. Ans:0.1101 b) Convert the decimal number 22.64 into hexadecimal ,binary and octal number, Ans: Hex: 16.A3D7 Binary: 10110.1010001111010111 Octal: 26.5075 10. a)Convert the following binary number 100100000000 to decimal, hexadecimal, and Octal Answer: Decimal: 2304 Hexadecimal: 900 Octal: 4400 b) Convert the following hexadecimal number 20.599 to decimal, binary, and Octal Answer: Decimal: 32.35 Binary: 100000.010110 Octal: 40.2631