CHAPTER 1 WHAT IS A

1.1 Introduction It seems nowadays everyone has a computer or two and if not they are looking to buy one. The reasons people buy have become about as varied as the number of people buying them. We know computers can do a multitude of tasks, some to entertain, some more productive and some simply to pass the time. But just what is a computer?

1.2 What is a computer? A computer is an electronic machine that takes in data and instructions (input), works with the data (processing) and puts out information (output). This definition is further explained as follows: Computers are made of hardware: · input devices such as the keyboard and mouse · the (CPU) and memory · storage devices such as hard drives · output devices such as printers and monitors And software (the instructions that tell the computer what to do): · system software · Programs (application software). A computer is a general-purpose machine that processes data according to a set of instructions that are stored internally either temporarily or permanently. The computer and all equipment attached to it are the hardware. The instructions that tell it what to do are the software. A set of instructions that perform a particular task is called a program or software program.

1.3 Generations of Computers The computer has experienced five generations, with the fifth generation still very much in development. · First Generation · Second Generation · Third Generation · Fourth Generation · Fifth Generation

1.3.1 First Generation This generation of computers was developed at the University of Manchester, England. It was described as a vacuum tube-based electronic computer. The Univac 1 in 1951 was one of the earliest versions. 2 CHAPTER 1

'Machine language' or 'machine code' was the first generation of computer languages. The first machine code involved inputting a sequence of binary numbers directly into the program memory through simple toggle switches.

The vacuum tube equivalent of a transistor This method of 0 and 1 programming was very laborious. With the introduction of keyboards, individual letters could represent single instructions. Although this saved time the code was not easy to understand and so other methods of programming were needed. New 'higher level' programming languages have developed.

1.3.2 Second Generation The second generation of computers used solid state components to replace vacuum tubes. The reduction of cost and size was made possible by the development of transistors. They originated in the late 1950s. Assembly Language formed the second generation of computer languages. Assembly makes use of a list of simple operations that a computer can perform. These operations are contained within the Instruction Set. The basic Instruction Set includes several types of instructions written using short words called 'Mnemonics' which are recognizable abbreviated versions of English words. A solid state transistor

1.3.3 Third Generation In this generation, integrated circuits replaced several individually wired transistors. This development provided computers that were smaller and more reliable. These originated in the early 1960s. The languages that proceeded this generation were referred to as 'low-level' languages. Third generation languages were the first ones to be referred to as 'high-level' languages. The benefits of this generation of languages are: 1. It became less time consuming to produce code and, as a result, less costly to produce programs. 2. Programmers did not have to familiarize them selves with the internal architecture of the computer, making programming available to a wider range of individuals. Programming Languages classified in this generation were... · FORTRAN · C · BASIC · COBOL

1.3.4 Fourth Generation This generation of computers is founded on . Fourth generation computers have been made readily available to us because of the development of the microchip. Large-scale integration technology allowed thousands of transistors to be constructed on one small slice of silicon material. This technology originated in the mid 1970s. The majority of computers you will come into contact with today are of this generation. A modern microchip

WHAT IS A COMPUTER 3

The increasing use of computers in business led to the need for the development of new programming methods that could quickly satisfy the needs of users. General areas that had to be addressed included: · the need to speed up the software development process · the need for user friendly programming languages enabling less technical people to become involved in the programming process

1.3.5 Fifth Generation This generation of computers represents a unification of four separate areas of research: · knowledge-based expert systems · very high-level programming languages · decentralized computing · Very Large-Scale Integration technology (VLSI). Computers of this generation make use of parallel processing and they are capable of performing multiple, simultaneous instructions using more than one micro processing chip. Fifth generation languages are normally associated with the field of artificial intelligence. Artificial intelligence, built up through logic programming, models a real world environment or situation. Artificial intelligence aims to support flexible and informed patterns of behavior within a computer The main contenders within the fifth generation language category are: · Prolog 2 · Expert Systems · Knowledge Based Systems

1.4 Range of Computers There are several ranges of computers in use today: 1. embedded system computers 2. microcomputers 3. minicomputers 4. mainframe computers 5. supercomputers

1.4.1 Embedded Systems RANGE: Embedded systems contain microprocessors pre- programmed to perform a dedicated task required by the device they control. APPLICATION: Examples are dedicated word-processing machines, chips in washing machines, printers and hand held calculators. PRICE: Prices depend on the application

washing machine uses pre-programmed microchips

4 CHAPTER 1

1.4.2 Microcomputers RANGE: Microcomputers use single chip processors and are known as PCs (personal computers). APPLICATION: The rapid increase in the speed and memory of the PC has extended its use from single applications to multi- tasking applications. The general trend has been to have several PCs linked together in a network in order to share peripherals such as printers. This practice is reducing the popularity of mini- computers and mainframes. PRICE: between $700 - $2000 A personal computer

1.4.3 Minicomputers RANGE: These perform multi-tasking and allow many terminals to be connected to their services. APPLICATION: The ability to connect minicomputers to each other and mainframes has popularized them among larger businesses. This use is being challenged by the developments in the microcomputer range and the practice of sharing resources of microcomputers under a network. Minicomputers are still recognized as being able to process large amounts of data. PRICE: between $15,000 - $150,000

A VAX minicomputer

1.4.4 Mainframe Computers RANGE: Mainframe computers are large general purpose computers. APPLICATION: Mainframe computers generally require special attention and are kept in a controlled atmosphere. They are multi-tasking and generally used in areas where large databases are maintained e.g. government departments and the airline industry. PRICE: $ millions A ViON mainframe computer manufactured by Hitachi*

1.4.5 Supercomputers RANGE: Supercomputers operate very fast and have multiple processors. There are very few of these machines in existence due to their cost. APPLICATION: This type of computer has been developed for scientific applications usually involving complex arithmetic and mathematical operations. One such use is in weather forecasting.

PRICE: $ millions A CRAY T90 Series supercomputer*

1.5 Basic Computer System A digital computer is not actually a single machine, in the sense that most people think of computers. Instead it is a system composed of five distinct elements: (1) a central processing unit (2) input devices (3) memory storage devices (4) output devices (5) A communications network, called a "bus," that links all the elements of the system and connects the system to the external world. WHAT IS A COMPUTER 5

1.5.1 Central Processing Unit (CPU) The CPU may be a single chip or a series of chips that perform arithmetic and logical calculations and that time and control the operations of the other elements of the system. Miniaturization and integration techniques made possible the development of a CPU chip called a , which incorporates additional circuitry and memory. The result is smaller computers and reduced support circuitry. Microprocessors are used in most of today's personal computers. Most CPU chips and microprocessors are composed of four functional sections: (1) an arithmetic/logic unit (2) registers; (3) a control section (4) an internal bus.

Units of a processor chip (CPU) The arithmetic logical unit (ALU) The arithmetic logical unit (ALU) is responsible for performing arithmetic and logical operations and comparisons of data.

Registers The CPU also contains a small high speed memory which is used to store temporary results and control information. This memory consists of a number of registers, each performing a specific function. · Accumulators - serve the purpose of holding data used in calculations. · Address Registers - are used for storing the memory location of data or instructions to be used by a program. · Stack Pointer - this register is used during sub-routine nesting and stack based arithmetic. · Status Register - this register provides a service to the CPU by maintaining the status of the last operation carried out by the ALU. · Instruction Pointer - sometimes referred to as the program counter, the pointer is responsible for retaining the memory address of the next instruction to be executed

Control Unit Tasks carried out by a CPU are listed below: 1. decoding the instructions within a computer 2. sequencing the reading and writing of data within the CPU and externally on the data bus 3. controlling the sequence in which instructions are executed 4. controlling the operations performed by the ALU

6 CHAPTER 1

Internal bus Internal bus, a network of communication lines that connects the internal elements of the processor and also leads to external connectors that link the processor to the other elements of the computer system. The three types of CPU buses are: (1) a control bus consisting of a line that senses input signals and another line that generates control signals from within the CPU. (2) the address bus, a one-way line from the processor that handles the location of data in memory addresses. (3) the data bus, a two-way transfer line that both reads data from memory and writes new data into memory.

Fetch and Execute The illustration of the operations performed within a computer during a fetch and execute cycle.

The control bus performs a read operation:

The control unit in the CPU prompts memory to put the instruction onto the data bus enabling the CPU to read the instruction onto its instruction decoder which is part of the control unit:

The next step involves the CPU decoding the instruction.

This instruction is then executed. For example, if the instruction is for the Control Unit to load the contents of the memory location 112 into the accumulator:

WHAT IS A COMPUTER 7

Performing a write operation The control unit sets the address bus to location 112 and puts the value of the accumulator onto the data bus. Finally the control bus performs a memory write operation:

1.5.2 Input Devices These are physical equipment which reads or translates data consisting of alphabets, numbers or other symbols into electronic impulses which can be understood by the computer. The purpose of input devices is to pass information into the memory unit of the CPU and convert the characters (letters, numbers, and other symbols) into binary patterns which can be held inside the computers memory. Typical input devices are listed below. · Keyboard · Optical Mark Reader · Mouse (OMR) · Joystick · · Digitising Tablet · Bar Codes · Touch Sensitive Screen · Magnetic Reader · · Smart Cards · Space Mouse · Voice Data Entry · Digital Stills Camera · Sound Capture · Magnetic Ink Character · Video Capture Recognition (MICR)

8 CHAPTER 1

Keyboard The Keyboard is the standard data input and operator control device for a computer. It consists of the standard QWERTY layout with a numeric keypad and additional function keys for control purposes. A standard QUERTY keyboard Mouse The Mouse is a popular . You move it across the desk and its movement is shown on the screen by a marker known as a 'cursor'. You will need to click the buttons at the top of the mouse to A select an option. A mouse contains a rotating ball with two rollers held at right angles to each other which touch the ball. The rollers register the x and y axis movements of the ball.

How a mouse works Each roller is attached to an optical encoder, a disc which has gaps in its surface. The rotation of the encoder interrupts two beams of light between the LEDs and their detectors. These pulses of light are fed to the computer and are used to determine the speed and direction of the mouse's movement.

Joystick The joystick is a rotary lever. Similar to an aircraft's control stick, it enables you to move within the screen's environment, and is widely used in the computer games industry.

A joystick

Digitising Tablet A Digitising Tablet is a that facilitates the accurate input of drawings and designs. A drawing can be placed directly on the tablet, and the user traces outlines or inputs coordinate positions with a hand-held stylus. A digitising tablet with pen

Touch Sensitive Screen A Touch Sensitive Screen is a pointing device that enables the user to interact with the computer by touching the screen. There are three forms of touch screen: pressure-sensitive, capacitive surface and light beam.

A touch sensitive monitor WHAT IS A COMPUTER 9

Light Pen A Light Pen is a pointing device shaped like a pen and is connected to a VDU. The tip of the light pen contains a light-sensitive element which, when placed against the screen, detects the light from the screen enabling the computer to identify the A light pen location of the pen on the screen. Light pens have the advantage of 'drawing' directly onto the screen, but this can become uncomfortable, and they are not as accurate as digitising tablets.

Space Mouse The Space mouse is different from a normal mouse as it has an X axis, a Y axis and a Z axis. It can be used for developing and moving around 3-D environments.

Digital Stills Camera A space mouse Digital Stills Cameras capture an image which is stored in memory within the camera. When the memory is full it can be erased and further images captured. The digital images can then be downloaded from the camera to a computer where they can be displayed, manipulated or printed. A digital stills camera

Optical Mark Reader (OMR) The Optical Mark Reader (OMR) can read information in the form of numbers or letters and put it into the computer. The marks have to be precisely located as in multiple choice test papers.

Scanners A sample multiple choice answer paper Scanners allow information such as a photo or text to be input into a computer. Scanners are usually either A4 size (flatbed), as shown below or hand- held to scan a much smaller area. If text is to be scanned, you would use an Optical Character Recognition (OCR) program to A flatbed scanner used for digital image input recognise the printed text and then convert it to a digital text file that can be accessed using a computer.

Bar Code Reader You might have seen bar codes on goods in supermarkets, in libraries and on magazines. Bar codes provide a quick method of recording the sale of items. A bar code is a pattern printed in lines of differing thickness. The system gives fast and error-free entry of information into the computer. An infra-red bar A bar code code reader 10 CHAPTER 1

Magnetic Reader This input device reads a magnetic strip on a card. Handy for security reasons, it provides quick identification of the card's owner. This method is used to run bank cash points or to provide quick identification of people entering buildings.

A C r e d it c a r d s ho w i ng t h e m a gn e ti c s t r i p Smart Cards This input device stores data in a microprocessor embedded in the card. This allows information, which can be updated, to be stored on the card. This method is used in store cards which accumulate points for the purchaser, and to store phone numbers for cellular phones. A store card showing the square microprocessor chip

Voice Data Entry This system accepts the spoken word as input data or commands. Human speech is very complex, involving emphasis and facial expressions, so complete voice recognition will not be developed for some time. However, simple commands from one user can be used to control machines. A used for data input In this way a paralysed person can operate a wheelchair or control heating and lighting.

Sound Capture With the addition of a in one of the expansion slots of your computer you can "record" voice or music. The sound card digitizes the information into a form that the computer can understand.

A sound card

Video Capture With a video capture board in one of your computer's expansion slots you can capture video (photographic) images through a video camera. The video capture board digitizes the image. A video capture card

1.5.3 Output Devices The output devices are also physical equipment which translates the outcome of the computations and related activities carried out in the CPU so that there can be understood by humans. The purpose of the output devices is to convert data and information expressed in electronic impulses to human understandable forms such as printed report. Some examples are shown below. WHAT IS A COMPUTER 11

· VDU or Monitor · Ink Jet Robot · Printer · Machine Tool · Impact Printer · Synthesized Voice · Dot Matrix Printer · · Daisywheel Printer · Flatbed Plotter · Non-Impact Printer · Drum Plotter · Thermal Printer · Electrostatic Plotter · Laser Printer

VDUs Visual Display Units (VDU) or monitors are used to visually interface with the computer and are similar in appearance to a television. Visual Display Units display images and text which are made up of small blocks of coloured light called pixels. The resolution of the screen improves as the number of pixels is increased. Most monitors have a 4:3 width to height ratio. A cathode ray monitor

VDUs - Screen Resolution The standard user interface on the PC was originally a text- only mode. With the increased resolution of VDUs applications are now written in graphics mode using individual pixels. A recent standard has been 640 x 480 pixels on the screen (this is called VGA) and the present standard is 800 x 600 (called SVGA). This has enabled the use of an increasingly sophisticated visual interface, utilizing graphical user interfaces Diagram of different screen resolutions (GUIs) such as Microsoft Windows and MAC OS as well as more highly developed user friendly software.

Printers You can print out information that is in the computer onto paper. By printing you create what is known as a 'hard copy'. There are different kinds of printers which vary in their speed and print quality. The two main types of printer are impact and non-impact.

Impact Printer Impact Printers use a print head containing a number of metal pins which strike an inked ribbon placed between the print head and the paper. Some print heads have only 9 pins to make the dots to build up a character; some have 24 pins which produce a better resolution.

An impact printer showing detail of print head 12 CHAPTER 1

Dot Matrix Printer Characters are formed from a matrix of dots. The speed is usually 30 - 550 characters per second (cps). This is the cheapest and noisiest of the printer family. The standard of print obtained is poor. These printers are cheap to run and relatively fast. They are useful for low quality carbon copy printing. A dot matrix printer

Daisywheel Printer Molded metal characters like those in a typewriter are mounted on extensions attached to a rotating wheel and are printed onto the paper by means of a hammer and print ribbon. This results in a great deal of movement and noise during the printing of documents, so printing is slow (less than 90 cps). The standard of print is similar to that produced by an electric typewriter. As the characters on the wheel are fixed, the size and font can only be changed by using a different wheel. However, this is very rarely done. A daisy wheel showing detail of the characters

Non-Impact Printers Non-impact printers are much quieter than impact printers as their printing heads do not strike the paper. Most non-impact printers produce dot-matrix patterns. Several different technologies have been used to provide a variety of printers. The main types of non-impact printer are: · Thermal Printer · Laser Printer · Ink Jet Printer

Thermal Printers Characters are formed by heated elements being placed in contact with special heat sensitive paper forming darkened dots when the elements reach a critical temperature. Thermal printer paper tends to darken over time due to exposure to sunlight and heat. The standard of print produced is poor. Thermal printers are widely used in battery powered A fax machine uses a thermal printer equipment such as portable calculators.

Laser Printer Laser Printers use a laser beam and dry powdered ink to produce a fine dot matrix pattern. This method of printing can generate about 4 pages of A4 paper per minute. The standard of print is very good and laser printers can also produce very good quality printed graphic images too. A laser printer

WHAT IS A COMPUTER 13

How It Works A photoconductive drum is initially charged and then a high intensity laser beam is used to discharge selected areas on the drum. These discharged areas correspond to the white areas of the printed document. Toner is attracted to parts of the drum with a high charge. The drum rotates and transfers the toner to the paper which has an even greater electrical charge. Finally a heater fixes the toner onto the paper.

How a laser printer works Ink Jet Printers Characters are formed as a result of electrically charged or heated ink being sprayed in fine jets onto the paper. Individual nozzles in the printing head produce high resolution (up to 400 dots per inch or 400 dpi) dot matrix characters. Inkjet printers use colour cartridges which combine magenta, yellow and cyan inks to create colour tones. A black cartridge is also used for crisp monochrome output. This method of printing can generate up to 200 cps and allows for good quality, cheap colour printing.

Robots Robots are able to perform a variety of tasks as a result of executing instructions contained within a program. We are still a long way from the science fiction robots and androids portrayed by the film industry. Robots in a business sense mean automated machines designed to perform mundane operations which require A robot arm accuracy, such as assembling cars. They are seldom manufactured to resemble the human form.

Machine Tool Computer Aided Manufacturing (CAM) tools are used to manufacture a variety of products. Repetitive functions are controlled by sets of computer instructions. Machine tools automate factory production and have the advantage over humans of high accuracy, and they never require a coffee break!

Voice Voice synthesis has a robotic sound due to the difficulties of replicating the complexities of human speech and pronunciation. Voice answer back (VAB) is used to respond to telephone enquiries, such as the speaking clock. Educational applications include "Speak & Spell" and arithmetic trainers. A speak and spell toy 14 CHAPTER 1

Plotters are used to produce graphs or diagrams. Plotters can be of two types: · Pen plotters · Electrostatic plotters Pen plotters have an ink pen attached to draw the images, and electrostatic plotters work similarly to a laser printer.

Flatbed Plotter This is a plotter where the paper is fixed on a flat surface and pens are moved to draw the image. This plotter can use several different colour pens to draw with. The size of the plot is limited only by the size of the plotter's bed. Top view of a flat bed plotter

Drum Plotters In drum plotters the pen is moved in a single axis track and the paper itself moves on a cylindrical drum to add the other axis or dimension. The size of the graph is therefore limited only by the width of the drum and can be of any length.

A drum plotter Electrostatic Plotter An Electrostatic Plotter produces a raster image by charging the paper with a high voltage. This voltage attracts toner which is then melted into the paper with heat. This type of plotter is fast, but the quality is generally considered to be poor when compared to pen plotters.

Storage Devices In many cases the information that has been processed is stored in machine-readable format so that it may be accessed at a later time by a computer. This data is stored in binary form in 'bits'. This practice requires the use of storage devices.

1.5.4 Storage Devices: · Hard Disk · Magnetic Tape · · Optical Disk · Punched Cards & Paper Tape

A variety of storage devices

WHAT IS A COMPUTER 15

Hard Disk The hard disk is direct-access storage medium with a rigid magnetic disk. The data is stored as magnetized spots arranged in concentric circles (tracks) on the disk. Each track is divided into sectors. The number of tracks and sectors on a disk is known as its 'format'.

Hard disk showing internal mechanisms

Magnetic Tape A recording medium consisting of a thin tape with a coating of a fine magnetic material, used for recording analogue or digital data. Data is stored in frames across the width of the tape. The frames are grouped into blocks or records which are separated from other blocks by gaps. A JAZTM drive with cartridge -

one of the many types of magnetic storage devices available Magnetic tape is a serial access medium, similar to an audio cassette, and so data (like the songs on a music tape) cannot be quickly located. However large amounts of information can be stored within magnetic tape. This characteristic has prompted its use in the regular backing up of hard disks.

Floppy Disk A floppy disk is a thin magnetic-coated disk contained in a flexible or semi-rigid protective jacket. Data is stored in tracks and sectors. The floppy disks are usually 3.5" in size. However, older floppy disks may be in use; these would be 5.25" in size. Double sided high density 3.5" disks can hold 1.44 Mb of data. Once data is stored on a floppy disk it can be 'write protected' by clicking a tab on the disk. This prevents any A 3.5" floppy disk new data being stored or any old data being erased.

Optical Disk An optical disk is impressed with a series of spiral pits in a flat surface. A master disk is burnt by high-intensity laser beams in bit- patterns from which subsequent copies are formed which can be read optically by laser. The optical disk is random access storage medium; information can be easily read from any point on the disk. A standard CD- A CD-ROM ROM can store up to 650Mb of data, with 14,500 tracks per inch (tpi). 16 CHAPTER 1

CD-ROM stands for Compact Disk - Read Only Memory. It is now possible to have CD- ROMs where extra tracks of information can be written onto them by the user. These are called read/writable CD-ROMs and these are becoming a popular and cheap method for storage.

Punched Cards & Paper Tape These are media which were popular in the past but their use required large storage space and was time-consuming. With the development of hard disks and other storage devices their use has practically disappeared.

A strip of paper tape

1.6 Problems 1. What is a computer? Why is it known as data processor? 2. What are the important characteristics tics of computer? 3. Write a short note on Fifth generation of computer. What makes it different from Fourth generation computer ? 4. Why did the size of computer get reduced in third generation computer? 5. Distinguish between Microcomputer and Mainframe computer. 6. What are program , programming and software? 7. Differentiate between system and application software. 8. What is the difference between FORTRAN and COBOL? 9. Differentiate between machine language and Assembly language. 10. What is the difference between interpreter and compiler? 11. Give some examples of high level language. 12. Name the three different categories of computer languages . 13. What is machine language? Why is it required? 14. What are advantages and disadvantages of machine language? 15. What is assembly language? What are its advantages over machine language? 16. What is the difference between source program and object program? 17. What is higher level languages? Why are higher level languages are easier to use? 18. Give List the five basic parts of a microcomputer. 19. How are data moved from one unit to another in a microcomputer? 20. What is the purpose of the CPU? 21. List two functions of the bus controller. 22. Give some examples of input devices 23. Give some examples of output devices. 24. What is the difference between RAM and ROM? 25. How many 8KB memory units are required to store 64MB.