Sunteți pe pagina 1din 10

COMPUTER TUTORIAL

Introduction

In the modern world, computer systems are playing a greater and greater part in everyday life. From office work, to entertainment, to providing information, the personal computer is quickly becoming a more integral part of the home. However, most PC users have no idea how most of the parts which make up their computer work internally. his tutorial system is designed to teach users with a basic knowledge of computing about the workings of the many components which make up the modern day computer system. hese components can be categori!ed broadly into four different categories, illustrated below. o learn more about any section, click on the corresponding image.

Input

Output

Data Storage

Other Components

If at any time during your passage through this tutorial you are unclear on how to proceed, or require assistance, please do not hesitate to click the help button that is located at the bottom of each page. his will take you to the help section, designed to answer any questions you may have about this tutorial system.

Input
In order for a computer to receive the requests and instructions of the user, one or more methods of inputting data and information to the computer are required. "elow are brief details of the most common of these input devices. If a full tutorial regarding a particular form of input is available, a link will be displayed alongside the name of the device.

Keyboard
his is the main input device for te#tual data on almost all computers. It also has special keys, such as the arrow keys, escape, shift and control, which are used for performing more comple# functions. In $nglish speaking countries the keys are laid out in %&'$( )% format, named as such after the order of the keys on the first row of letters.

Mouse
* small hand+held input device, normally made of plastic, which aids the user in using graphical user interfaces. *s the mouse is moved by the user, a ball on the bottom of the mouse rolls against wheels within the device itself. he movement of these wheels is then processed by the computer to determine how the mouse has been moved, and the on screen pointer is moved accordingly.

Joystick
he ,oystick is originally from the field of aviation, where it refers to the control stick used by a pilot to control the flight of the plane. *s such it is mainly used for interaction with computer games, in particular flight simulators. It consists of a lever, or stick, which is moved by the user and transmits

these movements to the computer. It also normally has additional buttons or switches that are used in addition to the stick.

Joypad
-imilar to a ,oystick, the ,oypad is designed for gaming input. In many ways it is identical to the ,oystick, with the main difference being the use of a multi+directional touchpad in place of the stick. It is most commonly used with games consoles, but also suitable for computers. .ore recent models also have analogue control sticks, used as miniature ,oysticks. he ergonomics of the device are also different, with the pad designed to be held with both hands.

Graphics Tablet
* flat rectangular input device, where a stylus or similar pointing device is used on its surface. he position of the stylus is translated into the onscreen co+ordinates of the pointer. .ost commonly used for graphics design and engineering work, or other programs where a more precise form of input is required from the user.

Scanner
he scanner is a device which captures photographs and other images, for editing and display by programs such as 'indows Paint, *dobe Photoshop or /asc Paint -hop Pro. .any different kinds of scanner e#ist, such as small hand+held and feed+in scanners, but the most commonly used type is the flatbed, pictured to the left.

Output
For a computer to communicate with the user and display information that is being worked on, some form out output device is required. "elow are brief details of the most common output devices. If a full tutorial regarding a particular device is available, a link will be displayed alongside the name in the blue bar.

Monitor
.onitors, or visual display units 0123s4 are similar in appearance to televisions and are an essential part of the visual output of a PC. Images, te#t and other information are displayed on the screen as a collection of small dots, or pi#els. .onitors can display output at a variety of different resolutions, with higher resolutions allowing the display of more pi#els, and hence a larger degree of information. *gain similarly to televisions, monitors traditionally have a 567 width to height ratio.

Printer
Printers are used to produce a physical copy of data, sometimes known as a %hard copy%, by printing the information onto paper. here are various different types of printer, with ink,et printers being the most commonly found in everyday homes. hese spray ink from small replaceable cartridges housed within the printer onto the paper to form the desired patterns. 8ther types include dot+matri#, laser and in some rarer instances, thermal.

Speakers
he audio output of the computer system relayed through the speakers. his enables audible alerts to be given to the user, as well as the playback of other sounds and music. .ore advanced speaker systems e#ist, allowing certain programs 0such as music creation software and games4 to use surround sound capabilities to beneficial effect.

Data Storage
For a user to be able to use a computer to work on data of any kind, it is essential that the data is stored in some manner. "elow are summaries of the most common forms of data storage. If a full tutorial regarding one of these forms is available, a link will be displayed alongside the name in the blue heading bar.

ard Dri!e
he main form of storage within a modern computer unit, a hard drive is essentially a magnetic disk on which large amounts of data can be stored. Hard drives come in a wide variety of different si!es, ranging from hundreds of megabytes to over two hundred gigabytes of storage space. his larger amount of storage space comes at the e#pense of portability + although removable hard drives now also e#ist.

"loppy Dri!e
3sed to access data from smaller, portable storage called floppy disks. he most common kind of floppy disk now used is the 7.9inch disk, which usually have a storage capacity of nearly one and a half megabytes of data. he disk is much slower to access than a hard drive, and clearly of a much lower capacity, but the benefit comes from the portability of the data. However, the recent advent of affordable rewriteable C2 drives has led to a downturn in the usage of floppy disks.

CD#$OM % D&D Dri!e


C2+(8. drives read data from the indentations on a compact disc 0similar to music C2s4 by the use of a laser, while 212s do the same thing but with the more modern 212 format. C2s can contain up to seven hundred megabytes of data, while 212s can reach as much as seventeen gigabytes. *s such, they are now the standard form of distribution for large amounts of data and larger software applications. 'riteable and rewriteable drives now also e#ist, and are increasingly used for personal data storage.

Memory
.emory is used for shorter term data storage, with data and programs being stored in memory temporarily while in use. he main memory used by a computer is known as (*., or (andom *ccess .emory, and can be both read from and written to. (*. is volatile, and requires constant electricity flow in order to maintain the contents. *s soon as power is interrupted or the computer is switched off, then the contents of the (*. are lost.

Other Components
'hile many important components have already been discussed, there are a great many important parts of the PC which do not fall under of the previous three headings. 8n this page you can find brief summaries of these. If a full tutorial regarding a particular device is available, a link will be displayed alongside the name.

Motherboard
he motherboard is the main circuit board of a computer. he processor, fan, memory and certain other components are directly mounted on the motherboard itself, while other boards and components are connected to and controlled by it. he architecture of the motherboard determines the range and number of components that can be connected to it, with different designs needed for different types of processor.

Microprocessor
he microprocessor, or CP3 0Central Processing 3nit4 is often referred to as the central brain of the PC. he ma,ority of the operations of the computer are in some way handled by the processor. 2ifferent CP3s are characteri!ed by three main characteristics6 the set of instructions they are able to e#ecute, the bandwidth 0which governs how much data can be processed by a single instruction4, and the clock speed. his is measured in megahert!, and determines how many instructions the processor can e#ecute per second.

"an
.any of the components that make up the modern personal computer are heat+critical, and malfunction if allowed to become too hot. 'ith the amount of heat that is generated in certain areas, particularly by the CP3, it is therefore necessary to ensure that the inside of the unit has adequate ventilation. his is achieved mainly by the use of fans to draw cold air over the components in question. Heat sinks are also used to dissipate the heat over a larger area.

Graphics Card
he graphics card, or video card as it is sometimes known, is used to communicate the required images to the monitor. *s such the display capabilities 0such as resolution and color depth4 are not only governed by the graphics card, but by the monitor as well. .odern cards include their own memory, so that the (*. on the motherboard is not taken up with display information.

Soundcard

he soundcard is responsible for the facilities related to the recording and reproduction of sound. he sound signals can be inputted via a microphone or other e#ternal device, and are outputted through the speakers. It is common for more recent PCs to not actually have a separate soundcard, but instead have additional chips on the motherboard for this purpose. his is referred to as %on+board sound%.

Modem
* modem is used to connect the computer to an e#ternal network, via a telephone line, *2-: line or some other form of communications. .odems are most commonly used to allow the user to access the internet, and as such browse the world wide web and send e+mail. .odems can either be internal 0an additional board that is housed within the PC case4, or e#ternal 0such as the one pictured4.

PC Case
he case is responsible for the housing and protection of the internal components of the PC, and is usually manufactured from metal or a similarly sturdy and resistant material. he e#ternal housing protects the components from dust, spillages and other potential sources of damage, and also enables easier integration of ventilation and other forms of cooling. It also houses and assists with the shielding of the central power supply, which powers the PC as a whole.

MICROPROCESSOR TUTORIAL
Introduction

he microprocessor is sometimes referred to as the %brain% of the personal computer, and is responsible for the processing of the instructions which make up computer software. It houses the central processing unit, commonly referred to as the CP3, and as such is a crucially important part of the home PC. However, how many people really understand how the chip itself works; his tutorial aims to provide an introduction to the various parts of the microprocessor, and to teach the basics of the architecture and workings of the CP3 across three specific sections6

CP' Structure

his section, using a simplified model of a central processing unit as an e#ample, takes you through the role of each of the ma,or constituent parts of the CP3. It also looks more closely at each part, and e#amines how they are constructed and how they perform their role within the microprocessor.

Instruction ()ecution

8nce you are familiar with the various elements of the processor, this section looks at how they work together to process and e#ecute a program. It looks at how the various instructions that form the program are recogni!ed, together with the processes and actions that are carried out during the instruction e#ecution cycle itself.

"urther "eatures

<ow that the basics have been covered, this section e#plores the further advancements in the field of microprocessor architecture that have occurred in recent years. $#planations of such techniques as pipelining and hyper threading are provided, together with a look at cache memory and trends in CP3 architecture.

CPU STRUCTURE
Introduction

*s there are a great many variations in architecture between the different kinds of CP3, we shall begin my looking at a simplified model of the structure. he model to be used can be seen on the right of this page, and is a good basis on which to build your knowledge of the workings of a microprocessor. he simplified model consists of five parts, which are6

*rithmetic + ,ogic 'nit -*,'.


he part of the central processing unit that deals with operations such as addition, subtraction, and multiplication of integers and "oolean operations. It receives control signals from the control unit telling it to carry out these operations. For more, click the title above.

Control 'nit -C'. his controls the movement of instructions in and out of the processor, and also controls the operation of the *:3. It

consists of a decoder, control logic circuits, and a clock to ensure everything happens at the correct time. It is also responsible for performing the instruction e#ecution cycle. .ore on the control unit can be discovered by clicking the title above.

$egister *rray

his is a small amount of internal memory that is used for the quick storage and retrieval of data and instructions. *ll processors include some common registers used for specific functions, namely the program counter, instruction register, accumulator, memory address register and stack pointer. For more, click the title above.

System /us
his is comprised of the control bus, data bus and address bus. It is used for connections between the processor, memory and peripherals, and transferal of data between the various parts. Click the title above for more.

Memory
he memory is not an actual part of the CP3 itself, and is instead housed elsewhere on the motherboard. However, it is here that the program being e#ecuted is stored, and as such is a crucial part of the overall structure involved in program e#ecution. For further information on the memory, please see the separate tutorial if available. For more information on these parts of the CP3, click the corresponding title of the description above. )ou could also click on the part in question on the diagram to the right. *lternatively, click the right arrow button below to move on to the ne#t page, which looks at the arithmetic and logic unit.

*rithmetic + ,ogic 'nit


he *:3, or the arithmetic and logic unit, is the section of the processor that is involved with e#ecuting operations of an arithmetic or logical nature. It works in con,unction with the register array for many of these, in particular, the accumulator and flag registers. he accumulator holds the results of operations, while the flag register contains a number of individual bits that are used to store information about the last operation carried out by the *:3. .ore on these registers can be found in the register array section. )ou can look at the *:3 as comprising many subcomponents for each specific task that it is required to perform. -ome of these tasks and their appropriate subcomponents are6

*ddition and subtraction


hese two tasks are performed by constructs of logic gates, such as half adders and full adders. 'hile they may be termed %adders%, with the aid of they can also perform subtraction via use of inverters and %two%s complement% arithmetic. he topic of logic gates is too e#pansive and detailed to be covered in full here. .any resources e#ist on the internet and elsewhere relating to this topic, however, so it is recommended that you read further into the areas outlined above to aid with your learning.

Multiplication and di!ision


In most modern processors, the multiplication and division of integer values is handled by specific floating+point hardware

within the CP3. $arlier processors used either additional chips known as math=s co+processors, or used a completely different method to perform the task.

,ogical tests

Further logic gates are used within the *:3 to perform a number of different logical tests, including seeing if an operation produces a result of !ero. .ost of these logical tests are used to then change the values stored in the flag register, so that they may be checked later by separate operations or instructions. 8thers produce a result which is then stored, and used later in further processing.

Comparison
Comparison operations compare values in order to determine such things as whether one number is greater than, less than or equal to another. hese operations can be performed by subtraction of one of the numbers from the other, and as such can be handled by the aforementioned logic gates. However, it is not strictly necessary for the result of the calculation to be stored in this instance.. the amount by which the values differ is not required. Instead, the appropriate status flags in the flag register are set and checked to determine the result of the operation.

/it shi0ting
-hifting operations move bits left or right within a word, with different operations filling the gaps created in different ways. his is accomplished via the use of a shift register, which uses pulses from the clock within the control unit to trigger a chain reaction of movement across the bits that make up the word. *gain, this is a quite complicated logical procedure, and further reading may aid your understanding. Click the ne#t button below to move on and look at the control unit, or alternatively click on a section of the diagram above to view a different section.

Control 'nit
he control unit is arguably the most complicated part of this model CP3, and is responsible for controlling much of the operation of the rest of the processor. It does this by issuing control signals to the other areas of the processor, instructing them on what should be performed ne#t. -imilarly to the arithmetic and logic unit, the control unit can be broken down further for easier understanding. *s such, the three main elements of the control unit are as follows6

Decoder
his is used to decode the instructions that make up a program when they are being processed, and to determine in what actions must be taken in order to process them. hese decisions are normally taken by looking at the opcode of the instruction, together with the addressing mode used. his is covered in greater detail in the instruction e#ecution section of this tutorial.

Timer or clock
he timer or clock ensures that all processes and instructions are carried out and completed at the right time. Pulses are sent to the other areas of the CP3 at regular intervals 0related to the processor clock speed4, and actions only occur when a pulse is detected. his ensures that the actions themselves also occur at these same regular intervals, meaning that the operations of the CP3 are synchroni!ed.

Control logic circuits

he control logic circuits are used to create the control signals themselves, which are then sent around the processor. hese signals inform the arithmetic and logic unit and the register array what they actions and steps they should be performing, what data they should be using to perform said actions, and what should be done with the results. Further detail is not required at this stage on the control unit, though it is clear that there is much detail at lower levels that has yet to be touched on. However, to move on to the ne#t element of the processor 0the register array4, please click the ne#t button below.

$egister *rray

* register is a memory location within the CP3 itself, designed to be quickly accessed for purposes of fast data retrieval. Processors normally contain a register array, which houses many such registers. hese contain instructions, data and other values that may need to be quickly accessed during the e#ecution of a program. .any different types of registers are common between most microprocessor designs. hese are6

Program Counter -PC.

his register is used to hold the memory address of the ne#t instruction that has to e#ecuted in a program. his is to ensure the CP3 knows at all times where it has reached, that is able to resume following an e#ecution at the correct point, and that the program is e#ecuted correctly.

Instruction $egister -I$.

his is used to hold the current instruction in the processor while it is being decoded and e#ecuted, in order for the speed of the whole e#ecution process to be reduced. his is because the time needed to access the instruction register is much less than continual checking of the memory location itself.

*ccumulator -*1 or *CC.

he accumulator is used to hold the result of operations performed by the arithmetic and logic unit, as covered in the section on the *:3.

Memory *ddress $egister -M*$.


3sed for storage of memory addresses, usually the addresses involved in the instructions held in the instruction register. he control unit then checks this register when needing to know which memory address to check or obtain data from.

Memory /u00er $egister -M/$.


'hen an instruction or data is obtained from the memory or elsewhere, it is first placed in the memory buffer register. he ne#t action to take is then determined and carried out, and the data is moved on to the desired location.

"lag register % status 0lags


he flag register is specially designed to contain all the appropriate >+bit status flags, which are changed as a result of operations involving the arithmetic and logic unit. Further information can be found in the section on the *:3.

Other general purpose registers


hese registers have no specific purpose, but are generally used for the quick storage of pieces of data that are required later in the program e#ecution. In the model used here these are assigned the names * and ", with suffi#es of : and 3 indicating the lower and upper sections of the register respectively. he final main area of the model microprocessor being used in this tutorial is the system bus. Click the ne#t arrow button below in order to read more.

System /us
he system bus is a cable which carries data communication between the ma,or components of the computer, including the microprocessor. <ot all of the communication that uses the bus involves the CP3, although naturally the e#amples used in this tutorial will centre on such instances. he system bus consists of three different groups of wiring, called the data bus, control bus and address bus. hese all have separate responsibilities and characteristics, which can be outlined as follows6

Control /us

he control bus carries the signals relating to the control and co+ordination of the various activities across the computer, which can be sent from the control unit within the CP3. 2ifferent architectures result in differing number of lines of wire within the control bus, as each line is used to perform a specific task. For instance, different, specific lines are used for each of read, write and reset requests.

Data /us
his is used for the e#change of data between the processor, memory and

peripherals, and is bi+directional so that it allows data flow in both directions along the wires. *gain, the number of wires used in the data bus 0sometimes known as the %width%4 can differ. $ach wire is used for the transfer of signals corresponding to a single bit of binary data. *s such, a greater width allows greater amounts of data to be transferred at the same time.

*ddress /us
he address bus contains the connections between the microprocessor and memory that carry the signals relating to the addresses which the CP3 is processing at that time, such as the locations that the CP3 is reading from or writing to. he width of the address bus corresponds to the ma#imum addressing capacity of the bus, or the largest address within memory that the bus can work with. he addresses are transferred in binary format, with each line of the address bus carrying a single binary digit. herefore the ma#imum address capacity is equal to two to the power of the number of lines present 0?@lines4. his concludes the look at the simplified model processor that will be used for the remainder of this tutorial. he ne#t section will look at the instruction e#ecution process, and how these different parts work together to e#ecute programs. However, before that, there%s a chance to test what you%ve learnt in this section regarding processor architecture. Click the ne#t arrow below to take a short qui! relating to this section of the tutorial.

Instruction ()ecution AA Introduction


Following on from looking at the structure and architecture of the central processing unit itself, we shall now look at how the CP3 is used to e#ecute programs and make the computer as a whole run smoothly and efficiently. o do this, we must take a step back from concentrating solely on the processor, and look at the complete computer unit.

* flow diagram illustrating the flow of data within the PC during program e#ecution and the saving of data. Further e#planation can be found below.

'hen software is installed onto a modern day personal computer 0most commonly from a C2+(8., though other media or downloading from the internet is also common4, code comprising the program and any associated files is stored on the hard drive. his code comprises of a series of instructions for performing designated tasks, and data associated with these instructions. he code remains there until the user chooses to e#ecute the program in question, on which point sections of the code are loaded into the computers memory. he CP3 then e#ecutes the program from memory, processing each instruction in turn. 8f course, in order to e#ecute the instructions, it is necessary for the CP3 to understand what the instruction is telling it to do. herefore, recognition for instructions that could be encountered needs to be programmed into the processor. he instructions that can be recogni!ed by a processor are referred to as an %instruction set%, and are described in greater detail on the ne#t page of the tutorial. 8nce the instruction has been recogni!ed, and the actions that should be carried out are decided upon, the actions are then performed before the CP3 proceeds on to the ne#t instruction in memory. his process is called the %instruction e#ecution cycle%, and is also covered later on in this tutorial. (esults can then be stored back in the memory, and later saved to the hard drive and possibly backed up onto removal media or in separate locations. his is the same flow of information as when a program is e#ecuted only in reverse, as illustrated in the diagram above. 8n the ne#t page of this tutorial is a more in+depth look at instruction sets. Click the ne#t arrow below to proceed.

Instruction Sets

*s outlined in the introduction to this section, for a processor to be able to process an instruction, it needs to be able to determine what the instruction is asking to be carried out. For this to occur, the CP3 needs to know what actions it may be asked to perform, and have pre+determined methods available to carry out these actions. It is this idea which is the reasoning behind the %instruction set%. 'hen a processor is e#ecuting a program, the program is in a machine language. However, programmers almost never write their programs directly into this form. 'hile it may not have been originally written in this way, it is translated to a machine language at some point before e#ecution so that it is understandable by the CP3. .achine language can be directly interpreted by the hardware itself, and is able to be easily encoded as a string of binary bits and sent easily via electrical signals. he instruction set is a collection of pre+defined machine codes, which the CP3 is designed to e#pect and be able to act upon when detected. 2ifferent processors have different instruction sets, to allow for greater features, easier coding, and to cope with changes in the actual architecture of the processor itself. $ach machine code of an instruction set consists of two separate fields6

8pcode

8perand0s4

he opcode is a short code which indicates what operation is e#pected to be performed. $ach operation has a unique opcode. he operand, or operands, indicate where the data required for the operation can be found and how it can be accessed 0the addressing mode, which is discussed in full later4. he length of a machine code can vary + common lengths vary from one to twelve bytes in si!e. he e#act format of the machine codes is again CP3 dependant. For the purpose of this tutorial, we will presume we are using a ?5+bit CP3. his means that the minimum length of the machine codes used here should be ?5 binary bits, which in this instance are split as shown in the table below6 8pcode 8perand0s4 6 bits (18-23) 18 bits (0-17) + >B bits 0C+>94 for address values + ? bits 0>BD>E4 for specifying addressing mode to be used 8pcodes are also given mnemonics 0short names4 so that they can be easily referred to in code listings and similar documentation. For e#ample, an instruction to store the contents of the accumulator in a given memory address could be given the binary opcode CCCCC>, which may then be referred to using the mnemonic - * 0short for - ore *ccumulator4. -uch mnemonics will be used for the e#amples on upcoming pages. + *llows for B5 unique opcodes 0?@B4

2iagram showing the basics of the instruction e#ecution cycle. $ach instruction is fetched from memory, decoded, and then e#ecuted.

<ow we know what form the data is in when it is read by the CP3, it is necessary to learn about the cycle by which the instructions of a program are e#ecuted. his is the topic of the ne#t page of the tutorial, which can be accessed by clicking the ne#t arrow below.

Instruction ()ecution Cycle

8nce a program is in memory it has to be e#ecuted. o do this, each instruction must be looked at, decoded and acted upon in turn until the program is completed. his is achieved by the use of what is termed the %instruction e#ecution cycle%, which is the cycle by which each instruction in turn is processed. However, to ensure that the e#ecution proceeds smoothly, it is also necessary to synchroni!e the activities of the processor.

o keep the events synchroni!ed, the clock located within the CP3 control unit is used. his produces regular pulses on the system bus at a specific frequency, so that each pulse is an equal time following the last. his clock pulse frequency is linked to the clock speed of the processor + the higher the clock speed, the shorter the time between pulses. *ctions only occur when a pulse is detected, so that commands can be kept in time with each other across the whole computer unit. he instruction e#ecution cycle can be clearly divided into three different parts, which will now be looked at in more detail. For more on each part of the cycle click the relevant heading, or use the ne#t arrow as before to proceed though each stage in order.

"etch Cycle
he fetch cycle takes the address required from memory, stores it in the instruction register, and moves the program counter on one so that it points to the ne#t instruction.

Decode Cycle

Here, the control unit checks the instruction that is now stored within the instruction register. It determines which opcode and addressing mode have been used, and as such what actions need to be carried out in order to e#ecute the instruction in question.

()ecute Cycle

he actual actions which occur during the e#ecute cycle of an instruction depend on both the instruction itself, and the addressing mode specified to be used to access the data that may be required. However, four main groups of actions do e#ist, which are discussed in full later on.

10

S-ar putea să vă placă și