Sei sulla pagina 1di 20

14

Part A Computer Systems

System Unit

n this chapter, we shall study the system unit of a personal computer, the CPU, the factors that affect the performance of a CPU and the classification of main memory.

2.1

THE SYSTEM UNIT OF A PC

A computer system consists of both hardware and software. Hardware refers to the actual machinery, for instance, the microprocessor, keyboard, mouse and monitor etc. Software refers to programs or data. The hardware components of a basic computer system consists of 1. 2. 3. 4. 5. 6. Central processing unit (CPU) Main memory Input devices Output devices Secondary storage Communication devices.

Components other than the CPU and main memory are collectively known as peripheral devices.

Fig.2.1

The hardware components of a basic computer system

Chapter 2 System Unit


microprocessor

15

backview of a system unit

System unit with lid open

ports

memory module

interface card Fig.2.2 The system unit of a personal computer

A personal computer can be viewed as made up of a system unit and some peripheral devices. For a desktop computer, the system unit appears in the form of a metal or plastic case which houses the motherboard, CPU, main memory, interface cards, power supply and storage devices. For a notebook computer, the system unit encases almost all its electronic components in a metal or plastic case. Note that storage devices are regarded as peripheral devices.

Components on the Motherboard


The motherboard is the main circuit board that includes all essential chips, connecting circuitry and interfacing facilities. n

Chip A chip is an integrated circuit that contains many transistors on a


small piece of semi-conducting material. On the motherboard, there are sockets which allow certain chips to be removed for repairs or upgrades. Both the microprocessor and main memory are chips that can be plugged into the motherboard. Besides these important chips, other housekeeping chips also exist on the motherboard.

Connecting circuitry The connecting circuitry links between the chips


on the motherboard. For example, the connecting circuitry provides channels for data transfer between the CPU and main memory. Similar channels also exist between the main memory and peripheral devices. Each channel is called a bus and is made up of a number of conducting wires, allowing a series of electronic bits to transmit at the same time.

16

Part A Computer Systems

Fig.2.3

The address bus and data bus between the CPU and memory of a computer. MAR and MDR are registers in the CPU (see Chapter 10).

Each bus is a composition of address bus, data bus and control lines. For example, when a piece of data is fetched from the memory, the address is sent over the address bus to signal a memory location, and the data is then copied from the memory location to the data bus, which passes the data to the destination. n

Interfacing facilities The interface facilities of a motherboard appear in


the form of ports and expansion slots. A port is built on the motherboard and is designed to connect to a peripheral device or another computer. There are various types of ports designed for different peripheral devices (See Table 2.1). Usually, a cable is needed to connect a port to a peripheral device, like a printer, a keyboard or a mouse. There are also ports which is an EM-Wave transceiver that allows connection to peripherals using infrared or microwaves. A transceiver is a device that can send and receive signals. An example is the IrDA port which sends and receives infrared.

Port Name 1. 2. 3. 4. 5. 6. 7. 8. Keyboard and mouse port Serial port Parallel port SCSI port USB port IEEE 1394 port IrDA port (Infrared Data Association) PCMCIA port (for notebook computers only)

Peripheral devices Keyboard, mouse Mouse, modem, graphic tablet Printer SCSI devices, e.g. hard disk Large range of devices DV camcoder, digital camera Devices that use infrared (Not Bluetooth) PC cards, e.g. Network interface card, hard disk, sound cards, radio transceiver etc.

Table 2.1

Common ports and their corresponding peripheral devices

Chapter 2 System Unit


An expansion slot allows an interface card to be inserted into the motherboard. An interface card is a separate circuit board which is an add-on component to increase the function of a computer. Examples are the network interface card (NIC), video card, sound card and modem card. Some interface cards come with their own ports, allowing connection to other peripheral devices.

17

Card Name 1. Network interface card (NIC) 2. AGP video card 3. Sound card 4. Modem card
Table 2.2

Peripheral devices Switch or hubs of local area network or Internet Visual Display Unit Microphone, loudspeaker Telephone network

Common interface cards and the corresponding peripheral devices

Forms of chips A chip consists of a super thin slice of semi-conducting material packed with elements like wires, transistors, capacitors and resistors. Semi-conducting material, such as Silicon or Germanium, are substances with properties between that of a conductor and an insulator. A chip may be a microprocessor, memory module or supporting circuitry. It is packaged in a protective carrier that also provides connectors to other computer components. There are at least three forms of chip carriers: rectangular DIP (dual in-line package), circuit-board-like DIMM (dual in-line memory module), or pin-cushion-like PGA (pin-grid arrays).

DIP has two parallel rows of pins

DIMM is mainly used for memory module. The number of pins can be 72, 144, 168, 184 (DDR), or 284 (DDR-II). Fig.2.4 Three common forms of chip carriers

PGA is mainly used for microprocessors. The pins are arranged in concentric squares

18

Part A Computer Systems

2.2

THE CPU

A central processing unit (CPU) is designed to process instructions that operate a computer. The CPU of a personal computer is a microprocessor, which is a single integrated circuit that contains millions of transistors. A microprocessor performs essentially the same tasks as the CPU of a classic mainframe. It is sometimes described as a CPU on a chip. A CPU consists of two major components: the CU and ALU. It also includes circuitry for devices such as registers, cache memory and various execution units. n

CU
The control unit (CU) controls the overall operations of the computer. It repetitively interprets an instruction from a program and starts appropriate action. It also controls the operations of the peripheral devices.

Note

Integer arithmetic are handled by the ALU. A similar unit called floating-point unit (FPU) is designed to handle real number arithmetic. An integer unit consists of an ALU and its own CU. A modern CPU has several integer units and at least one FPU.

ALU
The arithmetic and logic unit (ALU) performs arithmetic operations, such as addition and subtraction of integers. It also performs logical operations such as comparing two numbers to see if they are the same.

Registers
Registers are special memory locations inside a CPU, allowing fast access. Some of them are needed by the ALU in computation to hold data to be processed. Others are needed by the CU to control the execution of instructions. A typical CPU includes memory address register (MAR), memory data register (MDR), instruction register (IR), program counter (PC), general purpose registers, and so on. Registers are accessed by machine instructions. While an address of a main memory location involves several bytes, the address of a register may require only several bits.

Fig.2.5 The CPU and other hardware components

Chapter 2 System Unit

19

2.3

PROCESSOR PERFORMANCE FACTORS

The performance of a CPU is affected by several factors: clock rate, word length, cache size, instruction set and processing techniques.

A.

Clock rate

A CPU works with a timing device, called clock, which generates ticks (or clock cycles) regularly. The clock rate is the number of ticks produced per second. It determines the pace for executing instructions. The unit of clock rate is hertz (Hz). Mega (M) is a prefix representing one million (106). Giga (G) represents one billion (109). For example, a 800 MHz PowerPC microprocessor produces 800 million ticks in one second and a 3.0 GHz Intel Pentium 4 microprocessor operates at a speed of 3 billion cycles per second. All other things being equal, a computer of the same family with a 3.0 GHz is faster than a computer with 2.0 GHz. Clock rate should not be used to compare computers of different brands (See Chapter 10). It is important to understand that the clock rate of a CPU is not equal to the number of instructions that the CPU can execute in one second. The reason is that most instructions take several ticks to complete. The execution of an instruction involves several stages each requires at least one tick. We shall see that clock rate is not the only factor that determines the CPU performance.
Note

A tick is the smallest unit of time in the universe of microprocessor. In a single processor system, every action performed by a CPU is finished in a multiple number of ticks.

Itanium 2 Typical use Clock rate Word length No. of transistors As of date
Table 2.3
Demanding enterprise-class servers

Pentium 4
Desktops and entry-level workstation

Intel486TM DX Intel386TM DX 80286


Desktops Desktops Desktops

8086
Desktops

1.6 GHz 64 bits 592 million Nov 2004#

3.80 GHz 32 bits 125 million Nov 2004+

50 MHz 32 bits 1.2 million Oct 1989*

33 MHz 32 bits 0.275 million Oct 1985*

10 MHz 16 bits Jan 1982*

4.77 MHz 16 bits Aug 1978*

0.134 million 0.029 million

Development of Intel processors (Information extracted from www.intel.com) # Itanium was introduced in 2001 + Pentium class was introduced in 1993 and Pentium 4 was introduced in 2000 *Date of introduction See Appendix for further details.

Intel clone Today, Intel is the world's largest chipmaker and supplies a significant percentage of the microprocessors that power PCs. Other companies, like Advanced Micro Devices (AMD), also make Intel-compatible processors, known as Intel clones, but at a lower price. AMD's Athlon processors are direct competitors to Intel's Pentium class CPU and have a slight performance advantage according to some software benchmarks. (Note: Cyrix which once produced Intel486TM compatible CPU has been bought by VIA) Clock rate is one of many factors that determine the performance of a CPU. Today, only Intel still uses clock rate as a selling point in her marketing strategy. As of the print of this book, it is generally agreed that, given the same clock rate, AMD Athlon is about 30% faster than Intel Pentium 4.

20

Part A Computer Systems

B.

Word length

Word length refers to the number of bits that a microprocessor can manipulate at one time. Word length is the size of the general-purpose registers in the CPU. In general, a longer word length will give better performance. Suppose we wish to perform an addition of two 32-bit numbers. If the registers are all 16 bits, each value will have to be stored in two registers and the calculation will involve two separate additions. If the registers were all 32 bits, the amount of processing would be halved. Today's personal computers typically contain 32-bit. Advanced computers use 64-bit processors.

C.

Cache Memory
Data transfer between the CPU and main memory is slow. Very often, the CPU has to wait for memory access and becomes idle. Cache memory is a high-speed memory that holds data which duplicate some data stored in the main memory. When the data needed by the CPU are stored in the cache memory, the access time will be much smaller than fetching the same data from the main memory. Cache memory is divided into at least two levels: Level 1 (L1) cache and Level 2 (L2) cache, located in different dies. A die is a silicon slice inside a chip. L1 cache is located in the same die as the processor, whereas L2 cache is located in a separate die. Current microprocessors include both L1 and L2 caches in the same protective carrier (i.e. same chip). But, in the past, L2 appeared as a separate chip.

Fig.2.6

Cache memory

L1 cache is faster but smaller than L2 cache the L1 capacity is usually measured in KB, while that in L2 is in MB. Since cache memory is fixed inside the processor, its size is not configurable.

x-bit processor What does x in an x-bit processor mean? x represents the number of bits used in general-purpose registers (i.e. the integer registers) inside the processor. For example, the size of integer registers in a 32-bit processor is 32 bits. Normally, a processor with longer word length will also have wider data bus and wider address bus. However, it is not necessarily true that the widths of these buses are the same as the word length. An example is Intel Pentium 4, which is a 32-bit processor, but with 36-bit address bus width and 64-bit data bus width. 32-bit CPUs have been common in personal computers since Intels 386 in 1985. In 2001, Intel released its first 64-bit CPU Itanium. In 2003, AMD released its first 64-bit CPU Athlon 64. Using a processor with longer word length will make working with huge amount of data easier, such as video editing. However, general computation can be slower because programs will be larger in size and may not be fit completely into the cache memory. The movement from a 32-bit to a 64-bit CPU is a major alteration, since operating systems must be modified to take advantage of the new architecture.

Chapter 2 System Unit

21

D.

CISC or RISC

In 1970s, there was a tendency to offer more varied functions and give more high-level features to machine instructions. The result is an increase in size of the instruction set and complexity of the instructions. This tendency continued until mid-80s, when chip designers realised that complex instructions could not improve the CPU performance, because the difference in time for performing instructions is not suitable for pipelining (see below). A CPU with complex instructions is referred to as CISC (Complex instruction set computer) architecture. An example is the Intel 80286 microprocessors. A CPU that includes a very limited set of instructions is referred to as RISC (Reduced instruction set computer) architecture. Examples are Motorolas PowerPC and Suns SPARC. Because RISC instructions are simple, most of them use the same set of stages and take equal time to complete. This facilitates pipelining and parallelism resulting in higher execution speed. Another advantage is that RISC chips are less complicated and require fewer transistors (though more registers), reducing the cost of design and production. However, RISC architecture requires more instructions for the same program. The trend is that newer CISC CPUs are designed with a subset of RISC instructions, and traditional instructions are split into many RISC instructions so that the CPU can make use of the advantages of RISC. An example is the Intel Pentium 4 microprocessors.

Note Intel 80286 is a typical CISC CPU. Starting from 386, features of RISC can be found in Intel processors.

Note More registers are needed in RISC to reduce memory access. Some may think that more registers will increase the cost of a CPU. But, this is cost-effective as the CPU performance can be enhanced.

E.

Pipelining

As mentioned earlier, most instructions require several clock cycles to complete (see Clock rate). In fact, each instruction involves several discrete stages. In a traditional processor, instructions are executed so that all the stages of an instruction are completed before the next instruction can be executed. Pipelining is a technology that allows execution of the next instruction to start before the previous instruction is fully completed. Pipelining increases the throughput of the system.

Clock cycle Sequence Stage 1 Stage 2 Stage 3 Stage 4 Stage 5


Fig.2.7

1 I1

2 I1

3 I2 I1

4 I2 I1

5 I3 I2 I1

6 I3 I2 I1

10

11

12

13

14

15

I3 I2 I1

I3 I2 I1 I3 I2 I2 I3 I3 I3

A pipeline with five stages that can overlap. For example, when the CPU is performing stage 2 of I1, it is also performing stage 1 of I2. (I1, I2 and I3 represents three instructions, each of 5 stages)

22

Part A Computer Systems


A daily life example of pipelining is serving set lunch in a fast food caf. Assume that each set-lunch includes soup, bread, main course and drink. Instead of preparing the whole set in a single counter, the caf may set up four counters. A customer after getting the soup will proceed to the next counter which serves breads. The second customer will then be served soup, without having to wait for the completion of the first customer.

Note

1.

In Intel386, the FPU is an optional chip known as Math co-processor. Intel Pentium 4 has 1 FPU; Intel Itanium and AMD AthlonXP each has 2 FPU.

F.

Multiple Execution Units Superscalar

2.

3D-NOW! The 3D-NOW! technology is developed by AMD to perform multimedia tasks quickly, such as 3D games. It is characterised by a set of FPU-specific instructions that carry out floating-point arithmetics needed by 3D graphic display.

An execution unit (or function unit) is a part of the CPU that performs operations and calculations. Examples are integer unit and floating-point unit (FPU) which handles integer and floating-point mathematics respectively. In fact, an integer unit consists of an ALU and its own CU. A processor with multiple integer units and one or two FPUs is called superscalar architecture, allowing more than one instruction to be executed concurrently in the same chip. Note that concurrent here is not referring to the overlapping of instruction stages as in pipelining, but complete separation of execution processes.

G.

Multiple processors

A computer system may consist of multiple processors. It means that a number of separate processors are working in parallel to solve a single problem. The processing is called multi-processing. Superscalar and multi-processing are examples of parallel processing (or parallelism). Unlike pipelining and superscalar, multi-processing requires a special operating system that supports multiple processors. Do not confuse multi-processing with multi-tasking the latter usually describes the capability of a single CPU (See Chapter 4).

H. Distributed processing
Distributed processing refers to aggregating the power of several computers to run a single computational task in a collaborative manner. An example is the use of the Web. A Web server, routers, DNS servers and a Web browser together form a distributed system. Another example is the UC Berkeley SETI (Search for Extra-Terrestrial Intelligence) project, SETI@home. You may contribute your CPU time to help analyse data collected from the outer space.

Fig.2.8 The program SETI@home running as a screen saver

Chapter 2 System Unit

23

2.4

MAIN MEMORY

Besides the microprocessor, main memory is another important component found on the motherboard. The main memory (or memory), which includes RAM, ROM and CMOS, stores data, instructions and some vital information about the computer. Main memory is classified into: volatile and non-volatile. The contents of the volatile memory will be lost when the computer power is turned off. On the other hand, non-volatile memory will retain the contents after the power is turned off.

A.

Types of Memory
There are three types of memory: RAM, ROM and CMOS.

Fig.2.9 Memory of a computer

1.

RAM

Other RAM RAM not only exists on the motherboard, but can also be found in peripheral devices, like video adapter and hard disk. The RAM in a video adapter is used to display images on the screen of a VDU. Each pixel corresponds to a piece of data in the video RAM. So, a screen with higher resolution needs more video RAM. The RAM in a hard disk is used as buffer (see Chapter 10).

Random access memory (RAM) is a temporary holding area for data, application programs and the operating system, as long as the computer is running. RAM is volatile. All personal computers today use dynamic RAM (DRAM) for the main memory. In a DRAM, capacitors are used to hold the bits a charged capacitor represents a 1 and discharged capacitor represents a 0. Since the charge on a charged capacitor will drain away as time goes by, DRAM needs recharging from time to time. (Static RAM is made of transistors and is used in cache, registers and CMOS) Speed of RAM indicates how fast the RAM circuitry reacts to update the data. It can be expressed in nanoseconds (10-9 s) or MHz (106 Hz). For example, 8 ns RAM means it takes 8 ns to update a piece of data. 8 ns is equivalent to 1/(8 10-9 s) = 1.25 108 Hz or 125 MHz. Under equal conditions, 8 ns RAM is faster than 10 ns RAM.

Types of RAM RAM can be classified into 1. 2. 1. 2. 3. SRAM Static, used in cache memory, registers and CMOS DRAM Dynamic, used in the main memory EDO RAM Extended data out, less popular SDRAM Synchronous DRAM, most popular RDRAM Rambus DRAM, more expensive

Note

DRAM is further classified into

SDRAM can have different effective speeds under the same clock rate, arranged in ascending order of speed: 1. 2. 3. SDR SDRAM Single data rate SDRAM DDR SDRAM Double data rate SDRAM DDR-2 SDRAM Double data rate two SDRAM, will be the most popular. There is also DDR-3 SDRAM.

Loading a file means copying data from the secondary storage to the main memory. When the computer is powered on, certain operating system files are loaded automatically from the hard disk into the RAM. Saving a file means copying data from RAM to the non-volatile secondary storage.

24

Part A Computer Systems

2.

ROM

Read only memory (ROM) stores data permanently and is non-volatile. The contents in ROM can be read but cannot be changed. The instructions stored in ROM are known as firmware, which means that the instructions are stored permanently in a chip instead of disc. Instructions are said to be hard-wired in ROM.

A.

Variations in Non-volatile Memory


There are other types of ROM: PROM, EPROM and EEPROM.

PROM stands for programmable read only memory. It is a memory chip that can be written once. A special device called PROM programmer (or burner) is needed to write the user's data and instructions. Once written, the contents cannot be changed any more. PROM is different from ROM in that a PROM is manufactured and sold as a blank memory. PROM is used for storing the specialised or unique programs that custom-manufacturing of a true ROM would be too costly. A well known use of PROM is by the video game producers. EPROM stands for erasable programmable read only memory. It is similar to PROM, except that the contents can be erased under ultraviolet. An example of use is in manufacturing industry where other types of storage are not suitable. The EPROM provides instructions to a machine that performs repetitive tasks in manufacturing a certain product. When the old production is finished and a new production is started, the old instructions can be erased. Then, the EPROM is programmed with a new set of instructions. EEPROM stands for electrically erasable programmable read only memory. It is similar to RAM in that it can be read and written using a computer. But, unlike RAM, EEPROM is non-volatile, i.e. it does not need continuous power to retain the data. Some people called EEPROM as flash memory. But, there is a slight difference between the two: EEPROM writes one byte at a time, whereas flash memory writes a block of bytes at a time. Therefore, flash memory is faster.

B.
Note

BIOS

Some computers have dual bios a main BIOS and a backup BIOS. The purpose of using two BIOS chips is to help the motherboard recover from issues that may happen during a BIOS update and help protect the BIOS from any potential virus, such as CIH in 1999.

The startup program BIOS (basic input/output system) used in computer is stored in an EEPROM (or flash ROM). This explains why BIOS can be updated. BIOS is part of the system programs. These instructions tell the computer how to access the hard disk, find the operating system, and load it into RAM. Once the operating system is loaded, the computer will understand your input, run software and access your data. See Fig.4.11.

Chapter 2 System Unit

25

3.

CMOS Memory
Note

CMOS memory (Complementary metal-oxide semiconductor memory) is a type of memory on the motherboard that stores the configuration information about a computer. It includes information like current time and date, capacity of hard disk, types of existing ports, keyboard and monitor, and so on. However, CMOS does not store programs. CMOS memory is usually powered by a small battery. Unlike ROM, the computer can change the information in CMOS memory. Unlike RAM, the contents in CMOS memory are retained even the main power supply is turned off. This is because the contents in CMOS memory are kept by an independent battery.

It is controversial to say whether CMOS memory is volatile or not. From users point of view, CMOS is non-volatile because the data you enter will remain unchanged after the computer is powered off. From the engineers point of view, CMOS is volatile because CMOS is made of transistors which require electrical power to hold the data. Therefore, it depends on how volatile is defined.

Fig.2.10

CMOS display

RAM Permanence Flexibility Type of information Size Upgradable


Table 2.4

ROM non-volatile read only system program and data small no

CMOS memory Contents are kept by a battery read and write configuration data smallest no

volatile read and write data and instructions being processed largest yes; memory size can be increased

Comparison between RAM, ROM and CMOS

26

Part A Computer Systems

B.
Note ASCII uses 7 bits to represent characters. Since the minimum accessible unit in a computer is one byte, in modern computers, an ASCII character is stored using 8 bits with the most significant bit (leftmost bit) set to 0.

Memory Size

Memory size is measured in byte. A byte consists of eight bits. Each ASCII character requires one byte or eight bits of memory. Manufacturers always produce memory in multiples of 210 = 1,024 bytes or one kilobyte, abbreviated as KB or K. For example, a memory of 128 KB is equal to 128 1,024 = 131,072 bytes. In recent years, memory size increases drastically. Memory chips are produced to hold kilo of kilobytes, called megabyte (MB). 1 MB is equal to 220 = 1,024 1,024 bytes = 1,048,576 bytes. Similarly, larger memory size is measured in kilo of megabyte, called gigabyte (GB). 1 GB is equal to 230 =1,024 1,024 1,024 = 1,073,741,824 bytes. Sometimes, for the purpose of simplicity, 1024 is rounded down to 1000. Therefore, 1 KB is approximately equal to one thousand bytes. 1 MB equals approximately one million bytes and 1 GB approximates one billion bytes. The size of main memory affects the efficiency of the computer. A computer is usually upgraded by increasing the memory size. This explains why the memory chips are removable from the motherboard.

Note In 1990s or before, specifications of storage mainly used K for 1024 and M for 1048576; whereas specifications for rate of transmission used K for 103 and M for 106. In recent years, storage capacity also using M for 106 and G for 109 become popular. This is perhaps due to two reasons: 1. New terms like kibi, mebi, and gibi appear to represent 210, 220 and 230 respectively. The new storage capacity is so high that consumers do not care about the small differences.

Term
Kilobyte Megabyte Gigabyte
Table 2.5

Abbreviation
KB / K MB GB
Memory and storage size

Approximate Memory Size (bytes)


103 = 1,000 106 = 1,000,000 109 = 1,000,000,000

Exact Memory Size (bytes)


210 = 1,024 220 = 1,048,576 230 = 1,073,741,724

2.

What should be considered in upgrading a microprocessor? The first thing to consider is budget. The price of the latest and fastest microprocessor is often much higher than the second or third latest versions. Sometimes, it can be as high as half the price of the entire system unit. The second thing to consider is the type of chipset and CPU socket on the motherboard. The new microprocessor must match with the existing motherboard. The third thing to consider is that a microprocessor can operate at full efficiency only if all of the components in the computer also can handle the faster speed. It means that you may need to replace the RAM or motherboard as well. To find out whether an upgrade would be worth the cost, you might do a little research on the Web or in computer magazines.

Chapter 2 System Unit

27

C.

Data Access in memory

The main memory can be thought of as a series of locations each of length one byte. Each location has a unique address, counting from zero onwards. The address is called memory address. For example, for a computer with a memory size of 1 K, the memory address ranges from 0 to 1,023. Since each byte has a unique address, the CPU can jump directly to the requested data (see note). Therefore, data fetching and storing can be done very efficiently. This mode of data access is called direct access, which is in contrast to sequential access. In sequential access, address is unknown. Data are accessed by searching from one end of the storage medium until a match occurs. Example of sequential access is to locate data from a tape or finding a word in a document.

How does a computer jump to the requested data? Suppose the CPU needs a data in the memory. The address for that data is put into the address bus. The bus circuitry interprets the address and locates the requested data in the memory. The data is copied to the data bus, which passes the data to the CPU.

Fig.2.11

Memory address

D.

The Maximum Size of Memory

Clearly, the size of a memory is limited by the maximum address. The maximum address is determined by the number of bits used in each address. For example, if 8 bits are used as address, the address space is from 0000 00002 to 1111 11112, which is equivalent to 0 to 28-1, or 0 to 127. Therefore, the maximum size of memory is 128 bytes. In general, if n bits are used to represent an address, then the maximum size of memory = 2n bytes. In a computer, the number of bits used in each address is determined by the width of the address bus. For example, in Pentium 4, the address bus width is 36 bits. It means that it can address up to 236 bytes (or 26 230 = 64 GB = 6.87 1010 bytes).

28

Part A Computer Systems

E.

Virtual Memory

As the main memory is limited in size, will a computer run out of memory? The solution to this problem is virtual memory. Virtual memory is an area of a hard disk that extends the RAM. If the free space of RAM is less than the size of a new data from a file, data in RAM not recently used and not frequently used will be put to the virtual memory to make room for the new data. This process is called swapping. When the data on virtual memory are needed afterwards, they would be swapped back to the RAM again.

Note In the old days of Windows 3.1, too much swapping would easily lead to system crash.

The process described above is done by the computer automatically and is transparent to the users. Swapping will slow down the performance of the computer. For this reason, the performance of a computer also depends on the size of RAM, amount of free space of the hard disk and speed of the hard disk (See Chapter 10 for other factors). Increasing the size of RAM will reduce the chance of swapping data between RAM and hard disk.

Virtual memory

hard disk

RAM

CPU

Fig.2.11

Virtual memory is used to extend the RAM

Chapter 2 System Unit

29

Summary
n The hardware components of a basic computer system consists of n n n n n n n n n Central processing unit (CPU) Main memory Input devices Output devices Secondary storage Communication devices.

Peripheral devices are components other than the CPU and main memory. The motherboard is the main circuit board that includes all essential chips, connecting circuitry and interfacing facilities. A chip is an integrated circuit that contains many transistors on a small piece of semi-conducting material. A bus is a channel that connects all components, including the CPU and main memory and peripheral devices. A bus comprises address bus, data bus and control lines. A port connects the motherboard to peripheral devices or other computers. An expansion slot allows an interface card to be inserted onto the motherboard. An interface card is a separate circuit board which is an add-on component to increase the function of a computer. A central processing unit (CPU) is designed to process instructions that operate a computer. It consists of CU, ALU, registers, cache memory and various subsidiary processors. The control unit (CU) controls the overall operations of the computer. interprets an instruction from a program and starts appropriate action. It also controls the operations of the peripheral devices.

n n n n n n n

The arithmetic and logic unit (ALU) performs arithmetic operations and logical operations. Registers are special memory locations, allowing fast access. The performance of a CPU is affected by clock rate, word length, cache size, instruction set and processing techniques. The clock rate is the number of ticks produced per second and determines the pace for executing instructions. The clock rate of a CPU is not equal to the number of instructions that the CPU can execute in one second. Most instructions take several clock cycles to complete. Word length is the size of the general-purpose registers in the CPU and determines the number of bits that a microprocessor can manipulate at one time.

30

Part A Computer Systems


n Cache memory is a high-speed memory that holds data which duplicate some data stored in the main memory. Cache memory reduces memory access time. L1 cache is smaller than L2 cache, but faster. L1 cache is built into the processor die, whereas L2 cache is located in a separate die. A die is a silicon subtrate. A microprocessor may have more than one die. CISC (Complex instruction set computer) architecture n consists of complex instructions has a large instruction set not suitable for pipelining consists of simple instructions with equal length, equal number of stages and equal execution time has a smaller instruction set suitable for pipelining requires fewer transistors lower cost of design and production allows execution of the next instruction to start before the previous instruction is fully completed increases the throughput of the system.

n n n

RISC (Reduced instruction set computer) architecture

Pipelining

n n n n n

An execution unit is a part of the CPU that performs operations and calculations, including integer unit and floating-point unit. An integer unit is the combination of a CU and ALU that handles integer arithmetic. A floating-point unit (FPU) handles floating-point mathematics. Superscalar architecture is a CPU with multiple integer units and one or two FPUs in the same chip. Multi-processing means using a computer system with multiple processors. It requires a special operating system that supports multiple processors. Parallel processing refers to execution of the same task by multiple processors or execution units at the same time. Distributed processing refers to aggregating the power of several computers to run a single computational task in a collaborative manner. In a volatile memory, data will be lost when the computer power is turned off. Random Access Memory (RAM) is a volatile memory for data, application programs and the operating system while the computer is running. Read only memory (ROM) is a non-volatile memory that stores data permanently. Firmware is the instructions stored in a ROM. PROM (programmable ROM) can be written once and sold as a blank chip. It is used in some video game.

n n n n

n n n

Chapter 2 System Unit


n EPROM (erasable programmable ROM) can be written and the contents can be erased under ultraviolet. It is used in controlling robots in manufacturing and re-programmed when a new production is started EEPROM (electrically erasable programmable ROM), also called flash memory, is non-volatile memory that can be read and written using a computer. BIOS (basic input/output system) n is a startup program stored in an EEPROM. tells the computer how to access the hard disk, find the operating system, and load it into RAM.

31

CMOS memory (Complementary metal-oxide semiconductor memory) stores the configuration information about a computer, but does not store programs. is powered by a small battery

n n n n n n n n n

Memory size is measured in byte. A byte consists of eight bits. 1 KB = 210 bytes; 1 MB = 220 bytes; 1 GB =230 bytes. Each memory location has a unique address. Direct access is data access using address. It is more efficient than sequential access. Sequential access is data access without address. Data are accessed by searching from one end. If n bits are used to represent an address, then the maximum size of memory = 2n bytes. Virtual memory is an area of a hard disk that extends the RAM. Swapping is needed when a new data exceeds the free space of RAM. Then, data in RAM not recently/frequently used will be put to the virtual memory to make room for the new data. Swapping reduces performance. Too much swapping may lead to system crash. Increasing the size of RAM will reduce the chance of swapping.

n n

Review Exercise
Multiple Choice Questions
1. A register A. is a high speed memory. B. is a peripheral device. C. carries data between the CPU and main memory. D. carries out additions.

32

Part A Computer Systems 2. Data from a peripheral device are transmitted to the CPU through A. the control unit. B. a data bus. C. an address bus. D. an expansion slot. A 32-bit CPU means that A. the data bus consists of 32 lines. B. the address bus consists of 32 lines. C. the control line consists of 32 lines. D. the word length is 32 bits. Given that the data bus of a computer consists of 32 lines. How many data can be transmitted at one time? A. 32 bytes B. 4 bytes C. 232 bytes D. 256 bits Which of the following about cache memory is NOT correct? A. L1 cache is faster than L2 cache. B. L1 cache is smaller than L2 cache. C. L1 cache is faster than main memory. D. L1 cache is mounted on the motherboard and separated from the microprocessor. A cache memory stores A. the booting program. B. the temporary data in an execution. C. the configuration information of a computer. D. a copy of some data in the main memory. Given that the clock rate of a CPU is f Hz. A. Each instruction is finished within 1/f s. B. The CPU can perform f instructions in each second. C. The CPU can perform more than f instructions in each second. D. The CPU can perform less than f instructions in each second. Given that the clock rate of a CPU is 3 GHz. The duration of a clock cycle is A. 3 106 s. B. 3 109 s. C. 3.33 10-10 s. D. 3.33 10-6 s. Pipelining increases A. the CPU clock rate. B. the instruction execution time. C. the memory size. D. the throughput of a CPU. Which of the following about a RISC architecture is NOT true when compared with CISC architecture? A. The instruction set of RISC is smaller than that of CISC. B. All the CISC instructions have the same number of stages. C. The cost of design of a RISC CPU is less than that of a CISC CPU. D. Given the same task, more RISC instructions are needed than CISC instructions.

3.

4.

5.

6.

7.

8.

9.

10.

Chapter 2 System Unit 11. The number of bytes in a 512 M RAM is A. 5.120 108 B. 5.369 108 C. 6.4 107 D. 4.096 109 Which of the following is executed when the computer is powered on? A. BIOS B. DOS C. CMOS D. EPROM Which of the following retain(s) data when the main power is turned off? (1) Flash ROM (2) CMOS (3) RAM A. B. C. D. 14. (1) only (2) only (1) and (2) only (2) and (3) only

33

12.

13.

Given that the memory size of a computer is 512 MB. What is the minimum number of address lines need? A. 29 B. 25 C. 19 D. The answer depends on the width of data bus. The address bus of a computer consists of 12 lines. What is the maximum addressable memory size? A. 12 bytes B. 4096 bytes C. 4096 bits D. The answer depends on the width of data bus. A 32-bit computer has address bus width 36 and data bus width 64. A. The length of the register is 36 bits. B. The maximum memory size is 236 bytes. C. The data bus moves one word of data at a time. D. The computer can process 64 bits of data in each machine instruction. The virtual memory of a computer A. extends the size of RAM by using the hard disk. B. extends the size of RAM by using the cache memory. C. is a fast memory that improves the performance of a CPU. D. is an extra hard disk. Which of the following allows both read and write? (1) EEPROM (2) ROM (3) RAM A. B. C. D. (1) only (2) only (1) and (3) only (1), (2) and (3) only

15.

16.

17.

18.

Potrebbero piacerti anche