Computer Science S4 Student’s Book PDF

Document Details

UndisputableFallingAction7488

Uploaded by UndisputableFallingAction7488

Kigali Institute of Science and Technology

2020

Tags

computer science textbook computer science computer fundamentals education

Summary

This book is a computer science textbook for senior four students in Rwanda. It covers foundational topics including computer fundamentals, architecture, software, number systems, logic gates, algorithms, and programming, with a focus on the Rwandan curriculum. This book is a great resource for senior four students, and covers all areas of computer science study.

Full Transcript

Computer Science Senior Four Student’s Book © 2020 Rwanda Education Board All rights reserved This book is property of the Government of Rwanda. Credit must be given to REB when the content is quoted. CONTENTS Unit 1: COMPUTER FUNDAMENTALS....

Computer Science Senior Four Student’s Book © 2020 Rwanda Education Board All rights reserved This book is property of the Government of Rwanda. Credit must be given to REB when the content is quoted. CONTENTS Unit 1: COMPUTER FUNDAMENTALS.....................................1 Key Unit Competency.......................................................................................... 1 Unit Outline......................................................................................................... 1 Introduction.......................................................................................................... 1 Definition of a computer and computer science.................................................. 1 Characteristics of Computers............................................................................. 2 Classification of Computers................................................................................. 3 History of Computers........................................................................................... 3 Role of Computers in Society............................................................................ 13 Unit Test 1.......................................................................................................... 15 Unit 2: COMPUTER ARCHITECTURE & ASSEMBLY.........16 Key Unit Competency........................................................................................ 16 Unit Outline....................................................................................................... 16 Introduction....................................................................................................... 16 Computer System............................................................................................... 16 Computer Functions........................................................................................... 18 Computer hardware............................................................................................ 18 Internal Computer Components......................................................................... 27 Assembling Desktop Computers........................................................................ 41 Replacing laptop battery.................................................................................... 47 Upgrading Laptop Memory............................................................................... 48 Disassembling Desktop Computer..................................................................... 48 Cleaning and Disposal of Computer Components............................................. 51 Unit Test 2.......................................................................................................... 53 Unit 3: SAFE & ETHICAL USE OF COMPUTERS.................54 Key Unit Competency........................................................................................ 54 Unit Outline....................................................................................................... 54 General Safety Guidelines................................................................................. 54 Ethical issues...................................................................................................... 60 iii Unit Test 3.......................................................................................................... 61 Unit 4: COMPUTER SOFTWARE INSTALLATION...............62 Key Unit Competency........................................................................................ 62 Unit Outline....................................................................................................... 62 Introduction........................................................................................................ 62 Classification of Computer Software................................................................. 62 Classification according to acquisition.............................................................. 64 Software Licensing........................................................................................... 65 Software Installation Fundamentals................................................................... 66 Disk Preparation................................................................................................. 67 Disk Management.............................................................................................. 69 Installing Operating System............................................................................... 74 Installing Device Drivers................................................................................... 81 Installing Application Software......................................................................... 82 Unit Test 4.......................................................................................................... 84 Unit 5: NUMBER SYSTEMS......................................................85 Key Unit Competency........................................................................................ 85 Unit Outline....................................................................................................... 85 Introduction........................................................................................................ 85 Fundamentals of Number Systems.................................................................... 85 Number Base Systems....................................................................................... 87 Converting Decimal to other Base Systems....................................................... 90 Binary to other Base System Conversion.......................................................... 94 Octal to Decimal Conversion............................................................................. 97 Octal to Hexadecimal conversion...................................................................... 97 Hexadecimal to Decimal Conversion................................................................ 98 Decimal Fraction to Binary Conversion............................................................ 99 Binary Fraction to Decimal Conversion.......................................................... 101 Negative Decimal to Binary Conversion......................................................... 102 Arithmetic Operations on Binary Numbers..................................................... 103 Unit Test 5........................................................................................................ 110 Unit 6: BOOLEAN ALGEBRA AND LOGIC GATES............ 111 Key Unit Competency...................................................................................... 111 iv Unit Outline..................................................................................................... 111 Introduction...................................................................................................... 111 Unit Outline..................................................................................................... 111 Circuits............................................................................................................. 111 Logic gates....................................................................................................... 113 Truth tables...................................................................................................... 114 Solving problems using logic circuits.............................................................. 117 Boolean algebra............................................................................................... 122 Unit Test 6........................................................................................................ 131 Unit 7: INTRODUCTION TO COMPUTER ALGORITHM.132 Key Unit Competency...................................................................................... 132 Unit Outline..................................................................................................... 132 Introduction...................................................................................................... 132 Algorithm Concept........................................................................................... 132 Design of Algorithms.................................................................................... 134 Variables........................................................................................................... 138 Constants.......................................................................................................... 142 Operators and Expressions............................................................................... 143 Read and Write functions................................................................................. 145 Unit Test 7........................................................................................................ 147 Unit 8: CONTROL STRUCTURES AND ONE DIMENSION ARRAY.................................................................148 Key Unit Competency...................................................................................... 148 Unit Outline..................................................................................................... 148 Introduction...................................................................................................... 148 Conditional logic.............................................................................................. 148 Control Structures............................................................................................ 150 One Dimensional Array................................................................................... 166 Unit Test 8........................................................................................................ 170 Unit 9: INTRODUCTION TO COMPUTER PROGRAMMING..........................................................171 v Key Unit Competency...................................................................................... 171 Unit Outline..................................................................................................... 171 Introduction...................................................................................................... 171 Computer Programming Concepts................................................................... 171 History of Programming languages................................................................. 173 High-level Programming Languages.............................................................. 175 Computer Programming Paradigms................................................................. 177 Features of Good Programming Language...................................................... 180 Unit Test 9........................................................................................................ 181 Unit 10: INTRODUCTION TO C++ PROGRAMMING....... 182 Key Unit Competency...................................................................................... 182 Unit Outline..................................................................................................... 182 Introduction...................................................................................................... 182 Evolution of C++............................................................................................ 182 Syntax of C++ Program................................................................................... 184 Input and Output Streams................................................................................ 188 Variables and Data types.................................................................................. 190 Constants.......................................................................................................... 196 Output Formatting............................................................................................ 198 Unit Test 10...................................................................................................... 201 Unit 11: OPERATORS AND EXPRESSIONS IN C++............ 202 Key Unit Competency...................................................................................... 202 Unit Outline..................................................................................................... 202 Introduction...................................................................................................... 202 Expressions and Operators............................................................................... 202 Classification of C++ Operators...................................................................... 203 Classication of C++ Expressions.................................................................... 214 Unit Test 11...................................................................................................... 218 Unit 12: CONTROL STATEMENTS IN C++........................... 220 Key Unit Competency...................................................................................... 220 vi Unit Outline..................................................................................................... 220 Introduction...................................................................................................... 220 Sequence Control Structure............................................................................. 220 Selection Control Structure.............................................................................. 221 Looping Control Statements in C++................................................................ 228 Jump Control Statements................................................................................. 237 Unit Tets 12...................................................................................................... 241 Unit 13: FUNCTIONS IN C++ PROGRAMMING.................. 243 Key Unit Competency...................................................................................... 243 Unit Outline..................................................................................................... 243 Introduction...................................................................................................... 243 Fundamentals of C++ Functions...................................................................... 243 Types of Functions........................................................................................... 244 User-defined Functions.................................................................................... 249 Function declaration......................................................................................... 252 Scope of variables and Constants.................................................................... 254 Recursive Functions......................................................................................... 257 Unit Test 13...................................................................................................... 260 Unit 14: ARRAYS IN C++ PROGRAMMING......................... 262 Key Unit Competency...................................................................................... 262 Unit Outline..................................................................................................... 262 Introduction...................................................................................................... 262 One-dimensional Array.................................................................................... 262 Creating one-dimensional array....................................................................... 262 Accessing Array Elements............................................................................... 266 Array of Characters.......................................................................................... 271 Unit Exercise 14............................................................................................... 275 Unit 15: INTRODUCTION TO OPERATING SYSTEMS..... 277 Key Competency.............................................................................................. 277 vii Unit Outline..................................................................................................... 277 Introduction...................................................................................................... 277 Definition of Operating System....................................................................... 277 Functions of operating systems........................................................................ 279 Desirable characteristics of operating systems................................................ 280 Components of operating systems................................................................... 282 Common operating systems............................................................................. 284 Smartphone operating systems........................................................................ 288 History of computer operating systems........................................................... 294 Types of operating systems.............................................................................. 296 Basic MS Dos commands and its main features.............................................. 298 Unit Test 15...................................................................................................... 302 Unit 16: HTML-BASED WEB DEVELOPMENT.................. 303 Key Unit Competency...................................................................................... 303 Unit Outline..................................................................................................... 303 Introduction...................................................................................................... 303 Fundamentals of World Wide Web.................................................................. 303 HTML Syntax and Structure............................................................................ 304 HTML Elements.............................................................................................. 308 Introduction to XHTML................................................................................... 314 Designing HTML Pages................................................................................... 318 Introduction to HTML5................................................................................... 335 Migration from HTML 4 to HTML5........................................................... 341 Unit Test 16...................................................................................................... 343 Unit 17: CASCADING STYLE SHEET.................................... 344 Key Competency.............................................................................................. 344 Unit Outline..................................................................................................... 344 Introduction...................................................................................................... 344 Definition of CSS............................................................................................. 344 HTML Styling and need for CSS..................................................................... 345 Comparison of HTML and CSS....................................................................... 346 viii CSS Syntax...................................................................................................... 346 Colours............................................................................................................. 350 Adding CSS to web pages............................................................................... 352 CSS Styles....................................................................................................... 355 Positioning...................................................................................................... 362 Floating............................................................................................................ 364 Creating a CSS page from Scratch................................................................... 369 Unit Test 17...................................................................................................... 386 Glossary........................................................................................ 387 ix x Computer Fundamentals Unit 1 COMPUTER FUNDAMENTALS Key Unit Competency By the end of the unit, you should be able to explain characteristics and evolution of computers and appreciate impact of computers in the society. Unit Outline Definition of computer science. Characteristics of computer. Classification of computer. Role of computers in society. History of computers. Introduction In the current generation, use of computers has become a common practice in classrooms, business, offices, entertainment, health, broadcasting, and many other areas. In this section, we discuss fundamental concepts, and characteristics, applications and evolution of computers. 1.1 Definition of a computer and computer science To adapt to the ever changing technologies, there is need to understand fundamental concepts, and characteristics of computers. Activity 1.1: Definition and parts of a computer 1. In groups of three, use search engines such as Google, or Bing to search for standard definitions of the following terms: Computer Computer Science 2. Fig. 1.1 below shows a typical type of a computer. Define and name the parts labelled (a) to (d). b a d c Fig. 1.1: Parts of a computer 1 Computer Fundamentals 1.1.1 Definitions Computer: A computer is an electronic device capable of receiving raw facts (data) and performing a sequence of operations on the data based on special computer instructions (processing) to produce desired output (information). Fig. 1.2 below illustrates this process. Input Output Data Process Information Fig. 1.2: Data processing in a computer Computer Science: Computer science is a branch of science that deals with theory of computation, or design and operation of computer hardware and software, and of the application of computers in all sectors. Activity 1.2: Computer science 1. Do some research on the internet and write an essay on areas of study within Computer Science. These may include artificial intelligence, information systems, networks, security, database systems, human computer interaction, vision and graphics, numerical analysis, programming, software engineering, health informatics, bioinformatics and computational theories. 2. Identify other fields of study that are related to Computers Science offered in most colleges and universities in Rwanda. 1.2 Characteristics of computers Though humans are more intelligent than computers, much of the activities from business to space exploration are now carried out with the support of computers. Does this imply computers are better than human beings? Activity 1.3: Characteristics of a computer Individually, do some research and write an essay describing why computers though not as intelligent as human beings, have characteristics that have made them preferred tools in the workplace. Some of the characteristics that should appear in the essay include: reliability, speed, accuracy, diligence, versatility, memory, feelings, intellectual ability. Upon completion of the essay, you should be able to appreciate that although computers do not have feelings and intelligence like human beings, they are: 1. Fast: A computer can perform in a few seconds the amount of work a human being can do in days, months or years. 2. Accurate: A computer is far much more accurate than human beings during data processing. The accuracy of the output obtained from a computer mainly depends on input provided. If the input is wrong, the computer processes wrong 2 Computer Fundamentals output hence the term Garbage In Garbage Out (GIGO). GIGO is a phrase used in computer science that implies that if invalid or erroneous data is entered into a computer (garbage in), the computer will process and output invalid or erroneous results (garbage out). 3. Versatile: Computers are versatile i.e. flexible in that they can be used to carry out different types of activities. For example, at one point using a word processor a computer can be programmed to process words like a typewriter and while using a spreadsheet to perform calculations like a calculator. 4. Reliable: Computers are more reliable because they do not get tired or bored in processing repeated work. 5. Power of remembering: Computers can store and recall high amount of information depending with the size of secondary storage media. 6. Diligent: Computers do not suffer from human related traits such as tiredness, and loss of concentration after working for long hours. 1.3 Classification of computers Activity 1.4: Classification of computer 1. In groups of three, use internet, magazines or other reference books to classify computers according to: Physical size and processing power. Functions they perform. Type of data they process. 2. Other than the above types of classifications, brainstorm on other factors that can be used to classify computers. Generally, computers can be classified using different criteria but the most common classifications are based on size, processing power, function, and type data processing. 1.3.1 Types of computers according to size and power When classified by physical size and processing power, computers can either be supercomputers, mainframe computers, minicomputers or microcomputers. 1.3.1.1 Supercomputers Supercomputers are the fastest, largest, most expensive and powerful computers available. They are able to perform many complex operations in a fraction of a second. Supercomputers are mainly used for scientific research, which requires enormous calculations. Some of the applications that justify use of supercomputers include aerodynamic design and simulation, petroleum research, defence and weapon analysis and telecommunications. Because of its weight, a supercomputer is kept in a special room as shown in Fig. 1.3. 3 Computer Fundamentals Fig. 1.3: Supercomputer Activity 1.5: Uses of supercomputers By doing research, explain how supercomputers are used by National Aeronautics and Space Administration (NASA) for aeronautics and aerospace exploration. 1.3.1.2 Mainframe computers Mainframe computers such as shown in Fig 1.4 are less powerful and cheaper than supercomputers. While supercomputers may be described as giant computers, mainframes are said to be big in size. They are used for processing data and performing complex mathematical calculations. They have a large storage capacity and can support a variety of peripherals. Mainframe computers are used as powerful data processors in large research institutions and organisations such as banks, hospitals and airports, which have large information processing needs. User operating a mainframe User sitted on mainframe terminal (a) Old mainframe (b) Modern mainframe Fig. 1.4: Mainframe computer Activity 1.6: Mainframe computers In groups, discuss and write a brief report on how mainframe computers are used in large organizations such as banks, hospitals, and airlines. 4 Computer Fundamentals 1.3.1.3 Minicomputers Minicomputers shown in Fig. 1.5 are also known as small-scale mainframes because they were cheaper alternative to mainframes computers. Like mainframes, minicomputers are used in business organisations, laboratories, research institutions, engineering firms and banks. Fig. 1.5: Minicomputer Activity 1.7: Distinction between mainframe and minicomputers In groups, use reliable sources on the internet draw clear distinctions between mainframe and minicomputers. 1.3.1.4 Microcomputers A microcomputer is the smallest, cheapest and relatively least powerful type of computer. It is called a microcomputer because its CPU is called a microprocessor, which is very small compared to that of minicomputers, mainframes and supercomputers. Microcomputers are commonly used in schools, business enterprises, cybercafé, homes and many other places. Today, the processing power of microcomputers has increased tremendously close that of minicomputers and mainframes. Types of Microcomputers Microcomputers may be classified into desktop and portable computers. A desktop such as shown in Fig. 1.6 are common types of microcomputer designed to fit conveniently on top of a typical office desk, hence the term desktop. Fig. 1.6: Desktop computer 5 Computer Fundamentals Portable computers are microcomputers small enough to be held by hand (hand- held) or placed on the laps while working (laptop). Examples of Portable computers include laptops (notebook), tablets, and smartphones. Fig. 1.7 shows illustrations of notebook PC and a tablet. Notebook PC Tablet Fig. 1.7: Microcomputers Activity 1.8: Types and uses of microcomputers 1. In the school environment, at home or in business organization, identify the following types of microcomputers: Desktop computers Notebooks/Laptop Tablets Palmtops 2. In discussion groups, research from reliable internet sites how the term microcomputer came into being. 3. Using the illustrations given below, identify each type of microcomputer. (a) (b) Fig. 1.8: Microcomputers 1.3.2 Types of computers according to functions Regardless of the size and processing power, a computer can be classified according to functions they perform. In this case, we have servers, workstations and embedded computers. Servers and workstations are general purpose computers used to provide access to resources on a network while special purpose computers are dedicated to a single task. 6 Computer Fundamentals 1.3.2.1 Servers A server is a dedicated computer that provides hardware or software resources to other computers on a local area network (LAN) or a over the Internet. Unlike desktop computers that have standard input and output devices attached, most servers such as shown in Fig. 1.9 do not require such peripheral devices because they are accessed remotely using remote access software. Because servers are expensive, a powerful desktop computer may be converted into a server by adding the appropriate hardware and software resources. Fig. 1.9: Servers Generally, servers may be classified according to the task they perform. For example, a file server provides massive storage devices dedicated to storing files while a print server is used to access to more printers, and a network server is a computer that manages network traffic. 1.3.2.2 Workstation A workstation is a name given to a computer connected to a server or network intended to be used by one person at a time, they are commonly connected to a server. This means that all users who utilize a computer at their job or school are using a workstation. Commercially, workstations are used for business or professional use such as graphics design, desktop publishing and software development. 1.3.2.3 Embedded computers Embedded computers are computing devices designed for a specific purpose. Generally, an embedded computer has an operating system that only runs a single application. Examples of embedded computing devices include dishwashers, ATM machines, MP3 players, routers, and point of sale POS terminals. 7 Computer Fundamentals Activity 1.9: Classification of computers 1. In the school environment, classify the following computers into servers, workstations, or embedded computers: Computer used to control access to hardware and software resources in a networked environment. Computer used to access hardware and software resources in a networked environment. Computer used in smart cards such as those used on ATMs and automated parking. 2. In your groups, discuss advantages and disadvantages of supercomputers over microcomputers. 1.3.3 Types of computers according to data type Computers can be classified into digital computers, analog computers or hybrid computers depending on the type of data they process. 1.3.3.1 Digital computers Digital computers perform calculations and logical comparisons by representing data and instructions as binary digits. This means that digital computers must convert data such as text, numbers, images, video and sound into a series of zeros and ones as represented by the signal waveform in Fig. 1.10. The data signal is either at 0V or 5V. In this case +5 or -5V represent a 1. Most of the computers used today such as desktop computers, laptops and tablets are digital computers. +5V 0V -5V Fig. 1.10: Digital signal 1.3.3.2 Analog computer These are computers that process data that is continuous (analog) in nature. An analog signal is one which has a value that varies smoothly from peak to minimum and vice- versa. For example, the sound waves that your mouth produces when you speak are analogue - the waves vary in a smooth way as shown in Fig 1.11. In the early days of computer evolution, most of the computers were analog in nature. Today analog computers are specialised devices used in engineering and scientific applications unlike those used to measure speed, temperature and pressure data. +5V 0V -5V Fig. 1.11: Analog signal 8 Computer Fundamentals Activity 1.10: Classification of computers 1. Research for details from the internet, magazines or other reference books and define the following types of computers: Analog computers Digital computers. Hybrid computers. 2. Discuss advantages and disadvantages of the three types of computers. Assessment Exercise 1.1 1. Explain some of the characteristics that make a computer suitable for processing repetitive tasks. 2. Differentiate between the following terms: (a) Mainframe and minicomputers. (b) Analog and digital data. (c) Servers and workstations. 3. Draw a sketch of a desktop computer and label the main physical parts. 1.4 Role of computers in society Computers play very important roles in various socio-economic sectors such as economics, offices, financial institutions, industries, health, communication, security, education, entertainment and libraries. In this section, we discuss common application areas of computers in our society. 1.4.1 Economics Computers enables governments, businesses and individuals to plan, budget and tract their revenues and expenditures. Increased computing power means that it has become possible to perform economic analysis both at macro and micro-economic level. 1.4.2 Retail stores Most retail stores use computers to help in the management of daily activities like stock control. The stock control system keeps account of what is in stock, what is sold and what is out of stock. The management is automatically alerted whenever a particular item or items are running out of stock that need reordering. 1.4.3 Offices Computers have increased efficiency in offices by reducing the time and effort needed to access and receive information. Most modern office functions have been automated for efficient service delivery. 9 Computer Fundamentals 1.4.4 Financial institutions In the banking sector, computers and mobile devices such as cellphones can be used to withdraw or get any service from different branches. Special cash dispensing machines called automated teller machines (ATM’s) have enabled automation of cash deposits and withdrawal services. Efficiency has also been increased due to better record keeping and document processing brought about by use of computers. 1.4.5 Industries Computers are being used to monitor and control industrial processes. The computer age has seen wide use of remote controlled devices called robots. A robot is a machine that works like a human being but performs tasks that are too unpleasant, dangerous, or complex and tedious to assign to human beings. 1.4.6 Health Computers are used to keep patients’ records in order to provide easy access to a patient’s treatment and diagnosis history. Computerised medical devices are now being used to get a cross sectional view of the patient’s body that enables physicians to get proper diagnosis of the affected body parts with high levels of accuracy. Computers also control life support machines in Intensive Care Units (ICU). 1.4.7 Communication Integration of computers and telecommunication facilities has made message transmission and reception to be very fast and efficient. Because of the speed with which information can be transmitted around the world using computers, the world is said to have become a global village. 1.4.8 Security Information stored in computers such as fingerprints, images and other identification details help law enforcers carry out criminal investigations. 1.4.9 Education Computers are used in teaching and learning in schools, colleges and universities. Learning and teaching using computers is referred to as Computer Aided Learning (CAL) and Computer Aided Instruction (CAI). For example, experiments in subjects like Chemistry or Physics may be demonstrated using a special computer program that can depict them on the screen through a process called simulation. To take care of learners with special needs, computers with software and assistive technologies such as microphone, braile keyboards and text magnifiers have been developed. 1.4.10 Entertainment Computers can be used at home for recreational activities such as watching movies, playing music and computer games. They can also be used in storing personal information, calculating, keeping home budgets and research. 10 Computer Fundamentals 1.4.11 Library management In a modern library, computers enable library personnel to easily access and keep updated records of books and other library materials. Library users can also use computers to search for titles instead of using the manual card catalogue. Activity 1.11: Role of Computers in society 1. Match the following computer application areas numbered 1 - 8 with the role played in column numbered A - H. 1. Supermarket A – Forensic investigations 2. Hospital B – Entertainment 3. Bank C – Stock control 4. Hotel D – Booking rooms 5. Home E – Analysing academic data 6. School F – Motor vehicle assembly 7. Industry G – Remote monitoring of patients 8. Police station H – Processing cash transactions 2. Apart from using computers and other ICT devices such as mobile phones as productivity tools at home and workplace, they can be used to address various social, environental and cultural issues. Brainstorm on how computers can be used in Rwanda to promote: Peace and reconciliation. Ndi Umunyarwanda philosophy. Environmental management. Sexuality and moral values. 3. By visiting around and outside the school, discuss both positive and negative impact of computers in the following sectors: Education Business Health Entertainment Communication Security control Financial management Government 1.5 History of computers The computer, as we know it today, had its beginning with a 19th century English mathematics professor name Charles Babbage. Babbage designed the Analytical Engine and that is considered as the basic architecture of modern electronic computers are based on. It is not until 1937 when John Atanasoff and Clifford Berry built the first electronic digital computer called Atanasoff-Berry Computer (ABC). Since then, there have been major computer evolutions classified into five generations. 11 Computer Fundamentals 1.5.1 First generation (1940-1956): Vacuum tubes The first generation computers used electronic components known as vacuum tubes or thermionic values (Fig. 1.12) for circuitry and magnetic drums for memory. These types of computers were enormous, expensive, consumed a lot of power, and emitted a lot of heat which was often the cause of malfunctions. Input was based on punched cards and paper tape, and output was displayed on printouts. The three popular examples of first generation computers are Electronic Numeric Integrator and Calculator (ENIAC), Electronic Discrete Variable Automatic Computer (EDVAC) and Universal Automatic Computer (UNIVAC). Fig. 1.12: Thermionic valves Activity 1.12: First generation computers In groups explain why first generation computers were large in size, emitted a lot of heat, and consumed a lot of power. 1.5.2 Second generation (1956-1964): Transistors The invention of transistors shown in Fig. 1.13 ushered in the second generation of computers that were made up of transistors that are superior vacuum tubes. However, these computers but did not see widespread use in computers until the late 1950s. Although transistors still generated a great deal of heat, they were faster and more reliable than those made of vacuum tubes. In terms of input, computers in second generation relied on punched cards while storage was on magnetic cores. Examples of second generation computers include IBM’s 1401 and 7070, UNIVAC 1107, ATLAS LEO Mark III and Honeywell H200. Fig. 1.13: Tramsistors 12 Computer Fundamentals Activity 1.13: Second generation computers Identify examples of second generation computers. By researching from Internet or other reliable reference, identify at least three examples of second generation computers. 1.5.3 Third generation (1964-1970): Integrated circuits Development of electrical components known as integrated circuit (IC) was the hallmark of the third generation of computers. Fig. 1.14 shows illustration of ICs that are made up of transistors embedded on silicon chips called semiconductors. Most third generation computers allowed users to interact a computer through keyboards and monitors. For the first time, computers became accessible to a mass audience because they were smaller and cheaper than their predecessors. Examples of third generation computers include smaller and less expensive minicomputers such as IBM 360 and ICL 19000 series. Fig. 1.14: Intergrated circuits (ICs) Activity 1.14: Third generation computers Through research identify at least three examples of third generation computers. 1.5.4 Fourth generation (1970-Present): Microprocessors Further technological improvements on ICs saw very large intergrated (VLI) circuits which have thousands of integrated circuits built onto a silicon chip as microprocessor shown in Fig. 1.15. It is in the fourth generation computers that programs with graphical user interface (GUIs), mouse, and hand-held devices were introduced. Some the early examples of fourth generation computers include IBM 370 and 4300, Honeywell DPS-88 and Burroughs 7700. Fig. 1.15: Top and bottom view of microprocessor 13 Computer Fundamentals 1.5.5 Fifth generation (Present and beyond): Artificial intelligence Tremendous improvement on hardware and software has given rise to what is loosely considered as the fifth generation computers that are based on artificial intelligence. The term artificial intelligence refers to capability of a computer to mimic human behaviour. The goal of fifth generation computing is to develop devices that are capable of learning, and respond to natural language input (voice recognition). In future, research outcomes in the fields of artificial intelligence and nanotechnology are expected to radically change the face of modern computers. Activity 1.15: Fifth generation computers By researching from Internet or other reliable reference material, identify at least three examples of fifth generation computers Table 1.1 gives a summary of some of the main technological specifications and uses of computers from the first to fifth generation. Generation Features Application 1 st Generation Built during the 1st world war The 1st generation computers were used for very computers using vacuum tubes large mathematical and scientific computations. For 1940-1956 example, ENIAC developed during 1st world war was used to make certain calculations for the construction of hydrogen bomb. 2nd Generation Built using transistors. Had tape The 2nd generation computers such as PDP-1 and IBM computers storage, printer and operating 1400 series were programmable computers that were 1956-1964 system and stored programs. used mainly for scientific, and business applications. 3 rd Generation Built using integrated circuits These computers such as PDP-8 and IBM 360 were computers and semiconductors (a type of the first computers to multitask. They had most of 1964-1970 material that had the properties the applications used today such as word processor. of an insulator and a conductor). 4 th Generation Built using very large integrated Due to low cost, 4th generation computers such as Altair computers circuits characterized by 8800 (first microcomputer) were affordable and could 1970-present microcomputers. be used for most applications. Financial applications such as VisiCalc and networks particularly the internet became common. 5 th Generation Today’s computers characterized Most modern computers are used for a large number computers -§ by massive processing power of applications, in particular expert systems used in present and and use of artificial intelligence. decision making. beyond Table 1.1 Technological specifications and uses of computers 14 Computer Fundamentals Activity 1.16: Computer generations 1. Match the following generations of computers with the technology used to develop them. 1. First generation A – Very large scale integrated circuit 2. Second generation B – Thermionic valves 3. Third generation C – Transistors 4. Fourth generation D – Integrated circuits 2. The age of modern electronic computers can be traced back to 1940s. In groups, discuss five generations that characterize modern electronic computers. Unit Test 1 1. What were the characteristics of first generation computers? 2. Draw a block diagram showing the evolution of computers in their generations and characteristics per each. 3. Define the term artificial intelligence. 4. Explain how integrated circuits contributed to the development of microcomputers. 5. Highlight some of the achievements of the fifth generation computers. 15 Computer Architecture and Assembly Unit 2 COMPUTER ARCHITECTURE AND ASSEMBLY Key Unit Competency By the end of the unit, you should be able to: Identify computer components and their functions (input, output, processing and storage. Assemble, disassemble computers and perform basic maintenance services. Unit Outline Computer system. Computer hardware. Audio port and connector. Internal computer components. Assembling computers. Cleaning and disposing of computer components. Introduction This unit introduces us to computer components and their functionality in order to have a common understanding of microcomputers regardless of their physical configuration. Later, the unit focuses on fundamentals of computer architecture that aims at equipping us with practical skills on how to assemble, disassemble, and repair desktop computers. 2.1 Computer System Though there are various definitions of computer systems, in our context we define a computer system as the combination of hardware, software (programs), user (liveware) and data that forms a complete, working system. 2.1.1 User A computer system is not complete without people referred to as users or liveware. Although some types of computers can operate without much intervention from users, most personal computers are designed specifically for use by people. 2.1.2 Hardware In computer science context, hardware refers to physical components that make up a computer system. Common examples of hardware include system unit, keyboard, mouse monitor, printer, speakers, and modem. 16 Computer Architecture and Assembly 2.1.3 Software The term software refers to a set of instructions also known as program that directs a computer what to do. Some programs operates computer hardware and other programs while others enable a computer user to perform specific tasks such as accounting. 2.1.4 Data Data consists of raw facts which the computer can manipulate and process into information that is useful to the user. In digital computers, data is converted from forms that people can understand such as text, numerals, sounds, and images into binary digit zeros and ones. The four components that make up a computer system are illustrated in Fig. 2.1. Note that the software component is represented by shelved software casings and programs running in the computer, while data is illustrated by information on the screen and on a piece of paper on the desk. hardware software data user Fig.2.1: The four components of a computer system Activity 2.1: Computer Components Using examples, explain the function of each of the four components of a computer system. Compare your answers with other members of your class and the below following discussion. 17 Computer Architecture and Assembly 2.2 Computer functions Computers manipulate (process) data (input) to produce information (output) and hold (store) processed information for future use as shown in Fig. 2.2. Input Output Data Process Information Storage Fig.2.2:Input, processing, storage and output of a computer system Input: The first box on the illustration depicts how a computer receives input for processing. Process: The computer then performs processing such as calculations and comparisons. Output: The computer generates information that may be printed or displayed on a screen or in a specified format. Storage: Data and information may be stored for future use on storage devices such as hard disk, CD/DVD etc. 2.3 Computer hardware Generally the main hardware components of a typical desktop computer can be classified into two broad categories namely; peripheral devices as and the system unit. 2.3.1 Peripheral Devices Most desktop computers consist of external devices connected to a central housing known as the system unit. Collectively, external input devices such as keyboard and output devices such as the monitor are referred to as peripheral devices. Fig. 2.3 shows common examples of peripheral devices. Activity 2.2: Peripheral Devices Fig. 2.3 shows peripheral devices that may be attached to the system unit of a microcomputer. 18 Computer Architecture and Assembly Fig.2.3: Peripheral devices Identify each item and classify it as input, output or storage devices using descriptions given below: Peripheral device that enables the user to enter data and instructions into the computer through typing. To execute a command, the user moves the mouse which consequently moves the pointer on the screen. Television-like device that enables the user to display information such as text and videos from the computer. Peripheral device that looks like lever used to control a pointer on the screen mostly used for playing computer games. Devices used to display output from a computer onto a hardcopy such as plain papers. Peripheral device used to capture digital images and video and directly stores the content into computer storage. Peripheral device used to produce audio sound such as music from a computer. Secondary storage media/device that can be plugged into USB port to read or store data. Shiny round secondary storage media that is inserted into the system unit disk drive to read or store data. 2.3.2 Computer case The computer case, commonly referred to as the system unit, is the main hardware part in which internal components such as microprocessor, computer memory, and drives are housed. In terms of physical appearance (form factor), the two common types of systems units are tower type shown in Fig. 2.4(a) and desktop type in Fig. 2.4(b). The main difference is that, in tower system unit, the monitor rests on the table while in desktop types; the monitor may be placed on top of the system unit. 19 Computer Architecture and Assembly (a) Tower type case (b) Desktop computer case Fig.2.4: Types of system unit cases Activity 2.3: System Unit 1. Discuss what the system unit of a computer is. 2. Identify the types of system units. 3. State the advantage and disadvantages of each of computer cases. 2.3.3 Ports and Connectors A port is a physical or wireless interface between the computer and peripheral devices. Physically, you can identify ports such as shown in Fig. 2.5 through which devices may be connected using interface cables. In this section, we discuss ports such as serial, parallel, universal serial bus (USB), Ps/2, HDMI and VGA shown in Fig. 2.5 (a) and (b). Activity 2.4: Ports and Connector 1. Unplug peripheral devices connected to the back of the computer and compare the parts you see to those found on the picture below. E F A B C D Fig.2.5(a) Back view of a desktop computer Fig.2.5(b) Back view of motherboard Fig.2.5: Back view of microcomputer and motherboard 20 Computer Architecture and Assembly 2. Using Fig. 2.5, identify the ports labelled A-F and demonstrate how each port connect peripheral devices to the system unit. Compare your work with the brief description given below: 2.3.3.1 Serial port Serial ports also known as RS232 ports are used to connect devices that transmit and receive data as a series of binary digits (bits). Although RS232 ports and cable shown in Fig. 2.6 have become obsolete, they were used to connect devices such as the mouse, serial modems and printers. Fig.2.6: Serial connector and port Activity 2.5: Serial Connector Study the serial connector shown in Fig. 2.6 above and perform the following tasks: Identify whether the serial cable is used within the school or computer lab. If no serial cable is available in the school, count the number of pins shown on the illustration. State the disadvantages of RS232C port and explain why it has become obsolete. 2.3.3.2 Parallel Port A parallel port is an interface used to connect devices that transmit and receive multiple bits simultaneously (in parallel) hence it is faster than the serial interface. To connect devices such as printers and scanners to a parallel port, we use a 25-pin parallel cable also referred to as DB-25 shown in Fig. 2.7 Fig.2.7: Parallel connector and port 21 Computer Architecture and Assembly 2.3.3.3 Universal Serial Bus Universal Serial Bus (USB) is an industry standard interface that defines cables, connectors and protocols for connections between computers and peripheral devices. Universal serial bus (USB) is a high-speed serial port that has become the standard interface hence replacing most serial and parallel ports. It is now common to find USB ports on most electronic devices such as tablets, radios, TVs, mobile phones, and set-top boxes. One of the reasons the USB interface has become popular is because as many as 127 devices can be daisy chained and connected to a single port using USB cable such as the one shown in Fig. 2.8. Fig.2.8: USB port and connector Activity 2.6: USB Port and Connector Explain three reasons why USB interface has replaced parallel and other serial ports on most computers and peripheral devices. Move around the computer room and do the following: 1. Find out how many USB ports the computers have. 2. Connect a mouse / keyboard / peripheral device to the computer’s system unit using a USB cable as directed by the teacher. Is the process simple or complicated? 2.3.3.4 Personal System/2 ports Previously, most computers came with a pair of Personal Systems 2 (PS/2) ports also known as mini-DIN. However, most computer manufacturers have phased out PS/2 ports in favour of USB interfaces and wireless connectivity. Fig. 2.9 shows a closer look of the PS/2 ports the one coded in pink to connect a keyboard while the green ports is used connects a mouse. Fig. 2.9: Keyboard and mouse Ps/2 ports 22 Computer Architecture and Assembly Activity 2.7: PS/2 Port and Connector Study PS/2 ports on the system unit or use Fig. 2.9(a) to explain the following: What colour codes are used to denote the mini-DIN ports for the keyboard and the mouse? Check behind your system unit and identify the mini-DIN ports if available. Sketch their appearance. What happens if by mistake you connect the keyboard to the mouse port? 2.3.3.5 Video graphics array port A Video Graphics Array (VGA) port is a D-shaped interface used to connect display devices such as TVs, monitor or LCD projectors to the computer. Fig. 2.10 shows an illustration of a 15-pin VGA cable used to connect a monitor or projects to a computer. Fig.2.10: VGA connector Activity 2.8: VGA Port and Connector Study the VGA connector shown in Fig. 2.10 or in a computer lab and perform the following tasks: Count the number of pins on the VGA cable connector. Explain what happens when one of the pins on the VGA connectors happens to be damaged. Connect a monitor to a VGA port. 2.3.3.6 Audio Ports Most computers and mobile devices come with audio interface used to connect speakers, microphones (mic) and other audio devices. Fig. 2.11(a) shows three audio ports while Fig. 2.11(b) shows output (speaker) and input (microphone) jacks coded in green and pink colours. 23 Computer Architecture and Assembly Fig.2.11:(a) Audio port Fig.2.11:(b) Speaker and microphone jacks Fig.2.11: Audio interface Activity 2.9: Audio Port and Connector Study the connector (jack) shown in Fig. 2.11(b) and perform the following tasks: What colours are used to distiguish between the audio and microphone ports. Explain what happens if the two are interchanged by plugging in the audio connector to the mic port and vise versa. In the computer lab, demonstrate how you would connect the speakers to audio and mic ports. 2.3.3.7 Network port Network interface is a port that connects a device to physical or wireless transmission media in computer network. Most computers today come with a network interface known as RJ45 shown on Fig. 2.12 (b) to which a transmission media with RJ45 connector shown in Fig. 2.12 (b) is plugged to establish a connection. (a):RJ45 port (b):RJ45 UTP connector Fig.2.12:RJ45 interface and UTP connector Activity 2.10: Network Interface Study the RJ 45 connector in Fig.2.12 above or in the computer lab and perform the following tasks: Distinguish between network interface adapter and onboard modem. Apart from Communication Network Riser (CNR) adapter, describe three types of network interface adapters and slots. Which adapter technology is the most current. 24 Computer Architecture and Assembly In the computer lab, demonstrate how you would connect computer to local area network using RJ 45 port and connector. 2.3.3.8 Firewire connector Firewire port also referred to as IEEE 1394 is almost similar to USB but has higher data transmission rate. Therefore, firewire is suitable for streaming video from digital cameras to a computer. Fig. 2.13(a) shows an illustration of Firewire port while Fig. 2.13(b) shows the two ends of a firewire cable connectors. Firewire port Firewire connector (a): Firewire port (b):Firewire cable Fig.2.13: Firewire port and connectors 2.3.3.9 High Definition Multimedia Interface High Definition Multimedia Interface (HMDI) is an interface for transferring compressed and uncompressed digital audio or video data from HDMI-compliant device to a computer, projector, digital TV or audio device. HDMI is intended to be a replacement for analog video standards such as the VGA. HDMI port HDMI connector (a) HDMI cable (b) Ports on laptop Fig.2.14: HDMI interface cable and port Activity 2.11: HDMI Port and Connector Study Fig. 2.14 or HDMI interface and carryout the following tasks: Identify the devices within the school or at home that comes with HDMI interface. Draw similarities and difference between the USB and HDMI ports and connectors. Through the help of the teacher in the computer lab, demonstrate how you would 25 Computer Architecture and Assembly stream video clips from a video camera to a computer or digital TV through HDMI interface. 2.3.3.10 Small Computer Systems Interface Small Computer Systems Interface (SCSI) is a set of parallel interface standards defined by ANSI for attaching peripheral devices such as printers, disk drives, tape drives and scanners. Although SCSI port shown in Fig. 2.15 is available on some devices, it has become obsolete in favour of USB, Firewire, HDMI and wireless standards. SCSI port SCSI connector Fig.2.15: SCSI port and interface cable Activity 2.12: Connecting Peripheral Devices 1. In groups of two or three, check whether your computer has an SCSI interface and perform the following tasks: Research on ANSI standardization body and trace the evolution of SCSI interface, number of devices supported, and related viariations. Identify devices within the school or at home that comes with HDMI interface. Draw similarities and difference between the SCSI and parallel LPT1 ports and connectors. 2. Adan intends to start computer bureau services such as printing and cyber cafe in Kigali. Assuming Adan has come to seek advice on specifications to consider before purchasing computers: Use demonstration or illustration to help Adan differentiate between desktop and tower type system unit. Take Adan through the ports at the back of the system unit explaining to him the purpose of each. Demonstrate and help Adan connect basic peripheral devices such as monitor, keyboard, mouse and printer to the right ports. 3. To easily identify each of the ports and connectors, device manufacturers use symbolic colour codes and impressions. For example, Table 2.1 a list of symbolic representations of some of the ports discussed in this section. Identify and explain what port or connector each symbol stands for. 26 Computer Architecture and Assembly Port/Connector Symbol Name of Port/Connector Table 2.1: Port symbols 2.4 Internal Computer Components We have already learnt about various peripheral devices and how they are connected to the system unit through ports. In this section, we discuss the main components found inside the system unit such as disk drives, motherboard, processor and memory. But, before we open the system unit cover, it is important that you observe the following safety precautions: 1. Always disconnect the computer from power source before starting to work on them. 2. Do not work on any peripheral device without the guidance of the tutor or laboratory technician. 3. Never work in isolation because you may need help in case of any emergency. 4. Always discharge static electricity that might have built up on the body by touching an earthed metallic object or wearing antistatic wrist member. Activity 2.13: Internal Computer Components 1. Through the guidance of your teacher or lab technician, work in groups of two or three to open the system unit cover to expose the internal components as shown in Fig. 2.16. 27 Computer Architecture and Assembly Fig.2.16: Inside the system unit 2. Observe and identify various components inside the system unit. 2.4.1 Power supply unit and connectors The Power Supply Unit (PSU) shown in Fig. 2.17 converts alternating current (AC) from mains to direct current (DC) required by internal computer components. The current supplied to the internal components like motherboard, hard disk, and optical drives depends on the rating from the device manufacturer. Note that unlike desktop computers that are fitted with PSU, portable computers like laptops come with power adapters that convert AC to DC. Power connector Power connector to from mains supply internal components Voltage changer (switch) between 112v and 240v On-off switch Cooler fan Fig.2.17: Power supply unit. Types of power supply unit connectors The power supply unit connectors can be classified into external and internal connectors. The external connectors are used to connect the power supply unit to the power outlet while internal connectors are used to supply and distribute power to internal devices inside the computer found inside a computer case. In the power supply unit shown in Fig. 2.17 above shows an examples of internal and external power connectors. 28 Computer Architecture and Assembly 2.4.2 Motherboard A motherboard shown in (Fig. 2.18) is the main printed circuit board onto which all components of the computer interconnect or are mounted and communicate with each other. Adaptor card slot/controller Microprocessor R A M Memory slots Fig.2.18: Motherboard The following are the main components that are attached or mounted on the motherboard. They are discussed later in the section: 1. Central Processing Unit (CPU): it is also called the microprocessor 2. Computer memory: They are various types of read only memory chips (ROMs) and random access memory modules (RAM). 3. Disk drives: hard disk drive and the optical disk drive. 4. Adapter cards: they add functionality to the computer e.g. network interface cards, TV/Radio cards, wireless network cards etc. 2.4.3 Central processing unit (CPU) The Central Processing Unit (CPU), also known as the processor, is the most important component of the computer. It is actually regarded as the “brain” of the computer because all processing activities are carried out inside the processor. In microcomputers, the CPU is housed inside the system unit. The CPU is mounted on a circuit board known as the motherboard or the system board. For ease of upgrade, most motherboards have a socket into which the contact pins shown in Fig 2.19 (b) are aligned to and inserted. 29 Computer Architecture and Assembly (a): Topside of microprocessor (b): bottom connector socket Fig.2.19: Top and bottom of a microprocessor Activity 2.14: Central processing unit(CPU) Using Fig. 2.21 (a) and (b), identify the type of microprocessor, and socket on the motherboard of your computer. The CPU is made up of three distinct components within it: 1. The Arithmetic Logic Unit (ALU): performs all arithmetic and logical operations. 2. Control Unit: interprets instructions and controls speed of execution using a clock. 3. Registers: special memories within the CPU for holding instructions and data. Role of the CPU The CPU consists of three functional elements namely the Control Unit (CU), Arithmetic and Logic Unit (ALU). Figure 2.20 illustrates the functional elements of the CPU. Data and instructions from memory Main memory =5 add send result to 2 to 2+3 the memory 5 ALU adds ALU Control unit 2&3 Cache and registers Fig. 2.20: Functional elements of the CPU 30 Computer Architecture and Assembly The control unit The control unit coordinates all processing activities in the CPU as well as input, storage and output operations. It determines which operation or instruction is to be executed next. To coordinate these activities, the control unit uses a system clock. When the clock ticks, a task is ashered into the CPU for processing. When it ticks again, the task is ashered in/out of the CPU. Different tasks require different number of clock ticks (time lengths) in order for them to be fully processed. The system clock sends electric signals as its means of communication to the CPU. The number of pulses per second determines the speed of a microprocessor. The faster the clock pulses, the faster the CPU, hence the faster the computer can process data. Arithmetic and logic unit (ALU) Activity 2.15: Group work: In groups of five, do the following: 1. Choose one of you to be the group leader. By consensus, select two lucky numbers for the group (any two numbers between 1 and 50). Assuming you select 9 and 18. The group leader assigns each member at least one of the following tasks at the same time: Task A: 9 + 18 = Task B: 18 – 9 = Task C: 18 x 9 = Task D: 18 ÷ 9 = 2. Let each of you provide an answer to the group. Compare your answers. What is the general name given to these operations? The arithmetic and logic unit is the location within which all arithmetic and logical operations are carried out in the CPU. Basic arithmetic operations include; addition, subtraction, multiplication and division. Logic operations are based on the computer’s capacity to compare two or more values. For example, it may compare whether a piece of data is greater than or less than, equal to or not equal to etc. In order for the ALU to be able to process data, it has special temporary storage locations called registers, which hold the data just before processing. Registers also hold the results after processing. 31 Computer Architecture and Assembly 2.4.4 Computer memory (a) Main/primary memory Activity 2.16 Imagine yourself walking in a forest. You keep on seeing different types of trees as you proceed along. Halfway through the forest, you meet a forest guard who shakes your hand and asks you what you are doing in the forest. In groups of three, discuss the following: (i) When you reach the edge of the forest, are you likely to remember all the trees you saw in the forest? Why? (ii) Which tree are you likely to remember and why? NB: Discuss this in reference to short term memory and long term memory in human beings. Present your views to the class. Human beings have memory, both short term and long term, where they keep information. Daily unimportant information is usually kept in the short term memory then discarded after a while. Important information is usually stored in the long term memory. It can be remembered even after many years. Computer memory is modelled along the same lines. Activity 2.17 In S1, you were introduced to computer memory. In pairs, study the pictures in Figure 2.21. What do you think the acronym ROM stands for? What about RAM? (a) (b) Fig. 2.21: ROM and RAM chips (a) Which one is temporary memory? Which one is permanent? (b) Access the content provided by the teacher and research about the various types of ROM and RAM, their advantages and disadvantages. (c) Make a presentation in class as requested by the teacher. Main memory also known as primary storage is a type of storage that is directly accessible by the processor. Computer memory can be classified into Read Only Memory (ROM) and Random Access Memory (RAM). Figures 2.9 (a) and (b) show a ROM chip and RAM module respectively. 32 Computer Architecture and Assembly Read Only Memory (ROM) Read Only Memory is used to store programmed instructions and data permanently or semi-permanently. Data and instructions stored in ROM are those which remain unchanged for long periods of time e.g. POST instructions, special purpose computers, computerised fuel pumps instructions etc. Depending on permanence of the instructions or data written on it, there are four Types of Read Only Memory namely: (i) Mask Read Only Memory (MROM): Once the content is written on it by the manufacturer, it cannot be changed. Examples of computer that use MROM based operating systems are those that require long term sustainability e.g. computers that run network operating systems or server operating systems. (ii) Programmable Read Only Memory (PROM): This allows the user to alter it only once after the content is written on it. Examples are the PROM compact disc and PROM intergrated circuit chips. (iii) Erasable Programmable Read Only Memory (EPROM): This has a transparent quartz window through which its contents, can be erased by exposing it to ultra violet (UV) light, and then reprogrammed for another use. (iv) Electrically Erasable Programmable Read Only Memory (EEPROM): This type of ROM can be erased and reprogrammed using electricity. An example of EEPROM is the memory that stores the basic input/output system (BIOS). Characteristics of Read Only Memory (ROM) are: 1. One can only read its content but you cannot write on it unless it is a special type of ROM. 2. It is non-volatile i.e. its content is not lost when the computer is switched off. 3. Stores permanent or semipermanent instructions from the manufacturer called firmware. It can store semipermanent instructions because some variations of ROM chips can be programmed according to the user’s specification. Random Access Memory (RAM) Random access memory (RAM) also known as working storage is used to hold instructions and data needed by the currently running applications. The information in RAM is continually read, changed, and removed. It is referred to as random access because its content can be read directly regardless of the sequence in which it was stored. As opposed to ROM, the content in RAM is held temporarily and its content is lost once the computer is turned off. Therefore, before switching off the computer, it is important that one stores (saves) his/her work in a device that offers relatively permanent storage facility. Characteristics of Random Access Memory (RAM) are: 1. Data can be read (retrieved) and written (stored) in it. 2. RAM is a temporary (volatile) storage because its content disappears when the computer is switched off. 33 Computer Architecture and Assembly 3. Its content is user defined i.e. the user dictates what is to be contained in the RAM. The two main types of RAM are: Static RAM Static RAM (SRAM) is a fast type of memory mostly located inside a microprocessor. For this reason, SRAM is used on special purpose memories such as cache memory. Cache memory is used to enhance the processing speed by holding data and instructions that are instantly required by the processor. Dynamic RAM Dynamic RAM (DRAM) is a relatively slower type of RAM compared to SRAM. The term dynamic refers to the tendency for the stored charge to leak away, even with constant power supply. For this reason, DRAM requires periodic recharging (refresh) to maintain its data storage. Fig. 2.22 shows ROM and RAM on the motherboard. RAM modules ROM chip Fig. 2.22: ROM and RAM on motherboard Special purpose memories Some minute types of memories are included inside a microprocessor or input/output devices, in order to enhance its performance. These memories include buffers, registers and cache memory as discussed earlier. Cache memory Activity 2.18 Group work: In groups of five, take the mobile phone that has been provided by the teacher. Scroll through the following: 1. The Contacts lists. 2. The Recently called list. Why do you think you need to have a recently called list? Discuss the importance of this list and present the finding to the class. 34 Computer Architecture and Assembly Cache memory (pronounced as cash) is the fastest type of RAM. Its main aim is to store data that has been recently accessed by the processor. The belief is that the same data may most likely be required again soon. This would save the time of having to retrieve it from the slow secondary memory. This arrangement enhances overall computer performance by avoiding the slow secondary storage for recently used data. The only time data is retrieved from secondary storage is when no copy is in catche. There are three types of cache memory namely: Level 1: also known as primary cache located inside the microprocessor; Level 2: also known as external cache that may be inside the microprocessor or mounted on the motherboard, and Level 3: is the latest type of cache that works with L2 cache to optimise system performance. Buffers Activity 2.19 Brainstorming: Study the picture of a dam provided by the teacher. Search for other pictures of dams on the internet. List down their names. As a class, brainstorm on the driving forces that motivate construction of dams along rivers? Buffers are special memories that are found in input/output devices. Input data is held in the input buffer before being forwarded to the memory to avoid overloading the memory. The data can then be transferred to the memory at a reasonable pace to avoid flooding it. Output buffers play a similar role when sending data to the network or output device. For example, printers have buffers where they can store massive documents sent by the CPU for printing hence freeing the CPU to perform other urgent tasks as the printer continues to print in the background. Buffers therefore play a controlling role between devices to avoid a quick device flooding a slow device with data or instructions. Registers Activity 2.20 Pair Work: Most organisations have a waiting room where guests rest as they wait to see the company boss in turns. 35 Computer Architecture and Assembly Discuss why such an arrangement is important. What is likely to occur if there is no such arrangement for a busy office. As opposed to buffers, registers hold one piece of data at a time and are inside the CPU. Just like the secretary in Activity 2.16 who hosts and clears the next one person just before he/she sees the boss, registers hold that one data item just before or after processing within the CPU. Examples of registers are: Accumulator: This temporarily holds the results of the last processing step of the ALU. Instruction register: This temporarily holds an instruction just before it is interpreted into a form that CPU can understand. Address register: This temporarily holds the next piece of data waiting to be processed. Storage register: This temporarily holds a piece of data that is on its way to and from the CPU and the main memory. (b) Secondary memory Activity 2.21 Research on the internet about secondary/tertiary memory. Is it temporary or permanent? Which devices are referred to as secondary/tertiary storage devices? Why are some of these devices referred to as mass storage devices? Secondary storage, also referred to as auxiliary storage, are devices that provide alternative long-term storage for programs, data and information. Because of their large capacity they also referred to as mass storage devices. They are regarded as secondary because unlike primary storage, they are not directly accessible by the CPU. Secondary storage devices can be classified according to: (a) Portability: removable and fixed (b) Technology used to store and retrieve data: magnetic, optical, magneto-optical and solid state. In this section, we discuss these devices by indicating whether a device or media is removable and the technology used to store data on it. i) Removable storage Removable storage media are those that are not housed inside the computer. Data is read and written into the media using a device known as drive. Examples of removable 36 Computer Architecture and Assembly storage include optical disks (e.g. CD’s, VCD’s and DVD’s) and solid state devices (e.g. Flash disks). Others include the floppy diskettes, magnetic tapes and magnetic disks which have become virtually obsolete in the personal computing space. Optical storage media Activity 2.22 Study the pictures in Figure 2.23. Have you seen them before in real life? (a) State three areas where you have witnessed the disks being used. (b) Using a ruler, measure the diameter of each and note down. Investigate on the internet about the diameters of such disks. (c) What advantages do you think they offer to the user? Fig. 2.23: Optical disks Optical storage media are so called because data is written and read from them using a laser beam. A laser beam is a very strong concentrated light. Two reasons why optical storage media are used: 1. They store very large volumes of data. 2. Data stored in them is more stable and more permanent than the magnetic media. Compact disks (CD) Compact disks hold large quantities of data and information. One disk can hold as much as 700MB. They are mostly used to store data and information that requires a lot of space such as video clips, software, sounds etc. Currently compact disks are available in three forms namely: Compact disk-read only memory (CD-ROM): Compact disk read only memory (CD- ROM) as the name suggests contain data that can only be read but cannot be written on. To record data the recording surface is made into pits and lands (bumps). When a laser beam fall on the land,this is interpreted as 1, otherwise a zero is recorded. Compact disk-recordable (CD-R): Compact disk recordable (CD-R) are coated with special dye which changes colour to represent data when burned using a laser beam. Once data is burned on a CD-R, it becomes read only. 37 Computer Architecture and Assembly NB: CD-ROMs and CD-Rs are referred to as Write Once Read Many (WORM.) Data is only recorded once but can be read as many times as possible. Compact disk-rewritable (CD-RW): Unlike the CD-Rs, these types of compact disks allows the user to record, erase and rewrite new information just as one would with floppy disks. Digital versatile disks Digital Versatile Disk (DVD), also known as digital video disk resembles a compact disks in every aspect. The only difference is that they have a higher storage capacity over 17 Gigabytes of data. Figures 2.23 (seen earlier) shows various examples of optical disks. Optical card An optical card stores data and is read optically on a stripe rather than using magnetic ink. These types of cards are mostly used in banking and other business organisations to record customer details. Figures 2.24 below shows examples of an MICR reader reading a cheque and an optical card in the optical card reader. Fig. 2.24: Optical card readers Solid state storage media Activity 2.23 Study the pictures in Figure 2.25. What do you think they represent? Also compare them with the samples provided by the teacher. Where in real life have you used or seen people using these components? What are the names of these components? (a) (b) (c) Fig. 2.25: Solid state storage devices Solid state storage is a non-volatile storage that makes use of integrated circuits rather than mechanical, magnetic or optical technology. They are referred to as solid 38 Computer Architecture and Assembly state because they do not have movable parts. Some examples of solid state devices are memory sticks (Figure 2.13 (b) and (c)) and flash disk drives (Figure 2.13(a)). ii) Non-removable/fixed storage media The hard disk and its structure Activity 2.24 Access the website provided by the teacher and read about the hard disk of a computer. (a) Search for pictures of the hard disk on the internet in order to learn about its structure. (b) How does it store data? What are tracks, sectors and platters? (c) Make a brief presentation to the class concerning your findings. The hard disk is a secondary storage device that stores data and programs installed in a computer for a long time (permanently) even after the computer has been switched off. The data includes any created documents and downloaded such as text, photos and music. When the computer requires to process data and instructions stored on the hard disk, it has to be fetched first and placed in primary memory (RAM). When the data and instructions are in RAM, they can be easily fetched into the cache then the registers as directed by the control unit of the CPU. Traditionally, the hard disk is mounted inside the computer. For this reason we refer to it as a fixed disk. However, this is not always the case because some hard disks are removable. The hard disk is made up of metallic disk platters together with a read/write head, housed in a protective metal case (Figure 2.26(a)). Spindle Read/write head Casing Disk platters forming a cylinder Sector Track (a) Inside hard disk drive (b) Disk platter logical structure Fig. 2.26: Structure of Hard disk 39 Computer Architecture and Assembly The one or more metallic platters, stacked on top of each other but not touching one another. The stack of platters is attached to a rotating pole called a spindle. If it has more than one platter, they are stacked on top of each other to form a cylinder. A cylinder requires multiple read/write heads, one for each platter. The read/write head floats just above the surface of the rapidly rotating disk to read or write data. On the surface of each disk are special read/write circular regions called tracks (Figure 2.26 (b)). Each track is divided into angular sections called sectors similar to the sector of a circle. Most computer hard disks are connected to the motherboard via channel called controllers. Some of these controllers are Integrated Drive electronic (IDE), enhanced IDE or AT attachment (ATA). Disk drives A disk drive is hardware device in or attached to a computer that reads the data stored on a disk and writes data onto the disk for storage. Drives are mounted in drive bays in the system unit chassis. Examples of disk drivers inside the systems unit include optical (CD/DVD) drives, hard disk drives and tape drives. Figure 2.27(a) shows an illustration of hard disk drive mounted in the system unit while Fig 2.27(b) shows a CD/DVD drive on a Laptop. (a) Hard disk drive (b) DVD/CD drive on a laptop Fig.2.27: Examples of disk drives 2.4.5 Adapter card Adapter card or add-on card is a circuit board used to increase functionality of a computer e.g. adding a TV receiver, and wireless network etc. Fig. 2.28 shows a wireless network card. It enables the computer to connect to a Wi-Fi hotspot. Fig.2.28: Wireless network card 40 Computer Architecture and Assembly 2.4.6 Elements attached to the motherboard As mentioned earlier, some of the basic elements attached to the motherboard include CPU Socket, RAM slots, silicon chips, BIOS, expansion slots, CMOS battery, and controllers and electronic data buses. CPU Socket: The CPU or processor socket is the connector that houses the CPU to establish mechanical and electrical contact between the processor and the motherboard. Some sockets uses Pin Grid Array (PGA) that consists of holes where pins on the underside of the processor connects RAM slots: The RAM slots or sockets located near the processor are connectors that establish contact between memory modules and the motherboard. Depending on the type of motherboard, there may be 2-4 RAM slots (banks) that determine the amount of memory that can be installed. Chipset: Normally a chipset is an element that facilitates intercommunication between the microprocessor to the rest of the components on the motherboard. Expansion slot: Alternatively referred to as bus slot or port is a connection on the motherboard to which an expansion card can be plugged in order to expand the capability of a computer. CMOS battery: Complementary metal-oxide semiconductor (CMOS) is a small amount of memory on a computer motherboard used to store BIOS settings. To avoid losing the settings, CMOS is powered by a button-like cell referred to as CMOS battery. Data buses: if you carefully observe the surface of a motherboard, you will see printed electronic pathways or lines between components. These pathways are referred to as data buses because they are used to transfer data and instructions between components inside the computer. Assessment Exercise 2.1 1. Distinguish between the following: (a) AC and DC power supply. (b) Bluetooth and infrared connectivity. (c) Firewire and USB ports. (d) 5-pin DIN and PS/2 ports. 2. Explain three types of serial ports available on a typical desktop computer. 3. State two advantages of USB port over the parallel port. 4. Explain how you would connect both data projector and monitor to a single computer. 2.5 Assembling desktop computers With the knowledge and skill in handling internal and external components of a desktop computer, it’s now time to roll-up your sleeves to assemble and disassemble a computer. However, before you proceed, remember to observe safety precautions in order to avoid health injuries or damages to delicate computer components. Let’s start by having a look at tools that you may need to assemble or dis-assemble a computer. 41 Computer Architecture and Assembly Activity 2.25: Assembling a computer Looking at a toolkit in the computer lab or illustration shown in Fig. 2.29 identify the following tools: 1. Extended extractor: also called a part grabber are, used for retrieving dropped objects, such as jumpers or screws, from inside the computer. 2. Antistatic wrist member. 3. Torx screw drivers of varying sizes. 4. Multimeters used to measure the resistance, voltage, and/or current within computer components. 2 3 1 4 Fig.2.29: Computer repair kit 2.5.1 Step 1: Mounting Hard disk drives Hard disk drives are usually mounted on the system unit case and connected to the motherboard through either Enhanced Integrated Drive Electronics (EIDE), Small Computer System Interface (SCSI) or Serial Advanced Technology Attachment (SATA) cable interface. SATA is one of the latest technologies. It supports hot- swapping i.e. a drive can be detached or attached to the motherboard while the computer is ON. Fig. 2.30 illustrates how to mount a SATA hard disk drive. Fig. 2.30: Mounting a hard disk 42 Computer Architecture and Assembly Activity 2.26: Mounting a Hard Disk In groups or individually, follow the guidelines below to mount a hard disk drive: 1. Determine whether the motherboard has an empty SATA controller socket. 2. Slide the hard drive into the available bay on the system unit casing and secure it firmly by screwing or using the restraining mechanism provided by the manufacturer. 3. Plug in the SATA interface cable to the drive and to motherboard SATA/IDE controller. 4. Connect the power cable from the power supply unit to the back of the hard drive as shown in Fig. 2.30. 2.5.2 Step 2: Installing optical drives Optical drives such as CD and DVD drives are attached and detached from the sytem unit in the same way as hard disk drives. Activity 2.27: Installing optical drives In groups or individually, follow the guidelines below to mount an optical drive: 1. Determine whether the motherboard has an empty SATA or EIDE controller socket. 2. Slide the optical drive into available bay on the system unit casing and secure it firmly by screwing or

Use Quizgecko on...
Browser
Browser