Chapter 2 Main components of the computer 2.0 Introduction The computer accepts input, processes it and produces an output. It is helped in these tasks by a number of components. A simplified diagrammatic representation of the process can be represented as follows: Backing Store Input Main Memory Output Processor Figure 2-1: The computation process. From this diagram, the different components of the computer can be classified in one of the following groups: Processor, Main memory, Output devices, Input devices. Each of these components exists in several forms. In the simple microcomputer (see Figure 2-2) found in our home or in the computer lab, the following components can be immediately identified: Figure 2-2: A common desktop computer The input devices: the keyboard and the mouse. The output devices: the screen, the speakers and the printer. The processor and main memory, which are found inside the system unit, and hence hidden from us. The microcomputer can also be seen as comprising the System Unit, the Video Display Unit (VDU or screen), the Keyboard and mouse and the peripheral devices. 2.1. The System Unit The System Unit is contained inside a casing known as the system cabinet. A close look at it (see Figure 2-3) will show that it is composed of: A number of printed circuits boards, A number of distinct devices such as the different drives, A number of slots for additional cards, Some memory chips, A number of ports, Some bus connecting all these parts together. Memory Disk Drives Microprocessor Ports Cards System Board Figure 2-3: Inside a system unit. These printed circuit boards are known as cards and each of these cards has a specific use inside the computer. A list of some of the cards commonly found inside a common microcomputer is: The motherboard, The network card, The sound card. 2.1.1. The motherboard The motherboard, also known as the system board, is the main component of the system unit. It contains a number of electrical circuits and a number of slots (see Figure 2-4) for the connection of all the other components. These components comprise: The processor The Input/Output Devices e.g. Mouse, Keyboards etc… The different expansion cards mentioned before. Figure 2-4: A motherboard. The connection of these components can be done in a number of different ways. Some devices e.g. the Keyboard, Video Display Unit etc. can be connected very easily from the outside. Other components may require some technical knowledge. For example, a Sound Card has to be connected in a slot found inside the System Unit. A Network Card requires even more technical knowledge, as its settings have to be adjusted for its proper functioning. The main memory as well as the microprocessor has specific slots on the motherboard. Their legs (see Figure 2-5) are connected to the appropriate circuits on the motherboard and hence to the other devices for the proper functioning of the computer. Figure 2-5: A memory chip. There are a number of different types of motherboards available on the market. These differ mainly in terms of processor, amount of memory and cards they can accept. Figure 2-6 shows two different motherboards where we can easily spot the different layouts of components. (a) (b) Figure 2-6: Two different motherboards 2.1.2. The processor The processor, also known as a CPU or Central Processing Unit, is the heart of the computer, whether it is a desktop machine, a server, or a laptop. All data are processed in it. When the processor is composed of only one chip, it is called a microprocessor. There are a number of different types of processors available on the market nowadays. The microprocessor may be a Pentium from Intel Corporation, a K6 from AMD, a PowerPC, a Sparc or any of the many other brands and types of microprocessors, but they all do approximately the same thing in approximately the same way. These different microprocessors may vary in terms of price and performance. The following table gives a comparison between the Intel Pentium III and the AMD K6 III. Processor Features Performance Benefits AMD-K6®-III with 3DNow!™ technology Pentium®III Process Technology (micron) 0.25 0.25 Die size (mm2) Smaller die size=lower cost 118 140 Clock speed (MHz) Faster clock speed generally means faster processing and apps launching 400 450 450 500 Total System cache (max) Larger cache typically improves overall performance 2368 KB 544 KB *Internal cache Built-in feature that helps the CPU access data and instructions even faster 320 KB 32 KB L2 cache support Augments L1 cache, making data and instruction access even faster 256 KB (full speed) 512 KB (half speed) L3 cache support Provides additional system cache improving overall performance Yes (up to 2 MB) No Processor bus (max bus speed) Moves data between CPU and main memory 100MHz 100MHz MMX™ Technology Improves quality and performance of integer-based multimedia applications Yes Yes Advanced Floating Point Multimedia Technology Enables superior visual and multimedia experience Yes 3DNow! Technology Yes Streaming SIMD Extensions Accelerated Graphics Port Support Speeds up 3D graphics Yes Yes X86 compatibility Standard industry architecture, essential for running standard PC applications Yes Yes *AMD-K6-III internal cache includes 64 KB L1 cache and 256 KB full-speed on-chip L2 cache Figure 2-7: Processor Comparison The first microprocessor was the Intel 4004, introduced in 1971 to power one of the first portable electronic calculators. All it could do was add and subtract four bits at a time. Before the 4004, engineers built computers either from collections of chips or from discrete components (that is, transistors wired one at a time). The first microprocessor used in the home computer was the Intel 8080 which was a complete 8-bit microprocessor introduced in 1974. The Intel 8088 was introduced in 1979 and incorporated into the IBM PC, which first appeared around 1982, and this started the era of home computing. The PC market moved from the Intel 8088 to the new Intel Pentium-III through the 80286, the 80386, the 80486, the Pentium and the Pentium-II. All of these are improvements on the basic design of the 8088. For example, the new Pentiums-IIIs can execute any piece of code that ran on the original 8088, but runs about 3,000 times faster. The following table, compiled from The Intel Microprocessor Quick Reference Guide, helps to understand the differences between the different processors that Intel has introduced over the years. Name 8080 8088 80286 Date Transistors Microns Clock speed Data width MIPS 1974 6,000 6 2 MHz 8 0.64 MIPS 1979 29,000 3 5 MHz 16 bits, 0.33 MIPS 8 bit bus 1982 134,000 1.5 6 MHz 16 bits 1 MIPS 80386 1985 275,000 1.5 16 MHz 32 bits 5 MIPS 80486 Pentium 1989 1993 1,200,000 3,100,000 1 0.8 25 MHz 60 MHz 20 MIPS 100 MIPS Pentium II 1997 7,500,000 0.35 233 MHz Pentium III 1999 9,500,000 0.25 450 MHz 32 bits 32 bits, 64 bit bus 32 bits, 64 bit bus 32 bits, 64 bit bus 400 MIPS? 1,000 MIPS? First home computers First IBM PC IBM ATs. Up to 2.66 MIPS at 12 MHz Eventually 33 MHz, 11.4 MIPS Eventually 50 MHz, 41 MIPS Eventually 200 MHz Eventually MIPS? 450 MHz, 800 Figure 2-8: Intel microprocessors Information about this table: The date is the year that the processor was first introduced. Many processors are re-introduced at higher clock speeds for many years after the original release date. Transistors is the number of transistors on the chip. It can be seen that the number of transistors on a single chip has risen steadily over the years. Microns is the width, in microns, of the smallest wire on the chip. For comparison, a human hair is 100 microns thick. As the feature size on the chip goes down, the number of transistors rises. Clock speed is the maximum rate that the chip can be clocked. Data Width is the width of the ALU. MIPS stands for Millions of Instructions Per Second, and is a rough measure of the performance of a CPU. Modern CPUs can do so many different things that MIPS ratings lose a lot of their meaning, but a general sense of the relative power of the CPUs from this column can be deduced. 2.1.2.1. The Chip A chip is also called an integrated circuit. Generally it is a small, thin piece of silicon onto which the transistors have been etched. A chip might be as large as an inch on a side and can contain as many as 10 million transistors. Simple processors might consist of a few thousand transistors etched onto a chip just a few millimetres square. Figure 2-9: The Pentium II chip 2.1.2.2. Inside a Microprocessor The main components of the microprocessor are the Arithmetic and Logic Unit (ALU) and the Control Unit (CU). The CU directs electronic signals between the memory and the ALU as well as between the CPU and I/O devices. The ALU performs arithmetic and comparison operations. A microprocessor executes machine instructions that tell it what to do. Based on the instructions, a microprocessor does three basic things: The ALU (Arithmetic/Logic Unit) can perform mathematical operations like addition, subtraction, multiplication and division. It can move data from one memory location to another It can make decisions and jump to a new set of instructions based on those decisions. All the sophisticated things a microprocessor does can be decomposed in terms of these three basic activities. 2.1.2.3. Microprocessor Instructions Even a simple microprocessor has a quite large set of instructions that it can perform. The collection of instructions is implemented as bit patterns, known as opcodes, each of which has a different meaning when loaded into the instruction register. Since humans are not good at remembering bit patterns, a set of short words or mnemonics, is defined to represent the different bit patterns. This collection of words is called the assembly language of the processor. An assembler can translate the words into their bit patterns very easily, and then the output of the assembler is placed in memory for the microprocessor to execute. The instruction decoder needs to turn each of the opcodes into a set of signals that drive the different components inside the microprocessor. Consider the ADD instruction as an example: During the first clock cycle the instruction is loaded. During the second clock cycle the ADD instruction is decoded. During the third clock cycle, the program counter is incremented and the instruction executed. This is known as the Fetch-Execute cycle of the microprocessor. Every instruction can be broken down as a set of sequenced operations like the above. Some instructions take 2 or 3 clock cycles while others take 5 or 6 clock cycles. 2.1.2.4. Trends in Microprocessor Design The number of transistors available has a huge effect on the performance of a processor More transistors also allow a technology called pipelining. In a pipelined architecture, instruction execution overlaps. So even though it takes 5 clock cycles to execute each instruction, there can be 5 instructions in various stages of execution simultaneously. So it seems that one instruction completes every clock cycle. Many modern processors have multiple instruction decoders, each with its own pipeline. This allows multiple instruction streams, which means that more than one instruction can be completed during each clock cycle. This technique can be quite complex to implement, so it takes lots of transistors. The trend in processor design has been toward full 32-bit ALUs with fast floating point processors built in and pipelined execution with multiple instruction streams. There has also been a tendency toward special instructions (like the MMX instructions designed for Multimedia purposes) that make certain operations particularly efficient. There has also been the addition of hardware virtual memory support and L1 caching on the processor chip. All of these trends push up the transistor count, leading to the multi-million transistor microprocessors available today and these processors can execute about one billion instructions per second. 2.1.2.5. Data representation Inside the computer, data are represented using the binary system. This system or base consists of only two digits: 0 and 1. In the computer these digits are represented by the states of electrical circuits: a low state stands for 0 and a high state for 1. One binary digit is known as a bit and 8 bits make a byte. Any character can be represented by a combination of binary digits. A byte can represent up to 256 different characters. Memory capacity is expressed in terms of Megabytes (or MB). One MB is 220 Bytes and is roughly equal to 1 million Bytes. The RAM of a computer is expressed in terms of MB nowadays. The Kilobyte (or KB) is 210 Bytes or roughly 1 000 Bytes. The cache of a computer is expressed in terms of KB. The Gigabyte (GB) is 230 Bytes. It is used to express Hard Disk capacity. The examples used are just to give an idea of the capacity of the different mediums in a computer. We can express the size of any storage device in terms of any unit. There are a number of different binary systems: ASCII: The American Standard Code for Information Interchange is the main system used in microcomputers. EBCDIC: The Extended Binary Coded Decimal Interchange Code was developed by IBM and is used in large computers. Unicode: This is a sixteen-bit code. It can represent up to 2 16 different characters. It can support languages such as Chinese and Japanese, which have a very large set of characters. The electrical signal corresponding to a character is generated when the corresponding key is pressed on the keyboard. Since there can be noise on the lines from the keyboard to the processor, the signal can be corrupted. So a ninth bit, the parity bit, is added before transmission to detect errors. There are two types of parity bit: Even parity bit: The bit is added in such a way that the total number of 1 in the signal is even. Any error is detected at reception, and in case of error, the signal has to be sent again. Odd parity bit: The total number of 1 has to be odd. 2.1.3 Memory The computer contains a number of different types of memory each for a specific use. The different types of memory commonly found inside the computer are the RAM, ROM and CMOS. These are made up of high-speed access electronic circuits and can store data under certain conditions. The address and data buses, as well as the RD and WR lines of the microprocessor connect to the memory chips. In the sample microprocessor considered earlier, the address bus is 8 bits wide and the data bus 8 bits wide. This means that the microprocessor can address 28 = 256 bytes of memory, and it can read or write 8 bits of the memory at a time. All memory cells have a specified address and no two cells can have the same address. For example, it can have 128 bytes of ROM starting at address 0 and 128 bytes of RAM starting at address 128. 2.1.3.1. ROM ROM stands for Read-Only Memory. A ROM chip is programmed with a permanent collection of pre-set bytes. On a PC, the ROM contains essential information for the start-up of the computer such as the BIOS (Basic Input/Output System). When the microprocessor starts, it begins executing instructions it finds in the BIOS. The BIOS instructions test the hardware in the machine, and then it goes to the hard disk to fetch the boot sector. This boot sector is another small program containing some essential instructions to start the computer, and the BIOS stores it in RAM after reading it off the disk. The microprocessor then begins executing the boot sector's instructions from RAM. The boot sector program tells the microprocessor to fetch some other program from the hard disk into RAM, executes it, and proceeds in the same way until the entire operating system is loaded and executed. This process is explained in more details in Chapter 7 which deals with Systems Software Nearly all computers contain some amount of ROM. While it is possible to create a simple computer that contains no RAM, for example microcontrollers with some RAM bytes on the processor chip itself, it is generally impossible to create one that contains no ROM. There are some other types of ROM on the market, namely: PROM: Programmable ROM, which can be written only once using special equipment. EPROM: Erasable PROM, which can be erased using Ultra Violet light and used again. There are also some electrically erasable chips known as EEPROM. 2.1.3.2. RAM RAM stands for Random Access Memory. RAM contains bytes of information and the microprocessor can read or write to those bytes depending on whether the Read or Write signal is on. RAM chips lose their content once the power goes off. When talking of the memory of a computer we usually refer to its main memory or RAM. The typical RAM content of a microcomputer nowadays is 64 MB. The RAM is the working memory of the computer and it stores the user programs and data. There are two main types of RAM: Static and Dynamic RAM. Dynamic random access memory (DRAM) is the most common kind of RAM for personal computers and workstations. DRAM is dynamic in that, unlike static RAM, it needs to have its storage cells refreshed or given a new electronic charge every few milliseconds. Static RAM does not need refreshing because it operates on the principle of moving current that is switched in one of two directions rather than a storage cell that holds a charge in place. Static RAM is generally used for cache memory, which can be accessed more quickly than DRAM. DRAM stores each bit in a storage cell consisting of a capacitor and a transistor. Capacitors tend to lose their charge rather quickly; thus, the need for recharging. 2.1.3.3. CMOS CMOS or Complementary Metal Oxide Semiconductor memory is used to store the set up configuration of a computer. It is a Read and Write memory but its composition is different from the RAM since it does not lose its information when its power supply is cut off. CMOS is very expensive compared to RAM. It uses a battery to keep its information. So when the battery gets low, the CMOS loses its information. This is noticed when the computer loses its configuration and gives an error when turned on. 2.1.3.4. New types of memory Some newer types of memory are being developed. These memory chips are able to keep their information when the power supply is cut off. In this case they give a protection against power failure. But their price is an important factor affecting their use in a computer. 2.1.3.5. Cache memory Caching is a technology based on the memory subsystem of the computer. The main purpose of a cache is to increase the speed of the computer while keeping the price of the computer low. Caching appears on every computer in a variety of forms. There are memory caches, hardware and software disk caches, page caches, etc. Virtual memory is even a form of caching. Some important facts about caching: Cache technology is the use of a faster but smaller memory type to accelerate a slower but larger memory type. When using a cache, it must be checked to see if the item is in it. If the item is in the cache, we have a cache hit and if not, we have a cache miss and the computer must fetch the item from the larger, slower memory area. A cache has some maximum size that is much smaller that the larger storage area. It is possible to have multiple layers of cache. This would be a 2-level cache. Modern computers have both L1 and L2 caches. When the microprocessor accesses the main memory (RAM), it does so in an access time of around 60 nanoseconds. This is much slower than the typical microprocessor, which can have cycle times as short as 2 nanoseconds. We can also have a small memory bank with an access time of around 30 nanoseconds between the microprocessor and the RAM. The access time is hence twice faster than the main memory access. This is known as a level 2 cache or a L2 cache. We can build a smaller but faster memory system directly into the microprocessor's chip itself. This memory will be accessed at the speed of the microprocessor and not the speed of the memory bus. This is a L1 cache, which on a 233 MHz Pentium is 3.5 times faster than the L2 cache, which is 2 times faster than the access to main memory. There are a lot of subsystems in a computer; and a cache can be used between many of them to improve performance. Hence: We have the microprocessor, which is the fastest thing in the computer. Then there is the L1 cache caching the L2 cache. We have memory accesses at full microprocessor speed (< 10 ns, 4KB to 16KB in size usually) The L2 cache caches the main memory. We have memory access of type Static Random Access Memory (SRAM) (around 20 - 30 ns, 128KB to 512KB in size) The main memory is used as a cache for even slower peripherals like hard disks and CD-ROMs. We have memory access of type Random Access Memory (RAM) (around 60 ns, 32MB to 128MB in size) The hard disks are used to cache an even slower medium for example, the Internet connection. They are mechanical and slow (access time of around 12 milliseconds, 1GB to 10GB in size). The Internet is incredibly slow (between 1 sec. and 3 days) but has unlimited size. The Internet connection is the slowest link in the computer. So the browser (Internet Explorer, Netscape, etc.) uses the hard disk to store HTML pages into a special folder. The first time an HTML page is requested, the browser fetches it and a copy is also stored on the disk. When this page is next requested, the browser checks if the date of the file on the Internet is newer than the one cached. If the date is the same, the browser uses the one on the hard disk instead of downloading it from Internet. In this case the smaller but faster memory system is the hard disk and the larger and slower one is Internet. Cache can also be built directly on peripherals. Modern hard disks come with some fast memory (around 512K) hardwired to the hard disk. The computer does not directly use this memory, but the hard disk controller does. For the computer, these memory chips are the disk itself. When the computer asks for data from the hard disk, the hard disk controller checks into this memory before moving the mechanical parts of the hard disk, which is very slow compared to memory. If it finds the data the computer asked for in the cache, it will return the data stored in the cache without actually accessing data on the disk itself, thus saving a lot of time. 2.1.4. Slots for extension cards The motherboard contains a number of slots to add extension cards (see Figure 2-10 for an example) to the computer. These cards, also known as expansion boards, extend the possibilities of the computer. Figure 2-10: An extension card These slots exist as computer manufacturers have recognised the growing need for additional features in the computer. The possibility of a computer can be expanded since microcomputers have an open architecture and hence users can add new devices easily. The open architecture has been designed by a consensus among manufacturers. However, new devices cannot be added easily in computers having a closed architecture. The slots may have different width but the trend is for 64-bit width just as the system bus of the computer. The functions of some very commonly used cards tend to be integrated in the motherboard. For example some motherboards come with an integrated Sound Card as well as a TV card. Some examples of expansion card are: Video Card: All computers require a video card. The card usually contains memory (RAM) that is reserved for the video (monitor) display. For monitor displays at high color and resolution, 2 or more megabytes of RAM are required. Video cards can vary greatly in quality (as can sound cards) so it pays to study the specifications before buying a new computer. Network card: This card allows the connection of the computer to a network and deals with all network communications. SCSI card: Small computer system Interface cards use only one slot to connect several devices to the system unit. PC card: It is a small credit card sized card which is used in portable computers. PC cards have a number of purposes and are also known as PCMCIA (Personal Computer Memory Card International Association) cards. These cards are inserted and replaced outside the computer. A feature commonly associated with these cards is plug and play. It is a set of hardware and software standard to create devices that can configure themselves. The complex task of setting the configuration of these devices is thus eliminated. On startup, the computer is going to recognise and automatically configure any device added to it. 2.1.5. Ports Ports are connection sockets found outside the system unit at the back, in contrast to expansion slots found inside it. They are used for the connection of external devices. An example of a port is the printer port used to connect the printer. The port may be found on the system board itself or on an expansion board. Hence the printer port is on the motherboard while the speakers are usually connected to a port on the sound card. Ports may be parallel or serial. Parallel ports are used to connect devices over a short distance. Eight bits of data are transmitted in parallel. Apart from wires to carry the data, there are also some control lines. An example of a parallel port is the printer port. Serial ports send data one bit at a time. Some examples are the mouse, keyboard and modem ports. 2.1.6. Drives, The Storage Devices. Programs and data must be stored somewhere if they are to be used more than once. Hard disks, Floppy disks and CD ROMs are the most common forms of permanent storage devices. These devices act as both an input and output device. They are also used to transfer files from one workplace to another. A computer usually contains a number of drives and it is common to see one CD drive, one floppy disk drive and at least one Hard Disk in a computer. An important aspect to consider when choosing a data storage device is the Disk Access Time. This is the interval between the moment the command to transfer the data is given and the time the transfer is complete. Disk access times depend on the seek time and data transfer rate. Some newer types of drives have appeared in computers recently. Thus we find Zip drives which can be compared to Floppy disks of 100 MB or even higher and CDWriters. Storage devices are discussed in more details in Chapter 5. 2.1.7. Bus The bus, or bus line, connects the different parts of the system unit to each other as well as the components of the CPU to each other. The bus is a path for bits to travel and its width is an indication of the speed of a computer. The bus width currently used is 64 bits meaning that 64 bits can travel in parallel. There is a number of bus architecture on the market nowadays: ISA: The Industry Standard Architecture is currently 32 bits wide and was developed by IBM. MCA: The Micro Channel Architecture was developed by IBM for the 386 and is currently 64 bits wide. EISA: The Extended ISA is now 64 bits wide and was proposed by a consortium of nine computer manufacturers led by Compaq Computer Corp. PCI: The Peripheral Component Interconnect is a high-speed 64 bits bus, much faster than EISA and MCA buses. It is the most recently developed type. The width of the address bus on the other hand is a measure of how much memory the computer can address. The Intel Pentium III has an address bus of 64 bits and can hence address 264 bytes of memory. 2.1.8. System clock This component is found on the motherboard. All devices in the computer, including the microprocessor are sequenced by its speed. The faster the clock, the faster the computer can execute instructions. Its speed is expressed in terms of Megahertz (MHz). Current computers have a system clock running at 450 MHz. 2.2. Input and Output Devices These devices are found outside the system cabinet and are sometimes referred to as peripherals. They are meant to simplify our interaction with the computer and thus provide a means of communication between the computer and its human operator. Computers come with a number of Input and Output devices. The most common visible input devices are the Keyboard, the mouse and the scanner, while the most common output devices are the printer and the Video Display Unit. Peripheral devices are discussed in more details in Chapter 4. 2.3. Other types of computers Apart from the Personal computer used as main example in this chapter, there are some other types of computers we may come across. The sun Workstation is similar to a PC at first sight. But it uses a much more powerful processor such as the Sparc. It is mainly used for high end computing. Mini-computers and mainframes have several terminals attached to them, as they are multi-user systems. The trend is to put them in a network to allow more users to access them, just as for a Workstation. Embedded systems refer to dedicated systems built around a processor. An example is the Automatic Teller Machine (ATM) of banks. They have only one purpose and their Input/Output devices limit our interaction with them. There are also some multiprocessor machines used in computing extensive environments. These computers have several processors to process information at a higher rate. Another concept gaining momentum is clustering. A cluster is a group of terminals or workstations attached to a common control unit (or server) or a group of several servers that share work and may be able to back each other up if one server fails. As of mid-1997, a two-server Windows NT cluster in which each system could back up the other in case of failure was priced at about $23,000. The cost of writing failure scripts, considered to be a sophisticated programming task, would be extra. The cluster is a cheap alternative to expensive mainframes. References: Advanced Micro Devices Inc Web Site: http://www.amd.com ePanorama - microprocessor and microcontroller pages: http://www.usepanorama.net Information and Communications Technology Companion: http://www.painsley.org.uk/ictcompanion/ Intel Corporation Web Site: http://www.intel.com O’LEARY Timothy J. , O’LEARY Linda I., Computing Essentials, Irwin Mc Graw - Hill ROSENTHAL Morris, Online Illustrated Step-by-Step Guide to Building a New ATX PC Copyright 2000 by http://www.daileyint.com/ The Intel Microprocessor Quick Reference Guide, Intel Corporation Whatis.com Web Site: http://www.whatis.com Further Reading GAONKAR R. S., Microprocessor architecture, programming, and applications, New age International Limited, Publishers HALL D. V., Microprocessors and Interfacing, Glencoe Macmillan/ Mc Graw – Hill HAMACHER V. C., VRANESIC Z. G., ZAKY S. G., Computer Organization, Mc Graw - Hill