Computer Systems: Data Representation

Size: px
Start display at page:

Download "Computer Systems: Data Representation"

Transcription

1 C Wilson

2 C Wilson

3 Computer Systems: Data Representation This section on Data Representation considers how computers represent data by using binary numbers. At the lowest level in the computer, only binary numbers can be understood. As humans we are much more familiar with the decimal system and think of numbers in terms of base 10. So in order to understand how the computer processes data, we must be comfortable with both binary and decimal numbers. Like us, the computer must also be able to process positive and negative numbers that can also be very large or very small. This unit considers all such numbers and how they can be represented. Then we can consider how the computer uses numbers to represent other forms of data, such as text and graphics by using codes and other numeric techniques. The unit is completed by considering some of the practicalities of representing data in its various forms and how such data can be stored within a computer system. Data Types and Representation Numbering Systems Most modern computer systems do not represent numeric values using the decimal system. Instead, they typically use a binary or two's complement numbering system. To understand the limitations of computer arithmetic, you must understand how computers represent numbers. A Review of the Decimal System Just as our decimal number system is based on the number 10 with columns for ( or.10 3, 10 2, 10 1, 10 0 ) so binary is based on the number 2 with columns for ( or..2 4, 2 3, 2 2, 2 1,2 0 ). Example When you see a number like "123", you don't think about the value 123; rather, you generate a mental image of how many items this value represents. In reality, however, the number 123 represents H T U = (1 * 100) + (2 * 10 ) + (3 *1) C Wilson 1

4 Computer Systems: Data Representation Why do computers use binary? Most modern computer systems operate using binary logic. The computer represents values using two voltage levels (usually 0v and +5v). With two such levels we can represent exactly two different values. Memory in a computer consists of a very large number of electronic 'circuits' which can be in one of two possible states...'on' (represented by 1) or 'OFF' represented by 0. 8 such circuits which are in the states : ON, ON, OFF, OFF, ON, OFF, OFF, ON...could be represented by the digits : Each 1 or 0 is called a BIT (short for BInary digit). 8 bits used together is known as a BYTE. Rules for addition and subtraction are simple as only limited addition is necessary. Binary numbers, although they have little importance in high level languages, appear everywhere in assembly language programs. SUMMARY of 'binary/digital' advantages (compared to decimal) 1 Only two states used 2 Voltage degradation has limited effect on data 3 Fewer rules for addition and subtraction C Wilson 2

5 Computer Systems: Data Representation Exercise 1 How many different bit patterns can be made using 2 bits? Answer : 00, 01, 10 and 11 are the 4 bit patterns possible using 2 bits. 2 How many different bit patterns can be made using 3 bits? 3 Complete the following table... No. of bits No. of bit patterns C Wilson 3

6 Computer Systems: Data Representation Decimal to binary conversion There are two ways to convert decimal numbers into binary. Method 1. To convert 29 into binary: write down the binary headings (don t go past 29), then work out which headings add up to 29: To get 29 we need a 16, an 8 a 4 and a 1, so 29 = Method 2. This is guaranteed to work on any number and is useful for very large numbers. Here you continuously divide by 2, writing down the remainder each time until there is nothing left. The binary number is formed by reading the remainders up the way R R R R 1 = R 1 Something to know about storing numbers on a computer is that a fixed number of bits is always used. Let s say a computer uses 32 bits to store numbers, then 3 would be stored as: stored as: C Wilson 4

7 Computer Systems: Data Representation Binary to decimal Conversion Here is an example of how to convert the binary number to a decimal = (1 * 128 ) + ( 1 * 16) + (1*8) + (1 * 2) = = 154 Example = (1 * 64 ) + (1*4) + (1*1) = = 69 A system using 1 byte for number storage can have 256 different numbers i.e. the numbers 0-255, but if 2 bytes were used then 65,536 different numbers can be used i.e Increasing the number of bits allocated to the storage for numeric data increases the range of numbers which can be stored. C Wilson 5

8 Computer Systems: Data Representation Exercise 1. Convert the following decimal numbers to binary : 5,12,16,23,55 & Convert the following binary numbers to decimal a b c d e What is the decimal value of the largest binary number that can be stored in 1 byte? 4. Calculate Compare your answer to question 3. Can you use a similar method to find the largest number that can be stored in 2 bytes and 4 bytes? C Wilson 6

9 Computer Systems: Data Representation Signed bit - Storing Integers If a computer system has only to deal with positive integers, these can be converted directly to their equivalent binary numbers. The size of the number that can be handled depends on the number of bits/bytes allocated to storing each number. Example (16 bit positive number) If two bytes are used then 16 bits can be used to store each integer number. The numbers would be in the range to If negative integers are to be included, then you still get the same number of numbers but the range changes, in this case, from to One bit is used to show whether it is a positive or a negative number. So the maximum number from 2 bytes is (only 15 bits can be used as 1 bit is used to show the 'sign') The leftmost bit is called the most significant bit and is used to store the sign of the number. By introducing negatives, the largest number is half the size than if only positive numbers were used. Example: Signed bit -/ This number is the positive number 5. The largest number possible would be / This number is (negative) 5. The smallest number possible would be You can see that the m.s.b. (most significant bit) being set to a 0 represents a positive value and being set to a 1 represents a negative value. C Wilson 7

10 Computer Systems: Data Representation However, using the signed bit method doesn't work for two reasons: 1 There are two values for zero. 2 Addition doesn't work properly. 1. There are two values for zero a positive zero and a negative zero! +/ / Adding 127 and 1 would normally be 128. However +/ The answer given is -0 (negative zero). When the final binary 1 is carried, it becomes a signed bit, not a bit with the value of 128. Adding -5 and -10 would normally be -15. But again +/ The answer given is 10 (The extra 1 gets dropped and ignored!) So, signed bit doesn t actually work, but it does form the basis of the system that is actually used, known as Two s Complement. C Wilson 8

11 Computer Systems: Data Representation Two's Complement To represent negative integers, a method called two's complement is used. Method 1 To represent the number -13 as an 8-bit binary number... Step 1: Convert the positive value for 13 into an 8-bit binary integer: Step 2: Invert the digits (change all the 0s to 1s and 1s to 0s): Step 3: Add 1 - Perform a binary calculation: Remember when adding in binary that = 10 etc... Final answer : -13 in binary (using two's complement notation) is C Wilson 9

12 Computer Systems: Data Representation Method 2 In 2 s complement, the place value or weighting of the most significant bit is given its normal magnitude, but with a negative value. For example, = -115 If a byte contains the integer in 2 s'complement form, we know that since the m.s.b. = 1, the integer is negative. Conversely, if the m.s.b is 0, the number is positive. A simple way to find the decimal value for the integer is to add the weight of all columns containing binary 1. Look at the following examples, Decimal Remember, the m.s.b. has a NEGATIVE value! Calculating the RANGE in 2 s complement MIN = -2^ no. of bits MAX = 2^no.of bits - 1 C Wilson 10

13 Computer Systems: Data Representation Exercise Using two's complement change the following into 8-bit binary numbers: Convert these into negative decimal integers C Wilson 11

14 Computer Systems: Data Representation Floating Point Representation (Real numbers and very large numbers) Real numbers and very large numbers are stored in the computer as floating point numbers. This is like the standard form or scientific notation used in maths except the computer does not store the point or the base and counts the places from the BEGINNING OF THE NUMBER in Standard Form : 9.3 x in Floating Point : 93 8 The 93 is called the MANTISSA The 8 is called the EXPONENT. So, in decimal Mantissa x 10 Exponent However, computers use binary, and in binary we express the exponent as a power of 2, so every binary floating point number is of the form : Mantissa x 2 Exponent The Mantissa is a fixed point fraction (First bit is a sign bit...use two's complement for negative numbers). It is usual to use 4 bytes for the mantissa. The Exponent is a binary integer (First bit is a sign bit...use two's complement for negative numbers). This is stored using 1 byte. C Wilson 12

15 Computer Systems: Data Representation Computers use a fixed number of bits to store floating point numbers. For instance with 32 bits they might use 24 bits for the mantissa and 8 bits for the exponent. Or they could use 20 bits for the mantissa and 12 bits for the exponent. This has an effect on the ACCURACY of the numbers stored and the RANGE of values that can be stored. With our numbers imagine we have a calculator that can only display 3 digits for the mantissa and 1 digit for the exponent: E would be stored: would be stored: Note the loss of accuracy cannot be stored at all. The point moves 10 places and this is out of our range. So the exponent determines the range of numbers that can be stored in floating point. Binary example The binary number The decimal point cannot be stored so it is moved 4 places to the LEFT. So the number in floating point from will be : x 2 4 which in binary, is x In this case the mantissa is and the exponent is 100. Range & accuracy Increasing the length of the mantissa increases the accuracy of the number stored. Increasing the length of the exponent increases the range of numbers stored. C Wilson 13

16 Computer Systems: Data Representation Exercise 1 If an integer number is stored using one byte, what range of decimal numbers can be represented by this? 2 If an integer number is stored using 4 bytes, what range of decimal numbers can be represented by this? 3 A number format is said to have precision or accuracy 2 if it can store numbers from 0 to 99. Use your answers to questions 2 and 3 to find out the precision that can be stored in one byte, two bytes and four bytes. 4 Find the largest and smallest numbers that can be stored in a four byte mantissa and one byte exponent. (assume all numbers are positive) 5 A floating point format uses four bytes for the mantissa and one byte for the exponent. If this is changed to three and two bytes respectively, what effect will this have on (a) the accuracy and, (b) range of the numbers stored. 6 Convert each of the following to floating point representation a) b) c) d) C Wilson 14

17 Computer Systems: Data Representation Representation of characters. Input, output, backing storage and data communications devices store and manipulate data in character code. During processing, text data stays as character code but numerical data is converted to one of the representations you have already met. Programmers specify the type of data within their code and conversion is then carried out by hardware or software. The set of characters that can be represented by the computer is known as the character set. Many computers have the flexibility of using several character sets, but we will restrict our discussions to ASCII and Unicode. ASCII American Standard Code for Information Interchange (ASCII) was first developed for teletypewriters and is now an internationally agreed standard for storing information. It is a character set which forms the basis for almost all other character sets. ASCII uses 7 bits per character, giving a possible 128 different characters. It has 96 displayable characters, enough to represent a letter or symbol of the English alphabet and numerical symbols. There are 32 special character codes known as control characters. A single code is used to represent each character which is stored in binary. When data is to be displayed or printed, the code is converted into an appropriate shape. An extract of ASCII codes is shown below. When IBM PCs were designed, they moved and stored data in 8-bit units. The extra bit increased the character set from 128 to 256, producing an extended character set that could accommodate international dialects or alphabetic characters in foreign languages (French and German accented characters are examples). C Wilson 15

18 Computer Systems: Data Representation Unicode An increase in worldwide communications brought a need to exchange information internationally. This presented a problem for Latin based character sets. Languages such as Japanese and Arabic, for example, do not use the Latinbased symbols of English, French or German and have entirely different symbol shapes. A Japanese symbol is shown. A solution to the problem of supporting multilingual text was to encode characters using 16 bits, thus providing 65,536 possible symbols. This is Unicode which is capable of including the characters from all known languages and alphabets in the world. Applications such as Office97 use Unicode in document files, while Windows98 and MacOS allow you to set a language preference which is stored in the Windows registry on PCs or the system preferences folder on the Macs. Sun, IBM, Xerox, Lotus and Novell are also participating in the development of this standard. Parity A computer system which uses EVEN parity stores data which always has an even numbers of '1' bits in each byte. This is used for error checking- particularly when data is moved form one place to another. Text files stored in ASCII format are sometimes called ASCII files. Text editors and word processors are usually capable of storing data in ASCII format, although ASCII format is not always the default storage format. Most data files, particularly if they contain numeric data, are not stored in ASCII format. Executable programs are never stored in ASCII format. The standard ASCII character set uses just 7 bits for each character. There are several larger character sets that use 8 bits, which gives them 128 additional characters ( ). The extra characters are used to represent non-english characters, graphics symbols, and mathematical symbols. Several companies and organisations have proposed extensions for these 128 characters. The DOS operating system uses a superset of ASCII called extended ASCII or high ASCII. Amore universal standard is the ISO Latin 1 set of characters, which is used by many operating systems, as well as Web browsers. The Control Characters The first 32 ASCII values are non-printing control characters, such as Return and Line feed. You generate these characters on the keyboard by holding down the Control key while you strike another key. C Wilson 16

19 Computer Systems: Data Representation Representation of Graphics There are two main forms of graphic representation: BIT MAPPED VECTOR (OBJECT ORIENTED) Bit mapped For a graphic drawn in a painting package, the computer stores the necessary information as a two dimensional array of pixels. In monochrome, each pixel is represented by one bit. For example, Once drawn, each individual object can be edited. The objects for a painting or bitmapped image are pixels, which can either be on or off. When a graphic is 'pasted' into a drawing application, the computer 'forgets' that it is a graphic and treats it as a group of pixels. It is no longer possible to edit individual pixels. C Wilson 17

20 Computer Systems: Data Representation Another example of storing a bit-mapped image: This is a graphic of a flower. In a painting application it is viewed by the computer as a bit pattern. Because EVERY pixel is stored, painting files require a large amount high storage Using colour and bit mapped. The value of each dot (whether it is filled in or not) is stored in one or more bits of data. For simple monochrome images, one bit is sufficient to represent each dot, but for colours and shades of grey, each dot requires more than one bit of data. The more bits used to represent a dot, the more colours and shades of gray that can be represented. When colour is introduced, the memory requirements to store the details of each pixel must be increased. The table below shows the way in which 2 bits can be used to store 4 different colours. Bit Pattern Colour No of Bits 00 Black 2 01 Red 2 10 Yellow 2 11 White 2 Two Red pixels would therefore take 4 bits of storage. C Wilson 18

21 Computer Systems: Data Representation Table showing number of bits and corresponding number of colour represented. No of bits per pixel No. of colours 1 Monochrome Resolution The density of the dots, known as the resolution, determines how sharply the image is represented. This is often expressed in dots per inch (dpi ). To display a bit-mapped image on a monitor or to print it on a printer, the computer translates the bit map into pixels (for display screens) or ink dots (for printers). Optical scanners and fax machines work by transforming text or pictures on paper into bit maps. Bit-mapped graphics are often referred to as raster graphics. Advantages of bit-mapped graphic representation a bit mapped image can be edited at the pixel level. Thus a designer may apply particular colour values to a selected pixel area to produce shading or textured effects it is possible to create a wider range of irregular shapes and patterns by simply deleting or editing pixels anywhere on the image Disadvantages of bit-mapped representation requires large amounts of storage space image becomes course (jagged) when scaled does not take advantage of resolutions that are higher than the resolution of the image. C Wilson 19

22 Computer Systems: Data Representation Calculating Storage Requirements - SCREEN Actual bitmaps are stored in the VRAM (Video RAM) on the graphics card. The amount of VRAM on the card determines the maximum colour depth and resolution (number of pixels) your screen can display. You can calculate the storage requirements for a screen using the formula: No. of BITS required = Pixels across x Pixels down x bit depth Example 1: A 1280 by 800 screen using 8 bit colour depth needs: 1280 x 800 x 8 BITS = bits /8 = bytes /1024 = 1000 Kbytes Example 2: Calculate the storage required for a screen using 1620 by 1280 pixels with colours. Bits = 1620 x 1280 x 16 (because 2 16 = ) = bits /8 = bytes /1024 = 4050 Kbytes /1024 = 3.96 Mbytes Note how the number of bits per pixel increases the file size. 24 bit colour produces a file 3 times larger than 8 bit colour. C Wilson 20

23 Computer Systems: Data Representation Calculating Storage Requirements BIT-MAPPED FILE You can also calculate the storage requirements for a bit-mapped graphics file. The idea is basically the same as before but it takes a little longer to get there. As before we need to identify the number of pixels required and the bit-depth (no. of colours used). Calculating the storage requirements of a file requires a little extra detective work! Example: This picture measures 2 inches by 3 inches, contains a possible 256 colours and was scanned at 72 dpi. First we have to work out the number of pixels: 2 inches x 3 inches at 72 d.p.i (dots per inch) = (2 x 72) x (3 x 72) = pixels Next, the bit depth: Bit depth = 8 (because 2 8 = 256) So, our storage requirement is, pixels at 8 bits each Bits = x 8 = bits /8 = bytes /1024 = Kbytes C Wilson 21

24 Computer Systems: Data Representation File Compression Most types of computer files are fairly redundant -- they have the same information listed over and over again. File-compression programs simply get rid of the redundancy. Instead of listing a piece of information over and over again, a filecompression program lists that information once and then refers back to it whenever it appears in the original program. As an example, let's look at a type of information we're all familiar with: words. In John F. Kennedy's 1961 inaugural address, he delivered this famous line: "Ask not what your country can do for you -- ask what you can do for your country." The quote has 17 words, made up of 61 letters, 16 spaces, one dash and one period. If each letter, space or punctuation mark takes up one unit of memory, we get a total file size of 79 units. To get the file size down, we need to look for redundancies. Immediately, we notice that: "ask" appears two times "what" appears two times "your" appears two times "country" appears two times "can" appears two times "do" appears two times "for" appears two times "you" appears two times Ignoring the difference between capital and lower-case letters, roughly half of the phrase is redundant. Nine words -- ask, not, what, your, country, can, do, for, you -- give us almost everything we need for the entire quote. To construct the second half of the phrase, we just point to the words in the first half and fill in the spaces and punctuation. The system for arranging dictionaries varies, but it could be as simple as a numbered list. When we go through Kennedy's famous words, we pick out the words that are repeated and put them into the numbered index. Then, we simply write the number instead of writing out the whole word. So, if this is our dictionary: 1. ask 2. what 3. your 4. country 5. can 6. do 7. for 8. you Our sentence now reads: "1 not " C Wilson 22

25 Computer Systems: Data Representation If you knew the system, you could easily reconstruct the original phrase using only this dictionary and number pattern. This is what the expansion program on your computer does when it expands a downloaded file. You might also have encountered compressed files that open themselves up. To create this sort of file, the programmer includes a simple expansion program with the compressed file. It automatically reconstructs the original file once it's downloaded. But how much space have we actually saved with this system? "1 not " is certainly shorter than "Ask not what your country can do for you; ask what you can do for your country;" but keep in mind that we need to save the dictionary itself along with the file. In an actual compression scheme, figuring out the various file requirements would be fairly complicated; but for our purposes, let's go back to the idea that every character and every space takes up one unit of memory. We already saw that the full phrase takes up 79 units. Our compressed sentence (including spaces) takes up 37 units, and the dictionary (words and numbers) also takes up 37 units. This gives us a file size of 74, so we haven't reduced the file size by very much. But this is only one sentence! You can imagine that if the compression program worked through the rest of Kennedy's speech, it would find these words and others repeated many more times. C Wilson 23

26 Computer Systems: Data Representation Image Compression An image using 24-bit colour graphics will be of an extremely high standard and will represent true colour. Each pixel (or dot) can represent over 16 million colours. On a high resolution display a single image may require several megabytes of memory for storage. File compression techniques can be used to reduce storage requirements. Specialised techniques for image compression result in images that are indistinguishable from the original as far as the human eye is concerned, but much smaller file sizes than could be achieved using general purpose compression techniques. Lossless compression Lossless compression techniques reduce file size with no loss in image quality, although compression ratios are generally weak (in other words, the file size is not greatly reduced). Most images destined for print, or when image quality is valued above file size, are compressed using lossless compression algorithms. Lossy compression Lossy compression algorithms take advantage of the inherent limitations of the human eye and discard information that cannot be seen. Most lossy compression algorithms allow for variable levels of quality (compression). As the level of compression is increased (at the expense of image quality), the file size is reduced. At the highest compression levels, image deterioration becomes noticeable. This deterioration is known as compression artifacting. Bit-mapped Graphics File Formats File Format JPEG GIF TIFF Description The JPEG (Joint Photographic Experts Group) image files are a lossy format. The filename extension is JPG, or JPEG. Nearly all digital cameras have the option to save images in JPEG format. The JPEG format supports 24-bit colour and produces relatively small file sizes. Fortunately, the compression in most cases does not detract noticeably from the image. GIF (Graphic Interchange Format) is limited to an 8-bit palette, or 256 colours. This makes the GIF format suitable for storing graphics with relatively few colours such as simple diagrams, shapes and cartoon style images. The GIF format supports animation and is still widely used to provide image animation effects. The TIFF (Tagged Image File Format) is a flexible image format that normally saves 48-bits per colour but can work in 24-bits. It uses a filename extension of TIFF or TIF. TIFF can be lossy or lossless. Some types of TIFF offer relatively good lossless compression. Some high-end digital cameras have the option to save images in the TIFF format, for lossless storage. The TIFF image format is not widely supported by web browsers, and should not be used on the World Wide Web. TIFF is still widely accepted as a photograph file standard in the printing industry. C Wilson 24

27 Computer Systems: Data Representation Vector or Object Oriented Graphics The other method for representing images is known as vector graphics or objectoriented graphics. With vector graphics, images/object are rstored as a series of attributes i.e. a description of how it is drawn.. Any editing is done at the level of attributes. Editing a pixel, for example is not possible. Example Rectangle Start x.y. position Length, breadth and angle of rotation Thickness & colour of line Colour fill etc. Vector graphics are more flexible than bit-mapped graphics look the same even when you re scale. Bit-mapped graphics become ragged Fonts represented with vector graphics are called scalable fonts, outline fonts, or vector fonts. The best-known example of a vector font system is PostScript. Bitmapped fonts, also called raster fonts, must be designed for a specific device and a specific size and resolution. look better on devices (monitors and printers) with higher resolution, whereas bitmapped images always appear the same regardless of a device's resolution. Another advantage of vector graphics is that representations of images often require less memory than bit-mapped images do. Almost all sophisticated graphics systems, including CAD systems and animation software, use vector graphics. Note that most output devices, including dot-matrix printers, laser printers, and display monitors, are raster devices (plotters are the notable exception). This means that all objects, even vector objects, must be translated into bit maps before being output. The difference between vector graphics and raster graphics, therefore, is that vector graphics are not translated into bit maps until the last possible moment, after all sizes and resolutions have been specified. PostScript printers (most laser printers), for example, have a raster image processor (RIP) that performs the translation within the printer. In their vector form, therefore, graphics representations can potentially be output on any device, with any resolution, and at any size. Memory for storing graphics usually comes on a separate graphics card specific to the type of monitor. C Wilson 25

28 Computer Systems: Data Representation Advantages of vector graphic representation Vector graphics representations have several advantages over bit mapped representations. These are: they do not lose their image quality on scaling. Scaling transformations are first applied to the object attributes before the image is rasterised to form a bit map; as values are not held for every pixel, this representation requires less storage space than a bit mapped image; they can be edited at the "object" level, thus allowing the user to reposition, scale and delete entire objects, or groups of objects, with ease; objects can be grouped to form larger objects that can then be manipulated as a single image; images are resolution independent meaning that the same quality of image will be rendered regardless of the resolution of the display or print device. Disadvantages of vector graphic representation See advantages of bit mapped graphics. Exercise 1 Bit mapped and vector graphics use vastly different amounts of storage depending on the graphic. Try using a paint and a drawing package to investigate this. 2 If a screen, 800 by 600 pixels in size, is showing a black and white bit mapped image, calculate the memory requirements in bytes to store this graphic. 3 How many bits are needed to differentiate 256 colours for one pixel? If the same 800 by 600 pixel screen displays 256 colours, recalculate the memory requirements for Q2. C Wilson 26

29 C Wilson

30 Computer Systems: Computer Structure You should already be familiar with the following terms and concepts: processor, ALU, control unit, registers, word, RAM, ROM and CPU. After studying the following section you should be able to explain that a computer is a two-state machine and explain the organisation of a computer in terms of CPU, memory, buses and the fetch-execute cycle. The structure of a computer, a two-state machine You will be familiar with this basic diagram of a computer. Backing Storage Memory Input Devices Processor (CPU) Output Devices You will be extending this view in more detail so that the fundamental way in which a processor and memory is used to execute a program becomes clear. All components used in a computer system and all data storage devices have only two states. For example a switch is off or on, transistors conduct or don t conduct, and a signal is a pulse of electricity or no pulse. Binary, using the numbers 0 and 1, can be represented by all these states. The main advantages of this are: Simplicity, in only having to generate and detect two voltage levels; Good tolerance because a degraded 1 is still recognisable as a 1; The calculations are also simpler as, for example, only four addition rules are needed for 0 and 1 against 100 rules for our numbers 0 to 9. [ = 0; = 1; = 1; = 10 ]. C Wilson 28

31 Computer Systems: Computer Structure Memory Memory can be divided into the following categories: RAM There are two different types of RAM; DRAM (Dynamic Random Access Memory) and SRAM (Static Random Access Memory). The two types differ in the technology they use to hold data, with DRAM being the more common type. Both types of RAM are volatile, meaning that they lose their contents when the power is turned off. DRAM - Dynamic Random Access Memory Dynamic Random Access Memory must have an electric current to maintain its electrical state (known as refresh ). DRAM is the main system memory used in home and office PCs, being cheaper to produce and therefore more common than SRAM. SRAM - Static Random Access Memory The term static is derived from the fact that it doesn't need to be refreshed like dynamic RAM. SRAM will retain data in it's memory as long as power is being supplied. SRAM is faster and more reliable than the more common DRAM. It is also more expensive than DRAM. While DRAM supports access times of about 60 nanoseconds, SRAM can give access times as low as 10 nanoseconds. Unfortunately, SRAM is also much more expensive to produce than DRAM. Due to its high cost, SRAM is usually used only as a memory cache. We will talk about cache later in System Performance. ROM Read Only Memory is memory whose contents may be read but cannot be written to, that is, it is permanent or non-volatile memory. Software and data are fixed into the ROM during manufacture. PROM (Programmable Read Only Memory) is a type of ROM which is manufactured as an empty storage array and is later permanently programmed by the user. EPROM (Erasable PROM) is a type of ROM whose data can be erased by a special process, often exposure to ultraviolet radiation. Memory maps are sometimes included with the sale of the computer. These describe the way storage is organised in the computer. For example, parts of memory may be allocated to the screen display, program code, variables etc. This information can be useful for programmers to know. C Wilson 29

32 Computer Systems: Computer Structure The links between the processor and memory To execute a program you must first load from disc the program and any relevant data into the RAM section of computer s memory. The program and data are stored in RAM until needed by the processor. This is called the stored program concept. A program may contain thousands of instructions but the processor can only execute one instruction at a time. The first instruction is fetched from memory into the processor where it is decoded and executed. Then the second instruction is fetched, decoded and executed, and so on until the program ends. This is known as the FETCH EXECUTE CYCLE. To execute the cycle, the processor has to be able to pinpoint any memory location where instructions or data are stored. Each memory location is assigned an ADDRESS. This is a unique binary number from 0 up to the (2 address bus width 1). The size and number of memory locations The word length of a computer is the size of the data, in bits, which can be manipulated as a single unit by the processor. The size is determined by the width of the data pathways (or buses) within the computer. In an ideal computer the size of the data pathways and the size of memory locations will match. Thus, if the size of the memory locations and the word length is 16 bits, then every fetch will bring the contents of one memory location (2 bytes) into the processor. However, sometimes the ideal situation does not always prevail. Early computers had a word size of one byte and a four byte integer would take four fetches before it could be used in a calculation bits (4 bytes) Location Location Location Location If the word length is 8 bits (1 byte) then the number of bits that can be manipulated by the processor at any one time is 8 bits, then this number will take 4 'fetches' to be executed. Most modern microcomputers have a word size of four bytes so the same integer can be brought into the processor with one fetch. A dramatic speed increase! Location C Wilson 30

33 Computer Systems: Computer Structure Buses Obviously information has to be transferred backwards and forwards between memory and the processor and this is done by buses. A bus is an electronic highway or a collection of wires where each wire can transmit one bit. Usually several wires are activated simultaneously to transmit whole byte(s). Here is an 8 bit bus carrying a byte from the CPU to RAM: P 0 M R 1 E O 0 M C 0 O E 1 R S 1 Y S 1 O 0 R The byte will have come from a register in the processor and is going to a storage location in RAM. There are three buses: the address bus which is used by the processor to pinpoint the memory location needed. This is a one-way (uni-directional) bus. the data bus which is used to transfer the data. It's size will usually match the word size i.e. the size of the memory locations. This is a two-way (bi-directional) bus. the control bus which is used to initiate and control what is happening. A newer processor might have a 36-bit address bus and a 32-bit data bus whereas an older processor might have 16-bit address and 8-bit data buses. C Wilson 31

34 Computer Systems: Computer Structure Control Bus Note! The control bus is not really a bus at all. Each wire is used for a separate purpose whereas the data and address buses consist of a collection of wires that are always used together. Some of the common lines in the control bus are reviewed here: Read Write Clock Interrupt NMI Reset A signal from the processor that initiates a memory read operation once the address bus has been set up with the appropriate memory address. A signal from the processor that initiates a memory write operation once the address bus has been set up with the address. This signal synchronises related components by generating pulses at a constant rate. A typical clock might be 400 MHz (400,000,000 ticks per second). Clock pulses are used to trigger components to take their next step, so keeping all components in time with each other. This is a signal into the processor which informs the processor that some external activity has taken place like a key-press. The current state of processing is saved and the processor then deals with the device that made the interrupt returning to the previous state when the interrupt has been dealt with. If the processor is doing something important it may ignore the interrupt for a short time. The Non-Maskable Interrupt operates like an interrupt but it cannot be ignored. It must be dealt with immediately. This would be used to signal serious situations such as a fall-off in power in the computer or situations like a meltdown in a nuclear reactor. This is a signal into the processor which, when activated, clears all internal registers, aborts the current program and starts fetching instructions from a predefined place to give control back to the operating system. C Wilson 32

35 Computer Systems: Computer Structure Fetch-Execute Cycle Read from memory A processor needs an instruction from memory or requires some data to perform a calculation. Here are the steps and buses needed to fetch that information from memory. Steps Processor sets up address bus with the appropriate address Processor activates the read line on the control bus Data from the memory is copied onto the data bus Effect This pinpoints the desired location This tells the location that it is to be read from Data is transferred to the processor Your Teacher may give you the Fetch-Execute program to see some of these features in action. Exercise 1 Create a table similar to that above to show the steps needed to write data to a memory location. 2 Name the three types of bus in a CPU and describe the purpose of each bus. 3 Why is the address bus a one way bus? 4 Why are the address and data buses true buses while the control bus not really a bus? 5 Explain the concept of addressability when referring to memory. 6 A computer has a 16 bit data bus and a 32 bit address bus. Calculate the possible amount of memory available. C Wilson 33

36 Computer Systems: Computer Structure The structure of the CPU The CPU can be considered to be made up of three components: Arithmetic and Logic Unit (ALU) Control Unit Registers The ALU is the part of the CPU where data is processed and manipulated. This generally involves arithmetic operations or logical comparisons, which allow a program to make decisions. The Control Unit is the part of the CPU, which manages the execution of instructions. The control unit is responsible for initiating the fetching, decoding and execution of instructions. It does this by sending control signals to other parts of the computer. The other main component of a CPU is the registers. A register is a storage location inside the CPU itself. A register can be used for tasks like holding data for a calculation, storing the address of the next instruction to be executed or holding the instruction as it is being decoded and executed. Modern processors are so fast that it makes sense to keep as much data on the processor as possible. This means that it can be accessed immediately rather than waiting while it is being fetched from memory. There are many registers including the memory address register (MAR), memory data register (MDR), program counter (PC), stack pointer (SP), accumulator (A), general purpose registers and the status register. Older computers might only have those registers mentioned above (or similar) but modern processors will have many more registers than that. Some have over 100 general purpose registers in order to boost system performance. The diagram shows how the buses and the three components making up the CPU link together. Note that there are also internal CPU buses so that data can be transferred inside the processor. C Wilson 34

37 Computer Systems: Computer Structure CPU Structure memory processor control bus control unit arithmetic & logic unit Internal address, data & control buses data bus registers address bus Clock Every processor has a clock which ticks continuously and is used by the control unit to synchronise the movement of data and tell all the components when certain tasks have to be done. The clock ticks or pulses billions of times a second (e.g. a Pentium IV 3 Ghertz microprocessor has a clock speed of 3 billion pulses per second). Each time a clock pulse is received on the clock line, the processor goes onto the next step in executing an instruction or program. Exercise 1 Static RAM is generally faster than dynamic RAM and doesn t need to be continually refreshed. So why is most of the RAM in a computer dynamic? 2 Define the terms ALU, control unit and register. 3 How do the ALU, control unit and registers communicate with each other? 4 Describe how the control unit communicates with the other parts of the CPU. C Wilson 35

38 C Wilson

39 Computer Systems: System Performance Measuring Performance By performance we mean how quickly a computer can carry out instructions. However, this is not as simple as it sounds as there are many factors to take into account. The instructions themselves can vary a great deal, so measuring the speed of a computer is actually very difficult. Because of this there are many different ways of trying to measure the speed of a computer Clock Speed - MHz When comparing one computer s performance against another, one of the main criteria is the clock speed of the processor. It takes little intelligence to figure out that a faster clock gives you faster performance. This is certainly true if you are comparing an Intel Pentium 4 3GHz against a Pentium 4 2GHz. However, you have to watch if you compare a 3 GHz Pentium against a 2 GHz PowerPC processor made by IBM/Motorola. There is nothing in the last sentence to tell you which processor is the fastest. Different types of processor use different machine codes and this can greatly affect their speed, so clock speed can only properly be used to compare the same make of processor. MIPS Another measure that is often used is the number of instructions that the processor executes per second (often called MIPS millions of instructions per sec). This sounds a better measure of system performance but some manufacturers will just time the simplest and fastest instructions only. It is also very difficult to compare the speed of processing instructions from a Pentium against totally different instructions from an Alpha processor. FLOPS A better measure is FLOPS (floating point operations per sec). The procedures involved in doing a floating-point multiplication are basically the same for every processor and these kinds of operations are used in most software, so they provide the basis of a more reasonable comparison of system performance. Benchmark Probably the only true measure is to try the software you want to use on the various processors in your normal working situation to see which is best for your needs. E.g. some processors are better than others at spreadsheet tasks. C Wilson 37

40 Computer Systems: System Performance Factors affecting performance Data bus width / Word size A computer is described in terms of its ʻword sizeʼ. This is the basic number of bits that the processor can handle in a single operation. Thus a 32-bit processor can handle 32 bits in a single operation and an 8-bit processor can handle 8 bits in a single operation. An 8-bit processor can add together two 32-bit numbers but this would take quite a few operations (clock pulses), whereas a 32-bit processor could perform the same task in a single operation. Clearly, a wider data bus width will produce increased performance. Address bus width The width of the address bus has no direct effect on the speed of a computer system. The width of the address bus defines the maximum amount of memory that the processor has the potential to access. It doesn t make it go any faster though. Example To find the maximum memory size which a 24-bit address bus can support assuming a word size of two bytes, you can use the following method: 2 24 = This is the number of possible memory addresses (each address having its own unique binary pattern). Amount of possible memory = No. of possible locations * size of each location = * 2 bytes = / 1024 K = / 1024 M = 32 M Available memory = 2 address bus width x data bus width A computer might not be supplied with the total amount of memory possible for reasons such as the cost of memory or because the normal applications used don t need that much. It is left to the user to add additional memory if needed. C Wilson 38

41 Computer Systems: System Performance Amount of RAM Memory Arguably, one way to improve system performance is to increase the amount of memory that you have in your computer. If your computer is struggling to run some software at an appropriate speed or you can t load all the software that you want at the same time, then adding extra memory can (but not always) improve your system's speed - especially if you are involved in graphics or multimedia work. Adding memory beyond your actual needs however doesn t give you any advantages apart from future proofing. The way modern software is continually increasing in size means that you normally can t have enough memory. Cache memory Earlier we mentioned that RAM in a computer uses DRAM - cheap and large scale modules. Because DRAM is slow to access, computer manufacturers try to speed things up by adding another kind of memory between the CPU and RAM called cache. Cache memory uses SRAM which is faster than DRAM (although smaller in capacity). There are two kinds called L1 and L2. Level 1 comes with the processor and is attached to it. Level 2 is just off the processor on the motherboard. The idea of cache is that once data is fetched from RAM it is stored in cache memory, then, if it is needed again it can be accessed very quickly. When data or an instruction is read from memory, the memory locations following are copied into the cache memory. At the next read instruction the cache memory is read first. If the data is in cache the access time will be much faster than going to main memory. If the data is not in cache then main memory will be accessed. The contents of cache are simultaneously held in RAM. When data is to be written back to memory it must be written to cache so that the cache is kept current. At some stage it will also have to be written back to RAM. Cache that has not been updated doesn t have to be copied back to memory it is just removed from cache when it is to be replaced by something the processor has a greater need for. There are 2 different ways to update cache memory: Write through cache. When cache is updated memory is updated at the same time. Write back cache. Cache is updated, but RAM is not updated until the content of cache is being cleared. Write back requires fewer write operations and is generally about 10% faster than write through cache. C Wilson 39

42 Computer Systems: System Performance Virtual Memory (VRAM) Although rare nowadays, computers can run out of main memory when running programs. If this happens they can use an area of hard disk to store data. This is called VIRTUAL MEMORY as it is being used as an artificial extension to real memory. Obviously you can get a huge amount of Virtual Memory (or VRAM), however it is very slow (excruciatingly slow!) and it is to be avoided. So there is a hierarchy of memory available to the processor: Type of memory Description Speed of Cost / Availability access Registers Locations inside the processor Lightening Very expensive, very limited amount. Cache SRAM right next to Very fast Expensive, limited amount. processor RAM DRAM on motherboard Slow (ish) Fairly cheap, large amount. Virtual Memory Using the hard disk. Snail s pace Dirt cheap, huge amount. Clearly more registers will speed up a computer, but they are numbered in hundreds. More cache will speed up a computer, but that comes in limited amounts. It is essential to have enough RAM in your computer because, If your machine has to resort to VRAM it will slow down very noticeably. C Wilson 40

43 Computer Systems: System Performance Data exchange with peripherals So far we have looked at the internal factors affecting computer performance. But what about the peripheral devices we connect our computers to? How do these extra pieces of hardware affect the performance of our systems? Peripheral devices connect to computer systems via slots on the back of the computer. Such devices include printers, scanners, digital cameras, digital video recorders, mice, keyboards, mp3 players etc. They also include mass storage devices such as magnetic tape drives and disk drives. Each device has its own operational speed, uses its own language and deals with different amounts of data at a time. Interfaces In order for peripheral devices to communicate with the CPU they need to be ʻinterfacedʼ. An interface is a unit that sits between the CPU and a peripheral device and compensates for the differences in speed, codes and other characteristics, to ensure compatibility. Basic functions of an interface Status Information. Maintains information that informs the processor whether the peripheral is ready to send or receive data. Control Signals. Transmit and receive signals to/from the CPU in order to synchronise the movement of data in an organised manner. Input/Output. Transfer data between the computer itself and the external device. Buffering. Temporary storage of data as it is transferred from the processor to the peripheral and vice versa. Data Conversion. Converts data to/from the format understood by the peripheral to the format understood by the processor. The main task of an interface is to transfer data so that the processor is delayed as little as possible and therefore system performance does not suffer unnecessarily. C Wilson 41

44 Computer Systems: System Performance Buffers A buffer is an area of temporary memory that is allocated to transferring data between the computer and a peripheral device. A buffer will be used when a fast acting part of the system is exchanging data with a slow acting device. The buffer temporarily stores data until it can be dealt with. Example printer buffer A printer operates at a much slower speed than the computer. During printing, the computer can continue operating without waiting for each character to be printed if the processor sends the printing data to a buffer. The pages are then actually printed from the data in the buffer and not the computer s main memory. Meanwhile, the computer s processor gets on with other jobs and system performance does not suffer. On most printers these buffers are temporary memory stores within the device. Some can hold up to 8Mbytes of data, with more expensive printers holding 20 or more Mbytes. Print jobs sent to the printer s buffer Spooling When large amounts of data are to be sent to a peripheral device, or when the peripheral is shared across a network then spooling is a preferred method of compensating for the difference in speeds of the processor and the peripheral. Spooling involves the output of data to a temporary file on a backing storage device such as a hard disk. Example printer spooler In a busy office network where many print jobs might go to the printer at the same time, a print server is used. The print job goes to the print server, which stores the data in temporary files on its hard disk. The server then sends the data from these files (known as a print queue, to the printer while the network computers get on with other things. Print jobs spooled to the server s hard disk. So, buffering is using an area of temporary memory, spooling uses backing storage. Both allow the processor to send the print job quickly and then let it get on with something else. C Wilson 42

45 Computer Systems: System Performance Data Transmission Serial With serial transmission, each bit of the data (say, one byte) is sent out, one bit at a time, over the communications line. With synchronous transmission data moving between two devices is timed to coincide with a clock pulse. With asynchronous transmission the process of sending out the bits can be started as soon as the data is available. Serial transmission example USB Data that comes in on a serial port (E.g. USB Universal Serial Bus) is coming in one bit at a time. This data will go onto the data bus for transferring to the processor. The data bus is parallel, so the interface buffers the incoming bits until it has enough to send them onto the parallel data bus. Serial to Parallel Data Transmission Parallel With parallel transmission, each bit of an 8-bit byte is sent at the same time along a set of parallel wires. The intention being that all bits of the byte arrive at their destination at the same time. Parallel transmission is clearly faster than sending out a single bit at a time, but is only recommended where the distance between the transmitting device and the receiving device is fairly short, for example, connecting a printer to a PC. Over longer distances there is a possibility of skewing, where the individual bits may arrive at their destination at different times. This data will lose its integrity. For longer distances, where speed is not essential, serial communication is more practical. Skewing of parallel transmission data C Wilson 43

46 Computer Systems: System Performance Data Conversion As well as serial/parallel conversion, interfaces often have to carry out other forms of data conversion. Analogue to digital conversion is necessary for any analogue device which must have its data converted to digital for the computer and vice versa. Video input is an example of analogue to digital. Voltage conversion: as mentioned before, a peripheral might use different voltage values for ones and zeros compared to the processor. Protocol conversion: protocols are agreed rules used in data transmission about how data is formatted, timing, error checking etc. A network interface will have to handle protocol conversion to ensure data is sent out according to the rules of that network. As with all aspects of computing there has been a great increase in the speed of interfaces. USB 2 transfers data at 480 Mbits per second, compared with USB 1.1 which had a speed of 12 Mbits per sec. (USB is Universal Serial Bus). Before USB, SCSI (scuzzy Small Computer System Interface) was popular. It was parallel and transmitted at 5 Mbits per sec. Then ultra SCSI transferred at 20 Mbits p/s then ultra wide SCSI (16 bit) at 40 Mbits p/s. Firewire was a successor to SCSI, but is serial. It can transfer data at 800 Mbits per sec. It was developed by Apple and is particularly useful for connecting video cameras. Until recently, it was also used on all ipods. It can be used for printers / cameras / scanners etc. and devices can be daisy chained through one port. The main reason USB is used rather than firewire is because a firewire interface adds a couple of pounds to a systems cost. Another trend is towards wireless communication with peripherals: Infra-red is quite common for keyboards and mice. Laptops can communicate with printers via infra red. WAP (Wireless Application Protocol) can be used to govern how data is sent wirelessly. Bluetooth will become even more common in the future especially in setting up a WPAN (a Wireless Personal Area Network) where all your personal devices; phone, laptop, pda, computer, printer, camera etc. can all communicate without wires. C Wilson 44

47 Computer Systems: System Performance The trend in computers since the very first PCs were manufactured nearly 30 years ago has been for more powerful, faster processors, more main memory, and more backing storage. Some years ago a computer would come with an 8 Mhz processor, a 40 Mbyte hard drive and 16 Mbytes of RAM. Nowadays a 4 Ghz processor, 250 Gbyte hard drive and 1 Gbyte of RAM is fairly typical. What is even more dramatic is the new computer is actually much cheaper than the old one! Someone once said if cars had progressed as much as computers over the last 25 years then a Rolls Royce would have a top speed of Mach 2, it would have a turning circle of 10cm and it would cost 5. Someone else said if cars had progressed the same way as computers over the last 25 years then simple warning lights like fuel low would be replaced by system error 12, please send us a report, it would randomly crash twice a week and the airbag would ask are you sure before activating. However the trends are continuing, faster and faster processors, more RAM to handle all the overblown software we use and masses of hard disk space to store all our videos, MP3s, photos etc. C Wilson 45

48 Computer Systems: System Performance Exercise 1. If a processor has a 32-bit address bus, how many memory locations can it access? 2. Calculate the maximum size of memory for a computer with a 16-bit address bus and 8-bit memory locations. 3. Calculate the maximum size of memory for a computer with a 36-bit address bus and 32-bit memory locations. 4. Many micros have a 32-bit address bus and 32-bit memory locations but only have 32Mb or 64Mb of memory. Why is this? 5. Why does it improve computer performance if the attached printer has a buffer? 6. What method do print servers on networks use instead of buffering? 7. The difference between buffering and spooling could be summarised by simply stating (copy out): Buffering is using, spooling is using to take data quickly from a computer to let it get on with other jobs while the peripheral takes the data from the buffer/spooler in its own time. 8. What is the difference between a port and an interface? 9. What does buffering mean for an interface? 10. Why might an interface have to convert analogue to digital? 11. Give another example of data format conversion. 12. What is a network protocol? 13. Give an example of a status signal. 14. Which type of interface is very fast and suited to video transfer? 15. Why is wireless connection as with keyboards and mouse becoming popular. 16. State a drawback with wireless connection. C Wilson 46

49 C Wilson

50 Computer Systems: Peripherals Backing Storage There has been a great deal of development in storage devices over the last 10 years and this is continuing at a great rate. Magnetic storage Magnetic devices include hard disks, floppy disks, Zip disks and magnetic tape. They are called magnetic storage devices because their recording surfaces are coated with a material that responds to magnetic fields to enable data to be stored. These storage devices can be fixed or removable. Removable storage devices allow the user to disconnect the device and physically transport data from one computer to another. Hard disks and floppy disks have been around for 20 years in PCs but lately the floppy disk has almost become extinct. It only holds 1.4 MB and for anything other than text files, it no longer has any real use. The storage capacity of hard drives has increased enormously with 250 Gigabytes a typical capacity these days. Hard disks can spin at 7200 rpm and transfer data at 50MB per sec., this depends a lot on the interface: IDE or SCSI being the most common. All discs are divided into tracks and sectors when they are FORMATTED. This divides the disc into blocks and the track and sector gives co-ordinates for each block so that the data can be found. Hard disks contain more than one disk (called platters ). When a file is saved, the name, the track, sector and length of the file are recorded in a table called the FAT (File Allocation Table). When a file is to be loaded, the computer looks up the FAT to find where it is. Magneto-optical storage devices combine magnetic and optical technologies to read and record data. With a magneto-optical disk, a laser beam and a magnetic field is used to write the data. Only the laser is used to read the data. ZIP discs are an example, but rewriteable CDs and DVDs and now flash memory has made them almost redundant. C Wilson 48

51 Computer Systems: Peripherals Optical Storage CD drives which both Read and Write and now DVD R/W drives are common place. CDs store about 650 MB and DVDs store 4.5 GB (there are dual layer which store 8.5GB and double sided is possible). These also have different rates of data transfer. The basic CD transfer rate is 0.15 MB per second. A 32X CD transfers data at 4.8 MB per second. A DVD s original speed is 1.4 MB per second, an 8X DVD can transfer at 11 MB per second. CDs have probably reached their maximum speed at 52X, DVDs will probably go no higher than 16X. DVDs suffer from format differences in that you get DVD-R and DVD+R and not all drives play both. Tape storage Storing data on tapes used to be the only solution to backing up hard disks of large capacity. Now, with the advent of large, removable magnetic disks and optical CD R- RW or DVD technology, this is no longer the case. However, removable storage media is comparatively expensive, with overall costs up to ten times that of tape. Tape, therefore, still has the edge in this market. Tape is read and written on a tape drive. This drive winds the tape from one reel to the other causing it to move past a read/write head. Data is written to tape in blocks with inter-block gaps between them. The tape runs continuously and a single operation writes each block Capacity Magnetic tapes have large capacities, reaching up to several gigabytes and come in a variety of sizes and formats. DAT tape is now the most popular for backups of servers. Access Tapes are sequential access devices, which means that to get to a particular block of data on the tape, it must go through all the preceding blocks of data. Accessing data on tapes is therefore much slower than accessing data on disks with direct access. C Wilson 49

52 Computer Systems: Peripherals SOLID STATE STORAGE Solid state devices have no moving parts - everything is done electronically. It is non-volatile (i.e. does not need power) and so is called ROM, however the stored data can be changed as often as you wish when it is attached and power is going into it. (technically it should be called EEPROM Electrically Erasable Programmable Read Only Memory!) Solid state storage comes in the form of flash drives or USB sticks, SIM cards and various memory cards in cameras. Typical storage capacities at the moment are up to 1GByte, but this will increase. In fact a lot of research is going into this area and they could replace hard drives in a few years. C Wilson 50

53 Computer Systems: Peripherals Input Devices Scanners The flat-bed scanner is like a photocopier where you put a sheet or photo up to A4 size flat on the screen. Light is reflected onto photo-cells called CCDs (charged coupled devices) that detect the light and the values are digitised (analogue to digital converter) to form the pixels of the bitmap. You can get hand scanners that you drag across the sheet / photo. Accuracy The accuracy of a scanner is determined by resolution and bit depth. The resolution is how many ccds there are per inch (dpi) and bit depth is how many bits are used to record the colour of each pixel. Capacity This term does not apply to scanners, but scans (bitmaps) take up a lot of storage on disc especially if scanned at a high resolution in 24-bit colour. Speed Speed does not really come into consideration, there is little difference in the time taken to scan, but it could be a factor. The transfer rate from scanner to computer could also come under speed. Compatibility Compatibility would include type of interface and does the software run on your computer. A typical scanner would require a USB interface and Windows XP operating system. C Wilson 51

54 Computer Systems: Peripherals Digital Cameras Like scanners, the digital camera uses millions of photosensitive diodes called charge coupled devices (CCDs), to record the intensity of light in an image. These analogue values are then converted to digital using an A- D-C. Digital photographs are bitmaps, made up of thousands or millions of pixels with values to represent image brightness and colour. Accuracy As in scanners, accuracy refers to how well the computer representation of the image matches the original. This will depend on the resolution and bit depth. Resolution This is measured in megapixels but can also be given as, say, 2560 x One megapixel is qual to one million pixels. A device with a resolution of 1280 x 1024 captures 1,310,720 pixels. This could be called a 1.3-megapixel device. Bit-Depth The number of bits per pixel determines the number of colours that can be represented. Speed Speed does not really apply at all to cameras. Compatibility For compatibility you might take into account pictbridge enabled, type of storage card as well as interface. PictBridge is a standardized technology that lets you print images from a memory card in a digital camera directly to a printer regardless of brand. No computer is necessary. Typical media types include xd-picture Cards, SmartMedia, and Compact Flash. Capacity In this case, capacity is the number of photos that can be stored on the storage card. Most cameras come with a very low capacity card, say 32 Mbyte. To be useful you need at least a 256 Mbyte card. (It might seem a 5 megapixel camera using true colour (3 bytes per pixel) would need 15 Meg to store 1 photo, however the photo is compressed, usually jpeg to about 3 Meg.) C Wilson 52

55 Computer Systems: Peripherals Printers Ink-jet Also known as bubble-jet, this device operates by squirting tiny droplets of ink onto the page. The ink is first heated by a passing an electric current through a coil. In milliseconds a bubble of vapour appears, forcing a tiny drop of ink from the nozzle onto the paper (measured in picolitres). Resolution Typically 600 to 1200 dots per inch. They support the printing of text and graphics, colour and a range of shades. Speed Pretty slow with a range of 4 pages per minute to 8 or maybe 12 pages per minute, depending upon the model. Cost Relatively cheap, though the cost of ink can be high. Photoquality ink jets are becoming popular with digital cameras and there are small dedicated photo printers. These can have very high resolutions. C Wilson 53

56 Computer Systems: Peripherals Laser Printers This type of printer uses lasers to "write" a page image onto a special drum as an electrostatic charge. The charged drum attracts toner particles that are transferred to the page and heated to set the image. Resolution Typically 600 to 1200 dpi, although higher resolutions are available if you are prepared to pay the price. They print a complete page at a time to a pre-defined maximum page length and width. Colour has now become affordable for laser printers. Speed Ranges between 4 pages per minute and 40 pages per minute. Capacity Could include buffer size, important for network printers. Cost From 50 to thousands of pounds. C Wilson 54

57 Computer Systems: Peripherals Exercise 1. Using the Web find two different digital cameras (not too close in price). Compare the features of both cameras (in particular the characteristics mentioned above). Write a short report comparing them and recommend which one to buy, justifying your reasons. 2. As with one, this time search for two scanners. 3. Imagine you have a budget of for buying a complete computer system with software and peripherals for producing a school magazine. Investigate the cost of a computer that would be up to the task plus the cost of software. Decide what essential peripherals will be required. Justify your choices particularly in terms of speed, cost, resolution, capacity and compatibility P. S. I. Peripheral Scene Investigation. C Wilson 55

58 Computer Systems: Peripherals Data integrity Every transmission of data is subject to errors so it is very important that these errors can be detected and the data can be retransmitted. Methods of error detection involve adding extra bits to the transmitted data which can be checked by the receiver. Parity check: The simplest form of error checking is parity which can be even or odd. Example (even parity) You take a binary code and add up all the 1s. If it comes to an even number you add a 0 to the end (the most significant bit) to keep it even but if it comes to an odd number you add a 1 to the end (the MSB) to make an even number of 1s. When the data has been transmitted the receiver checks the number of 1s. If it is an even number the receiver assumes that the data has been sent correctly. example 1) becomes ) becomes Disadvantage :Parity can detect one bit changing but not two bits changing. It is therefore only of use in a transmission medium which has an extremely small error rate. A typical use would be when transmitting characters from the keyboard to the main computer system. Checksums: Used when sending blocks of data and involves adding together the numerical values of all the characters transmitted in a block. This checksum is then added to the end of the block of data. The receiver performs the same calculation and compares its checksum with the transmitted one. If they are identical the assumption is that the block has been transmitted with no errors. When an error in a data item has been detected it will have to be retransmitted. This will, of course, slow down the system performance but has to be done because the uncorrected errors will generate faults, which would cause even more time to rectify. C Wilson 56

59 Computer Systems: Peripherals Exercise 1 Parity checking detects the change in a single bit. What errors can t it detect? 2 Would you recommend a parity bit or a checksum for the following: (a) data transference over the data bus; (b) data stored in a block on disk; (a) data transference over a telephone network. Justify your answers. C Wilson 57

60 St Benedict s High School

61 Computer Systems: Computer Networking If you purchase a computer nowadays, it will almost certainly be equipped with the means to connect it to another computer - either via a telephone line or a network cable, or wireless. At its simplest, connecting two or more computers together turns them into a computer network. Connecting two computer networks together creates an Internetwork. At its most complex, connecting millions of computers and computer networks together forms a huge internetwork or what we now refer to as the Internet. Before looking at networks in any detail, we need to equip ourselves with some definitions: Bandwidth is the speed of a connection, the bits per second that can be transmitted. Transmission media is what is used to transport the bits. It could be wireless or satellite, it could be copper phone lines or network cabling. Network Cable Types: Twisted pair is by far the most common type of cabling in use today. It can be shielded from electrical interference, so you get STP (shielded twisted pair) or much more commonly UTP (unshielded twisted pair). There are various standards of twisted pair cabling. The most common is Category 5 (known as Cat5 ), which transmits at 100 Mbits per second (compare to Broadband 512 Kbits per second or even fast broadband at 2 Mbits per sec). Coaxial cable is less commonly used nowadays. It is exactly the same cable as that going into the aerial socket on the back of your home TV set. Fibre-optic cable has a very high bandwidth (1000 Mbits, also known as Gigabit ) and is used where high speed is essential or where data has to travel longer distances. It is very expensive. C Wilson 59

62 Computer Systems: Computer Networking Categorising computer networks LAN A LAN is a Local Area Network, in one room or building or site. Cabling and hardware is usually owned by the company. High bandwidth (100 Mbits per sec), used for sharing peripherals e.g. printers and sharing data and files. A LAN can also have an application server, which saves having programs installed on each machine. WAN A WAN is a Wide Area Network, covering a large geographical area, and can be private or open. The cabling is not owned by the company as they will use phone lines owned by a public telecommunications company (bandwidth from 56 Kbits to 2 Mbits per sec), the hardware might be owned by one company as in a private WAN, or it could be like the web which does not have individual ownership. A WAN might be used for file sharing, data sharing, ing, instant messaging or chat. Intranet This is a network (either LAN or WAN) that uses web technology to create a private web for use by only that company. So, within their own network they can display information in the form of web pages, they can download (or upload) files, have , instant messaging or chat. It is a private web. Internet The Internet is a worldwide network of networks. It is the actual hardware, the servers, the cabling, the modems, the routers and so on. There are 5 applications that run on the Internet: o o o o o The Web (http) - what most people call the Internet. File downloading (ftp) Chat (IRC) (SMTP, POP) Newsgroups C Wilson 60

63 Computer Systems: Computer Networking Quick Comparison of LANs, WANs, Intranet and Internet: Transmission media Bandwidth Geographical spread Functions LAN Cat 5 (twisted pair) Owned by company Very high 100Mbps On site Sharing peripherals, files, WAN Phone lines 56Kbps to 2Mbps Up to Worldwide Sharing files, Intranet Possible mixture of cat5 and phone lines Externally probably 2Mbps, internally 100Mbps From one office to Worldwide Sharing files, . Central access to up-todate documents Internet Phone lines Varies, 56Kbps to 2Mbps Worldwide Web / information / shopping / / chat etc C Wilson 61

64 Computer Systems: Computer Networking Networking Modes Originally, networks were multi-access systems where you had a central mainframe with lots of terminals attached. These were usually dumb terminals in that they did not have any processing power of their own; they ran the programs off the mainframe and stored all their data on the mainframe. You can still get these types of system today, though they are called thin client nowadays rather than dumb! They need a very powerful central mainframe but are easy to manage as all upgrades etc. are done on the mainframe rather than servicing hundreds of terminals. The terminals are very cheap and are easily replaced. Most networks however are not thin client but use proper, quite powerful PCs as the terminals and each PC has its own software installed. There are two types of such networks: Peer to Peer In P2P networks there is no central server, each PC is equal on the network, each machine runs its own software and saves its own data. However, the PCs are connected and can share data and peripherals to a small number of other users on the network. Each user decides which files on their machine can be shared and whether they are read only or read/write. Each user also decides which peripherals (e.g. a printer) can be shared with other network users. If a computer is switched off then their shared resources are no longer available to others on the network. There is no central manager and each user is responsible for his/her own backups. Security is very low level. Note: On this course by P2P we mean a LAN in an office. Bit- Torrent, Kazaa, Morpheus etc have just taken that idea and turned it into a WAN service by running software on a server on the Net. C Wilson 62

65 Computer Systems: Computer Networking Client / Server Client/Server networks rely upon a central server that controls access to the network through usernames and passwords. Such a system works on the principle of users. A client can be thought of as the combination of a station and the user. A user is allocated privileges which permit access to some of the resources on the servers and deny access to others. User files are generally stored centrally on this file server (in a secure home directory ). Files can also be made available for sharing amongst groups of users. Other services might include , file downloading and peripheral sharing. Backups are managed centrally from the file server. The organisation of a client/server network requires a network manager to be responsible for user accounts, access privileges and sharing of networked resources. SUMMARY Peer to Peer: Every node equal. Share peripherals / send messages. Users choose which resources/files will be shared to others on network. Each user responsible for backups Low security. Client / Server Central server controlling access. Share peripherals / send messages. Files available on server. Backup organised centrally. High level of security. User activities logged. Requires a network manager. C Wilson 63

66 Computer Systems: Computer Networking Network servers A server is generally a more powerful computer running a software package that provides specific services to client computers on a network or on the Internet. The term can refer to a particular piece of software, such as a web server, or to the machine on which the software is running, e.g. "Our mail server is down today, that's why isn't getting out." A single server machine could have several different server software packages running on it, thus providing many different servers to clients on the network. A File server controls logins to a network and gives users access to file areas. A file server is likely to be a powerful machine with one or more high capacity hard disks. A Print server allows a user to access a printer attached to it. Print servers are often small dedicated devices attached to the network wherever a printer is required but can also be a software program running printer queues on a centralised server machine. An server stores users and details of their accounts, giving them access to their mailbox when they request it. An server is likely to regularly log into another server on the Internet, receiving and transmitting any external mail which needs to be sent or received outside the LAN. A web server stores web pages and transmits them across the Internet or an intranet. Clients request and then view web pages using web browser software. A Proxy server connects a LAN to the Internet by forwarding requests for web pages or other Internet activity. A proxy server allows a number of users on a network to access the Internet through a single connection by making the request for pages for them. As far as the outside world is concerned, there is only one machine connected to the Internet. As far as the machines on the network are concerned they are all connected to the Internet, but they are connected via the proxy server. Some or all of these functions may be performed by a single machine on a small network, though it is wise to try and spread the load between a number of different machines in order to avoid the network slowing down when a particular service is requested by a number of users simultaneously. Print Server Printer File Server Web Server C x8x9x10x1x 12x 1x 2 x 3x A4x5x 6 7x8x9x10x1x 12x x 1x 2 x 4x3xB5x 6 x Hub/Switch Proxy Server Client ISP -> INTERNET Client Client Client C Wilson 64

67 Computer Systems: Computer Networking Exercise 1 List 3 differences between the characteristics of a LAN and a WAN from transmission speed, geographical spread, functions and bandwidth. 2 What is an Intranet and what are its main functions? 3 What are the main functions of the Internet? 4 What is the difference between a mainframe with terminals and a network of computers? 5 Describe the functions of: A file server A print server A web server 6 Compare and contrast peer-to-peer networks with client server. C Wilson 65

68 Computer Systems: Computer Networking Network Topologies By topology we mean the shape of a network. It describes how the network devices are connected together. Computers, printers and servers are known as nodes. Cables are usually known as channels. There are four main network topologies: Star Topology node Bus Topology channel Ring Topology Mesh Topology Type of network Description Effect of single node failure Effect of single channel failure Star Relies upon a central node (a hub or a switch ) to route communications. Can be expensive to wire. Only that node affected, unless it is the central node in which case entire network is down. Only one node affected. Bus Relies upon a single channel for communications. Very easy to expand. Cheap wiring. Fault in one node has no effect on rest of network. Entire network down. Ring Relies upon a single channel for communications. Cheap wiring. Fault in one node has no effect on rest of network. Entire network down. Mesh Multiple routes between nodes. Multiple transmissions can occur at the same time - excellent performance. Lots of wiring - very expensive. Fault in one node has no effect on rest of network - only that node affected. Messages re-routed if necessary Fault in one cable doesn t affect network messages re-routed. C Wilson 66

69 Computer Systems: Computer Networking Exercise 7 On a network what is meant by: A node A channel 8 Draw a labelled diagram of a bus topology. 9 What is the effect of node failure on a star topology? 10 Why is a mesh network the most reliable? 11 What is the effect of node failure on a ring topology? C Wilson 67

70 Computer Systems: Computer Networking HARDWARE We have already come across a hub as the centre of a star network topology. It can also act as a repeater, extending the distance of UTP cable. A switch, or switched hub also reads addresses on the network traffic and only sends the data to the correct node. An ordinary hub broadcasts the data to every node. A switch will also effectively divide the network up into a series of different segments, thus reducing the likelihood that a cable fault will bring the whole network down. A router is used to connect networks (internetworks). It uses IP addresses to determine which route or path data should take to get to its destination. A Network Interface Card (NIC) is the circuit board (interface) behind the Ethernet port at the back of a computer. You cannot connect to a LAN without an NIC. Every NIC has a unique MAC (Media Access Control) address that identifies the node on a network. C Wilson 68

71 Computer Systems: Computer Networking So, A Network Interface Card is essential for connecting a node to a network. A hub is where all the nodes connect together in a star topology network. When a message comes in for a node the hub transmits the message to every node, the message has an address on it and the node it is for picks it up. A switch is an intelligent hub, when a message comes in it looks at the address and only transmits it to that node. A router is for forwarding data through an internetwork. It uses the IP address to determine the best route to send the data on its way. TRENDS Networks are becoming faster, there has always been a trend towards higher bandwidth on LANs and WANs due to the amount of data that has to be transferred, particularly multimedia data, music and video which all have large files. LANs are normally 100Mbits per sec, compared to 10 Mbits per sec. Modems were originally 14 Kbits per sec., quickly superseded by 28 Kbps, then after a while came 56 Kbps. More recently we have ISDN and broadband. Home ADSL was 512 Kbps, recently that has become 2 Mbits per sec. for those that want it. Faster speeds will still be sought so that eventually the Internet could provide video on demand, personal TV scheduling and so on. Another recent trend is towards wireless connections and home networks and this will inevitably continue. C Wilson 69

72 Computer Systems: Computer Networking Technical reasons for the increasing use of networks include advances in processors, main memory, storage and transfer rates. Processors have become much more powerful and capable of handling all the processing concerned with network traffic both for servers (which often use multiple processors) and for clients. The Web is multimedia and with LANs moving to intelligent clients then huge amounts of RAM are necessary. However large quantities of DRAM are readily and cheaply available for modern computers allowing them to handle these applications. Huge amounts of storage is required for client server networks as well as web servers. Also client PC need enormous storage for multimedia files. Again this has become readily available with even cheap PCs coming with 200 Gbytes of storage. As stated on the previous page, transfer rates have increased enormously, home broadband of 2Mbps is readily available and this has transformed the web in terms of multimedia content which needs large bandwidth. For LANs UTP used to be 10 Mbps and this has increased to 100 Mbps being normal nowadays for cat5 cable. This allows larger more data intensive LANs to operate. So: faster and more powerful processors, cheap and large quantities of RAM, cheap, large capacity hard discs and increasing bandwidth have all been important hardware factors in the rising use of networks. C Wilson 70

73 Computer Systems: Computer Networking In addition to hardware advances, there have been great advances in software. A browser is a program that lets you view pages and interact with the World Wide Web. These have advanced a great deal since their inception and all a user has to do nowadays is enter an address in the address line or click a link to go to a site. Various plugins can be added that greatly enhance their capabilities. Also software like flash, real player and so on have all integrated with browsers giving us the present multimedia web that we all know. Operating Systems have also advanced greatly. Since Windows 95, peer to peer networking has been possible. Windows NT, updated to Windows 2000 Pro and now Windows XP Pro allows client server networking. (NT stood for New technology). All client computers must have a Network O/S on their machines to connect to the network. These Operating systems have become more reliable and more feature rich and so are another technical reason for the increasing use of networks. Also security has been greatly enhanced which is very important nowadays with hacking and viruses. C Wilson 71

74 Computer Systems: Computer Networking MISUSE OF NETWORKS Hacking is unauthorised access to a network. Controlling access to the network The network operating system is responsible for security on the network. The most obvious example of this is when a user logs on. The user must supply an identity and a password. The operating system compares the data entered with the identities and passwords in its database and if the two do not match up then it will not allow that user any access to the resources on the network. If the identity and password do match, then the resources which the user has access to will depend on the level of access that user has been given by the network manager. The access a user has to resources depends on that user s level of permissions. There will always be a network manager who has access to everything, everybody s files and passwords. They are able to trace anyone misusing the system, they organise the permissions for different categories of users, allocate ids and passwords to new users, remove old users from access. C Wilson 72

75 Computer Systems: Computer Networking The easiest way for a hacker to operate is to find out a users login name. This is often freely available or can be found out from s. Then find their password. This might seem fairly impossible, but can often be remarkably easy: Bribery (everyone has their price!) By knowing about them e.g. family names, football team, favourite singer etc. By a con e.g. phone them saying you are from the helpdesk and need their password to check something. Set up a dummy website ( phishing ) which seems like a real one where they have to enter their password. Planting software on their system that records keystrokes. Simple burglary and find it written down in their desk drawer. Actual hacking, using backdoors and faults in the Windows software. Hackers often work for the imagined kudos rather than to do anything destructive. However there are also plenty of vandals out there who get a kick out of disrupting or destroying. Then there are professional criminals and Eastern Europe have some very clever unemployed Computer Scientists working on hacking into financial systems. To keep yourself safe you must have the latest version of your Operating System installed and make sure you get automatic updates. You must have an effective firewall, you must run anti-adware programs regularly. Be aware of the cons in the list above. Viruses A virus is a piece of programming code that causes some unexpected and usually undesirable event in a computer system. They are often designed so that they automatically spread to other computer users on a network. Viruses can be transmitted as attachments to an , as a download, or be present on a disk being used for something else. Some viruses take effect as soon as their code takes residence in a system whilst others lie dormant until something triggers their code to be executed by the computer. Viruses can be extremely harmful and may erase data or require the reformatting of a hard disk once they have been removed. Up to date virus protection software is essential on any computer connected to the Web. C Wilson 73

76 Computer Systems: Computer Networking Copyright P2P software like Kazaa, Morpheus or Bit torrent has led to a huge market in free downloading of music, videos and software. Revenge of the Sith was on the Web before it was released to cinemas. Anything made available to a file sharing network can be downloaded a million times within a day and it is quite socially acceptable to steal in this way, nobody thinks anything of it, though court cases are arising as music companies try to strike back. One of the main problems is in the copyright laws themselves. It is illegal to make a copy of anything (text, picture, music etc.) in electronic or any other form. Now when you access a website a copy is cached on your hard disk. So technically it is illegal to access most websites. This means the Prime Minister, the Chief Constable and everyone else is breaking copyright. If you keep a video recording of a program, you are breaking the law. Showing a video to friends is illegal. It all becomes a bit absurd, so downloading some mp3 files doesn t seem very wrong either. Computer Misuse Act In the United Kingdom, the Computer Misuse Act (1990) covers using computers to damage or steal data. The Computer Misuse Act covers crimes such as breaking into computer systems or networks to destroy or steal data and propagating viruses that destroy or damage information or computer systems. Data Protection Act In the United Kingdom, the Data Protection Act (1998) describes the duties and responsibilities of those holding data on individuals. It also describes the right of these individuals. In general, it is the duty of those holding data on individuals to register with the Data Protection Registrar, to keep the information secure, make sure it is accurate, and to divulge it only to those persons who are authorised to view it. It is the right of an individual who has data stored concerning them to view that information and to have it changed if it is inaccurate. There are a number of organisations that may be given exemption from this act -namely the Police, Customs, National Security and Health Authorities. Copyright Designs and Patents Act This protects anyone s rights to anything they have created whether it is an essay, a song, a piece of artwork etc. It makes it illegal for anyone to make a copy, never mind sell it or anything else. C Wilson 74

77 Computer Systems: Computer Networking Exercise 1. What is the main difference between a hub and a switch? 2. What is the job of a router? 3. Explain 2 technical reasons for the growth of networks. 4. One user of a network gets access to all files and folders, another user is restricted to only some files. How is this enabled? 5. Give some examples of how hackers can gain access to a network. 6. What is a virus? 7. Which law makes the spreading of viruses illegal? 8. Why has downloading mp3s become socially acceptable? C Wilson 75

78 C Wilson

79 Computer Systems: Computer Software THE RANGE OF SOFTWARE A processor can do nothing without instructions. These instructions with their associated data make up the programs or software that are needed to do the various tasks in a computer. Software can be divided up into the following categories: system software programming languages application software utility software We will be looking at these in detail in the following pages. SYSTEM SOFTWARE This is the set of programs used to operate and maintain a computer system. It is a large collection of programs which includes the operating system and utilities such as a disk formatter or program compiler. It is the operating system software which makes modern computers useable by ordinary people. The system software provides a layer of software that lets users operate the computer without having to know about the underlying processes that are going on all the time. The Single-user Operating system This is the central piece of software which manages and coordinates the activities and information within the computer. It is a very complex piece of software whose fundamental intention is to simplify the use of the computer for the user. A single user operating system handles communication with the user, manages memory storage, deals with input/output communications with peripherals and schedules the processors time on tasks. There are 2 main types of SINGLE USER OS: DISC BASED OPERAING SYSTEM ROM BASED OPERATING SYSTEM C Wilson 77

80 Computer Systems: Computer Software DISC BASED Operating Systems (Single-user) The majority of computers systems load their operating system from disc into RAM as soon as the machine is switched on. Advantages 1 This has the advantage to the operating system of being very simple to upgrade. 2 It also means that only those necessary parts of the operating system that are needed on startup have to be loaded while the rest can reside on disc until required by the system. Disadvantages 1 Takes longer to load / start up computer 2 More susceptible to corruption. How does it work? The 'boot-strap', which is a small but very important part of the operating system resides in ROM. Its task is the first, which a computer performs. e.g. checking memory then loading the rest of the operating system from the hard disk as required. ROM-based Operating Systems (Single-user) This OS holds all the operating system in ROM as was the case with some older systems. Advantages 1 This hardwiring loaded faster - This meant that it was ready as soon as the computer was switched on. 2 more robust - It was impossible to corrupt the system but very difficult to upgrade it as it involved changing the ROM chips on the motherboard. Disadvantage 0 Difficult to upgrade when new versions of operating systems were released. C Wilson 78

81 Computer Systems: Computer Software THE LAYERS OF THE OPERATING SYSTEM (ONION MODEL) There are basically five layers of a single-user operating system. These are often represented by what is known as the 'Onion' model. The layers of this model interact with each other as necessary. Command Language Interpreter (CLI) File Management Memory Management Input/Output Management Kernel Command Language Interpreter File management Memory management Input/Output management Kernel The operating system is responsible for managing the hardware and communicating with the user. It can be broken down into various layers but the exact details of these are not needed here. The advantage of putting software into layers is that, if a manufacturer updates part of your operating system, only the software dealing with that layer needs to be rewritten. C Wilson 79

82 Computer Systems: Computer Software The Command language interpreter The operating system has to take user commands from the keyboard, mouse etc., interpret the commands and pass them to the appropriate part of the operating system which deals with that command. Its function is to accept commands (from a keyboard, mouse, etc) ensure that the syntax is correct and then initiate the appropriate process. NOTE! If the command cannot be understood, a suitable error message should be given If the command involves the memory or file management layers of the operating system and, in turn, the memory or file management layers will probably need to call on the Input/Output Management layer to fulfill their tasks. Relating this to the 'onion' model, it becomes clear that these layers must interact with each other. Exercise 1 What is meant by the syntax of a command? 2 When you type in a command, what does the CLI do once it has checked the syntax? 3 If you make a mistake in typing the command, what action is taken by the CLI? 4 Is this statement true - 'The Command Language Interpreter is the highest level layer of the Operating System' C Wilson 80

83 Computer Systems: Computer Software File management: The operating system supervises the creation, deletion and updating of files. The File Management layer is responsible for interpreting instructions such as the reading, writing, opening and closing of files in a manner which will be understood by the Input/Output layer which actually has to carry out the operations. allocates particular areas of backing storage to particular blocks of data. It manages an index of where all the user's applications and data are stored so that they can be accessed consistently. It allows the user to access the files by name whereas the machine identifies them numerically, i.e. it maps our logical view of the filing system to its physical structure. A directory has to be kept which keeps track of where files are stored on the various types of backing storage. This is a hierarchical directory structure in which files are placed in directories (or folders) and subdirectories (see graphic). Most modern storage systems are hierarchical, i.e. you can have folders within folders and further subfolders etc.. and you can store data files at any level in the hierarchy. If you type a command telling the Command Language Interpreter to retrieve a file from disc, the CLI will pass on instructions to the File Management layer. Your request will only be successful in a hierarchical storage system if you give the full pathname to the file, e.g. F:/mydocuments/letters/smith.doc to access a file on drive F: in a main folder called mydocuments which contains a subfolder called letters inside which is the target document called smith.doc. The File Management layer of the OS is responsible for accessing the appropriate files and locations in the backing storage system, i.e. it manages file operations and backing storage allocation). C Wilson 81

84 Computer Systems: Computer Software Exercise 1 What are the two basic tasks of the File Management layer of the Operation System.? 2 What is meant by a hierarchical filing system? 3 What is meant by the term 'full pathname'? 4 There are hierarchical layers in the Operating System, as illustrated in the 'Onion' model. 5 Put these in the correct hierarchical order: a. Input/Output Manager.. b. Command Language Interpreter. c. File Manager C Wilson 82

85 Computer Systems: Computer Software Memory management The operating system has to decide where programs and data are to be placed in memory. In a single user system the memory manager makes sure that data and program files are loaded into the computer's RAM correctly. In a multi-tasking environment, t keeps track of what stage each program is at and ensures that no program tries to access the memory space of a different program. This applies especially to the operating system's space. If it is corrupted in some way it could cause the whole computer system to crash. In order that an application will run, and be capable of making use of all the system resources, it requires: that the Operating System be running, i.e. already in memory. it has memory space of its own in which to run. it has memory space in which to store its data. it has (perhaps) memory space in which to write temporary data. The Memory Manager ensures that none of the above storage requirements clashes with any of the others. Similarities Between the File and Memory Management Functions. In one sense, Main Memory is just another storage device and, as such, you would expect it to be under the control of the File Management layer. The roles of each are similar. The File Manager will not allow a file already allocated space on a disc to be overwritten by another file. The Memory Manager will not allow the code for one process stored in memory to overwrite the code of another stored in memory. However, the Memory Manager has an extra role when the code for more than one process is stored in memory. It needs to check the status of each process capable of running in memory and, if a process is stalled, e.g. because it is waiting for input or waiting to output data, it needs to inform the Kernel so that another process may be assigned CPU time. Summary of Memory Management Layer Operations: Allocate specific areas of memory to specific tasks, = i.e. programs in one area, data in another. Keep track of the status of each process in memory, = e.g. whether a process is 'busy' or 'stalled'. In a multitasking system, ensure that one process doesn't interfere with data in another. C Wilson 83

86 Computer Systems: Computer Software Exercise 1 Besides memory space for itself, what other areas of memory need to be allocated when an application is running? 2 Describe one way in which the tasks of the file manager and the memory manager are similar? 3 What does the Memory manager do when a running program becomes stalled? 4 List 3 main operations carried out by the memory manager. C Wilson 84

87 Computer Systems: Computer Software Input / Output This is sometimes referred to as the BIOS = Basic Input/Output System and it is usually supplied on a microchip by the manufacturers of the computer system. The Input/Output management system provides a consistent interface between the higher levels of the OS and the low level switching required by the hardware. It compensates for the differences in operating characteristics of the various input and output devices attached to the system. These differences will be both electronic and mechanical since devices will have different electrical requirements and some will be much slower or faster than others. Neither the system as a whole nor the user need pay attention to these differences. Who provides the I/O System? The Input/Output System is not provided by the designers of the OS but by the hardware manufacturers, since they know best how to contol their own hardware. (i.e. the BIOS chip) If extra hardware is bought for the computer, say a printer, then the printer manufacturer will supply the appropriate software (often called a driver) to handle that peripheral. Example 1 A user enters what seems like a simple command to copy a file from hard disc to floppy disc. On a low level, this command is complex, since it involves a disc access to fetch the data from the file (a READ or INPUT operation) and a routing of that data to the floppy via memory (a WRITE or OUTPUT operation). Thanks to the Input/Output Management routines' decoding of the instructions (via the Command Language Interpreter and the File Manger) the operation is conducted seamlessly. Example 2 When a user requests that a file be sent to the printer, the input/output system manages the necessary data transfer All peripherals work at different speeds and have different characteristics. The I/O system hides these differences and makes them all appear to operate in a similar manner. It is the task of the I/O system to do all the actual data transfers and issue the appropriate control signals to the peripherals. C Wilson 85

88 Computer Systems: Computer Software Exercise 1 How does the I/O Manager provide a consistent interface between the OS and the hardware? 2 What is the function of the BIOS? 3 Who provides the computer system's BIOS? C Wilson 86

89 Computer Systems: Computer Software The Kernel - Process Management The processor in a computer is known as the 'work horse', where each activity is scheduled by the KERNEL. Each activity is known as a process. The Kernel is responsible for controlling all the processes running within memory. In a single-program operating system (a non-multi tasking) it only has to choose between itself and the package being run. There are only two processes to be allocated CPU time : 2 The OS 3 The user's application The Kernel's task is to divide the time between these two processes. Multi tasking On systems which can run several programs simultaneously, this becomes much more complex. The operating system has to decide which of the tasks in a multitasking environment gets to use the processor. Process management is usually called 'the kernel' as it is the core function of the operating system. All of the above tasks of the operating system are essential to the running of a computer system and the software for them will be loaded in when the computer is started up and kept in memory as long as the computer is switched on. Interrupts Communication occurs between the Kernel and the various processes by means of signals on the interrupt line on the control bus. Exercise 1 The Kernel is responsible for controlling the processes running in a computer system. What is a process? 2 Explain how the Kernel handles PRINT request from an application. 3 What is meant by an interrupt? C Wilson 87

90 Computer Systems: Computer Software Summarise below the parts of the operating system Part of O/S Function Command Language Interpreter File Management Memory Management Input/Output Kernel C Wilson 88

91 Computer Systems: Computer Software Network operating system In a network, the operating system has to perform functions in addition to those carried out in a single user system. No computer can function as a network workstation unless its operating system can perform these additional functions. All stations on a network should have the same operating system to make it easy to communicate with each other. An additional task of a network operating system is to handle the messages from other stations on the network. This includes tasks such as handling communication between network stations by addressing (putting the receiver s and sender s address on the message being sent) looking at incoming messages and checking if they are for that station. checking that data has been transmitted correctly from station A to station B Informing stations when an error has occurred so that the sender ca re transmit data The main function of network operating system is to allow the network to communicate by exchanging files. Another important activity controlled by a network operating system is to allow users to connect to the network by managing logging in procedures. Allows the user to log on (user name must be recognised before access is permitted) Maintains security by keeping a log of users passwords Allows user access to hardware and software according to user privileges. The following file management tasks are enabled by the network operating system: Enabling the network manager to set up user groups Controlling which files are assigned to the groups Determining whether or not users have the right to read a file or whether they can alter it as well. Sharing resources on a network An important function of a network operating system is the management of shared resources. The network operating system allows the network manager to determine which peripherals - printers, plotters and backing store devices are to be shared across the network and which users are allowed to use them. If there is a dedicated fileserver its job will be to allow user access only to files/folders which belong to them /which they hace access to. If there is a dedicated printserver it handles the queue of all the print jobs from all workstation/users. Data integrity The network operating system also has to ensure data integrity and provide error correction features. When data has been sent and a transmission error is detected, the network operating system has to inform the sender that an error has occurred and the data has to be retransmitted. C Wilson 89

92 Computer Systems: Computer Software Multi-user access A user logs on to the network by giving an identity and a password and is then allowed to work on the network. The identity controls what access that user has on the network. This is usually done by placing them at a specific place in a hierarchical structure and letting them have access to what is below them in the hierarchy. They would also be given limited access to other parts such as a program library. To help in this, each file has read/write access attributes. In a typical situation, a user will have read and write access to his/her own files and read access only for library files. It is usually possible to set group access as well so that a class, for example, can share files. Encryption of data On a ring or bus network all communications pass through every station. Thus the sending of passwords (or any other sensitive data) across the network has to be protected from the view of other stations that the message passes through. Some aspects of the network operating system may be addressed by systems dedicated to specific tasks. For example it is common to have a print server which accepts print jobs from stations on the network and, if the printer is busy, stores them for printing at a later time. This means that each station can return to work as soon as possible thus improving the overall network performance. A file server can also be used which provides a single central store of data. Its tasks would include network security and the control of multi-user access to files (data sharing). This involves making sure that a user can only access their own files and selected other files such as application programs and network databases. Exercise 1 Identify two of the tasks involving the NOS when a communication is taking place between two workstations. 2 What does a fileserver do? 3 What does a printserver do? 4 Identify two ways in which the NOS can prevent unauthorised access to data files stored on the fileserver. 5 Why will some user who legitimately log on not be allowed access to some of the facilities available to other users? 6 What name is given to the operating system in your computer? 7 How much memory does it take up in your computer and how much memory does it leave for the user? 8 If you are using a networked system, find out about the facilities available from your file server and print server (if you have them). C Wilson 90

93 Computer Systems: Computer Software Utility programs-single User Special programs called utilities are used to carry out routine functions. Although separate from the OS, utility programs work alongside the OS to perform these routine activities. Some utilities are supplied along with the OS; others can be bought and added later as the need arises. Utilities can carry out the following tasks: Sorting files into order Merging two files into one Backing up files Recovering data from damaged files Recovering files that have been deleted accidentally Utility programs are programs that aid the maintenance of the computer system or make the user s life easier. They are not normally essential for the running of the computer and are normally kept on disk until needed. They are sometimes supplied with the operating system and sometimes bought as extras. They include such programs as a disk formatter, disk tools (for repairs, corrupt files etc.), programs for defragmenting a disk, undeleting files, virus checking etc. They can carry out the following disk handling tasks Reorganising the disk space where files are saved an freeing up large spaces for saving large files (Defrag) Transferring data from one disc to another Analysing and repairing faults with floppy discs Retrieving data from faulty disks Fragmentation Most modern filing systems save files wherever they can on a disc. They will attempt to save a file in consecutive sectors but, as time goes on and files are saved and/or deleted, this isn't always possible. So the file will be saved with part of it in one sector, another part in a sector in a different part of the disc etc. This will obviously slow down the loading of the file as the drive head will keep having to move to different parts of the disc to load the file. A 'defragger' is a utility program which moves files (and parts of files) around the disc until each file is stored in consecutive sectors with no fragmentation. C Wilson 91

94 Computer Systems: Computer Software Exercise on Utility Programs 1 Give a brief definition of the term 'utility program. 2 Name and describe three examples of utilities 3 How can you make sure that your anti virus program can detect the latest viruses? 4 Why are driver utility programs usually supplied with peripheral devices? C Wilson 92

95 Computer Systems: Computer Software Translators Some operating systems provide translators so the user can create executable programs but on smaller systems these often have to be purchased. Most programs are written nowadays in a high-level language. This type of language uses normal mathematical notation and English words to create statements. This helps the programmer express a program in a way that reflects the problem being solved. Thus they are often known as problem-orientated languages. A translator converts a program from a high-level language into machine code. The high-level program is called the 'source program'. This is often created using a text editor. The translator turns this into 'object code' which is usually the machine code of the computer being used. Translators can normally be put into two groups compilers and interpreters. Compiler A compiler is a program that translates your high-level source program into your computer s machine code. Generally each high-level language instruction becomes several machine code instructions. Advantages It produces a machine code program which can be executed by itself. The source program will only be used again if the program needs to be changed. It translates the complete program in one go. It will even take many separate modules and combine them together to form one large program. Only needs to be in memory while translation is taking place. More economic (memory usage) than interpreter Runs faster than interpreted as whole source is translated to machine code. Disadvantage Syntax errors in the source code are only identified when the program is compiled. C Wilson 93

96 Computer Systems: Computer Software Interpreter An interpreter translates and executes a program one statement at a time. Disadvantages Statements inside a loop have to be translated every time round the loop. Because the interpreter translates statements as it executes the program, it will obviously run slower than the same program which has already been compiled into machine code. The interpreter must also be in memory as the program is executed whereas a compiler is not needed once the program has been compiled. Thus the RAM demands of an interpreted program are greater than the RAM demands of the compiled version of the same program. Advantages being a simpler (and hence less expensive) program easier to use because it is in memory as the source code is being entered. When syntax mistakes are made by the user, they can be corrected immediately. Exercise 1 What is source code? 2 What is machine code? 3 Which type of translator produces stand alone machine code? 4 Which type of translator is better for someone learning to program a computer? Why? 5 Explain why compilers are more economic with main memory. 6 Explain why compilers produce code which is faster. 7 What is meant by a syntax error? 8 What is a run-time error? 9 Describe the effect on the running time of a program loop if it is interpreted or compiled. C Wilson 94

97 Computer Systems: Computer Software Network utilities Alongside the network operating system, there will be a series of utilities to allow the network manager to carry tout a range of tasks connected with the running of the network. Examples the network diagnostics utility that helps the manager to find and fix fault the administration utility that helps the manager to monitor the no. of messages sent to and received from a particular station on the network log the amount of time spent connected to the network Exercise 1 Describe the main features of a single user operating system 2 Describe the additional functions of a network operating system 3 Define a utility program. Give 2 examples of utilities. 4 Are utility program part of the operating system? 5 Describe in detail the steps involved when a compiler is used to develop and produce an executable program. Your answer should include details of when the compiler, source code and object code are held in memory and at which stages of the process. 6 Describe in detail the steps involved when an interpreter is used to develop and execute a program. Your answer should include details of when the interpreter and source code are held in memory and at which stages of the process. 7 Compare the efficiency of a compiled program versus an interpreted program as it is being executed. 8 Compare and contrast the usage of a compiler and interpreter. Your answer should include ease of use, speed of execution and memory usage. 9 What is a fragmented disc is and what effect does it have on system performance? What effect does de-fragmentation have? 10 Try the Compiler v Interpreter practical task which your teacher may give you. It involves using a language which has a compiler and an interpreter built in. You are given a program which finds prime numbers. It is a very mathematical program with limited output which should show considerable speed differences when run under the two translators. C Wilson 95

98 Computer Systems: Computer Viruses C Wilson 96

99 Computer Systems: Computer Viruses Viruses A virus is a program code that causes some undesirable and unexpected event to happen in a computer. Viruses are usually disguised as something innocent and are designed so that they automatically spread within or between computer systems. Viruses can enter a system as attachments to an , a download from the web, or from on a disk or CD. Some viruses take effect as soon as their code is executed and others can wait until circumstances cause their code to be executed by the computer. Viruses can be quite harmful and erase data or close down a system. Virus types Viruses are classed by three main types: File virus; Boot sector virus; Macro virus. File virus File viruses attach themselves to program files such as.exe or.com files. When the program is loaded, the virus is also loaded. A file viruses can also take the form of a complete program, or script, attached to something else, e.g. an . They then take up residence in the computer ready to cause havoc. Boot sector virus These viruses infect executable code found in certain system areas on a disk. They attach to the boot sector on disks or the master boot record on hard disks. To infiltrate the boot sector, the virus is read while the system is running and then activated the next time the operating system is loaded. Macro virus Macro viruses are fairly common viruses, but tend to do the least damage. Macro viruses infect applications and typically cause a sequence of actions within the application e.g. inserting unwanted words or phrases in a document. C Wilson 97

100 Computer Systems: Computer Viruses Virus code actions Viruses don t all follow the same course of action. They can, and do, use a combination of the following actions: Replication; Camouflage; Watching; Delivery. Replication A computer virus has the unique ability to replicate. Like a biological virus they can spread quickly and can be difficult to control. They can attach themselves to almost any type of file and spread as files are copied and sent between computer users. A virus can take a long time to replicate itself before activation. This gives it time to be spread over many computers before being discovered. Camouflage It is possible for a virus to avoid detection by taking on the characteristics that detection software is programmed to look for and ignore. However, detection software has evolved to prevent this happening. Today s anti-virus software does much more than simply check particular characteristics (or signature) of a virus. They also check the virus code and even checksum the virus code to identify it. With these cross-checks it would be extremely difficult for a virus to camouflage itself and get past detection. Watching A virus can lie in wait and ambush a computer when something routine is carried out e.g. opening a particular application. The damage routines will activate when certain conditions are met. On a certain date, or when the infected user performs a particular action may trigger the virus. Delivery Infected disks brought in from the outside used to be the main source of viruses until provided the ideal delivery vehicle. Once delivered the virus will wait for the trigger to drop its payload. C Wilson 98

101 Computer Systems: Computer Viruses Other infections Worm A worm is a self-replicating virus that does not alter any files but takes up residence in the computer s active memory and duplicates itself. They only become noticeable once their replication consumes the memory to the extent that the system slows down or is unable to carry out particular tasks. Worms tend to use the parts of the computer s operating system that is not seen by the user until it is too late. Trojan horse A Trojan horse is a program where harmful code is contained inside another code which can appear to be harmless. Once the apparently harmless code is in the computer, it releases the malicious code to do its damage. Trojan horses may even claim to be anti-virus in order to get the user to install it. The name comes from the deception that the Greek army played on the people of Troy during the TrojanWar. They presented Troy with a large wooden horse in which they had secretly hidden their warriors. Once inside the city gates, the warriors emerged from the horse and took control of the city. C Wilson 99

St. Benedict s High School. Computing Science. Software Design & Development. (Part 2 Computer Architecture) National 5

St. Benedict s High School. Computing Science. Software Design & Development. (Part 2 Computer Architecture) National 5 Computing Science Software Design & Development (Part 2 Computer Architecture) National 5 DATA REPRESENTATION Numbers Binary/Decimal Conversion Example To convert 69 into binary: write down the binary

More information

The Central Processing Unit

The Central Processing Unit The Central Processing Unit All computers derive from the same basic design, usually referred to as the von Neumann architecture. This concept involves solving a problem by defining a sequence of commands

More information

1.6 Graphics Packages

1.6 Graphics Packages 1.6 Graphics Packages Graphics Graphics refers to any computer device or program that makes a computer capable of displaying and manipulating pictures. The term also refers to the images themselves. A

More information

Higher Computing: Computer Systems CONTENTS

Higher Computing: Computer Systems CONTENTS CONTENTS Topic 1 DATA REPRESENTATION... 3 1.1 Text... 3 1. Numbers... 4 Exercise... 4 1.3 Integers: positive and negative numbers... 5 1.3.1 Signed Bit... 5 1.3.1 Twos Complement... 5 Exercise... 6 1.4

More information

INTRODUCTION TO COMPUTERS

INTRODUCTION TO COMPUTERS INTRODUCTION TO COMPUTERS When we talk about computers, we really are talking about a Computer System. Computer System: It is a combination of Hardware and Software. This combination allows a computer

More information

Chapter 9: A Closer Look at System Hardware

Chapter 9: A Closer Look at System Hardware Chapter 9: A Closer Look at System Hardware CS10001 Computer Literacy Chapter 9: A Closer Look at System Hardware 1 Topics Discussed Digital Data and Switches Manual Electrical Digital Data Representation

More information

Chapter 9: A Closer Look at System Hardware 4

Chapter 9: A Closer Look at System Hardware 4 Chapter 9: A Closer Look at System Hardware CS10001 Computer Literacy Topics Discussed Digital Data and Switches Manual Electrical Digital Data Representation Decimal to Binary (Numbers) Characters and

More information

Technology in Action

Technology in Action Technology in Action Chapter 9 Behind the Scenes: A Closer Look at System Hardware 1 Binary Language Computers work in binary language. Consists of two numbers: 0 and 1 Everything a computer does is broken

More information

7/28/ Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc.

7/28/ Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc Prentice-Hall, Inc. Technology in Action Technology in Action Chapter 9 Behind the Scenes: A Closer Look a System Hardware Chapter Topics Computer switches Binary number system Inside the CPU Cache memory Types of RAM Computer

More information

CS 101, Mock Computer Architecture

CS 101, Mock Computer Architecture CS 101, Mock Computer Architecture Computer organization and architecture refers to the actual hardware used to construct the computer, and the way that the hardware operates both physically and logically

More information

National 5 Computing Science Software Design & Development

National 5 Computing Science Software Design & Development National 5 Computing Science Software Design & Development 1 Stages of Development 2 Analysis 3 Design 4 Implementation 5 Testing 6 Documentation 7 Evaluation 8 Maintenance 9 Data Types & Structures 10

More information

Chapter 4 The Components of the System Unit

Chapter 4 The Components of the System Unit Chapter 4 The Components of the System Unit The System Unit What is the system unit? Case that contains electronic components of the computer used to process data Sometimes called the chassis p. 184 Fig.

More information

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning 3 Data Storage 3.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List five different data types used in a computer. Describe how

More information

Main Memory (RAM) Organisation

Main Memory (RAM) Organisation Main Memory (RAM) Organisation Computers employ many different types of memory (semi-conductor, magnetic disks, USB sticks, DVDs etc.) to hold data and programs. Each type has its own characteristics and

More information

1.1 Information representation

1.1 Information representation Fundamentals of Data Representation: Before we jump into the world of number systems, we'll need a point of reference; I recommend that you copy the following table that you can refer to throughout this

More information

Data Representation 1

Data Representation 1 1 Data Representation Outline Binary Numbers Adding Binary Numbers Negative Integers Other Operations with Binary Numbers Floating Point Numbers Character Representation Image Representation Sound Representation

More information

CC411: Introduction To Microprocessors

CC411: Introduction To Microprocessors CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Use number { base 2, base 10, or base 16 }. Add and subtract binary/hex numbers. Represent any binary number in 2

More information

Segment 1A. Introduction to Microcomputer and Microprocessor

Segment 1A. Introduction to Microcomputer and Microprocessor Segment 1A Introduction to Microcomputer and Microprocessor 1.1 General Architecture of a Microcomputer System: The term microcomputer is generally synonymous with personal computer, or a computer that

More information

Stonelaw High School. Computing Science. BGE - Computer Systems

Stonelaw High School. Computing Science. BGE - Computer Systems Stonelaw High School Computing Science BGE - Computer Systems Contents Computer Systems... 3 Computer Systems... 3 Hardware & Software... 3 Data Representation... 3 Representing Positive Integers... 3

More information

(Refer Slide Time 00:01:09)

(Refer Slide Time 00:01:09) Computer Organization Part I Prof. S. Raman Department of Computer Science & Engineering Indian Institute of Technology Lecture 3 Introduction to System: Hardware In the previous lecture I said that I

More information

Homeschool Enrichment. The System Unit: Processing & Memory

Homeschool Enrichment. The System Unit: Processing & Memory Homeschool Enrichment The System Unit: Processing & Memory Overview This chapter covers: How computers represent data and programs How the CPU, memory, and other components are arranged inside the system

More information

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Dec Hex Bin ORG ; ZERO. Introduction To Computing Dec Hex Bin 0 0 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

More information

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language The x86 Microprocessors Introduction 1.1 Assembly Language Numbering and Coding Systems Human beings use the decimal system (base 10) Decimal digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Computer systems use the

More information

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

CREATED BY M BILAL & Arslan Ahmad Shaad Visit: CREATED BY M BILAL & Arslan Ahmad Shaad Visit: www.techo786.wordpress.com Q1: Define microprocessor? Short Questions Chapter No 01 Fundamental Concepts Microprocessor is a program-controlled and semiconductor

More information

Data Representation From 0s and 1s to images CPSC 101

Data Representation From 0s and 1s to images CPSC 101 Data Representation From 0s and 1s to images CPSC 101 Learning Goals After the Data Representation: Images unit, you will be able to: Recognize and translate between binary and decimal numbers Define bit,

More information

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. Digital Logic 1 Data Representations 1.1 The Binary System The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. The system we

More information

machine cycle, the CPU: (a) Fetches an instruction, (b) Decodes the instruction, (c) Executes the instruction, and (d) Stores the result.

machine cycle, the CPU: (a) Fetches an instruction, (b) Decodes the instruction, (c) Executes the instruction, and (d) Stores the result. Central Processing Unit (CPU) A processor is also called the CPU, and it works hand in hand with other circuits known as main memory to carry out processing. The CPU is the "brain" of the computer; it

More information

Unit - II. Computer Concepts and C Programming 06CCP13. Unit II

Unit - II. Computer Concepts and C Programming 06CCP13. Unit II Computer Concepts and C Programming () Unit II Unit Division Unit-II (6 Hours) Processing Data Storing Data Topics Transforming Data into Information How computers represent data How computers process

More information

Objectives. Connecting with Computer Science 2

Objectives. Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn how numbering systems are used to count Understand the significance of positional value

More information

Standard File Formats

Standard File Formats Standard File Formats Introduction:... 2 Text: TXT and RTF... 4 Grapics: BMP, GIF, JPG and PNG... 5 Audio: WAV and MP3... 8 Video: AVI and MPG... 11 Page 1 Introduction You can store many different types

More information

Memory Addressing, Binary, and Hexadecimal Review

Memory Addressing, Binary, and Hexadecimal Review C++ By A EXAMPLE Memory Addressing, Binary, and Hexadecimal Review You do not have to understand the concepts in this appendix to become well-versed in C++. You can master C++, however, only if you spend

More information

Chapter 4 The Components of the System Unit

Chapter 4 The Components of the System Unit Chapter 4 The Components of the System Unit Chapter 4 Objectives Differentiate among various styles of of system units Differentiate among the the various types of of memory Identify chips, adapter cards,

More information

Example 1: Denary = 1. Answer: Binary = (1 * 1) = 1. Example 2: Denary = 3. Answer: Binary = (1 * 1) + (2 * 1) = 3

Example 1: Denary = 1. Answer: Binary = (1 * 1) = 1. Example 2: Denary = 3. Answer: Binary = (1 * 1) + (2 * 1) = 3 1.1.1 Binary systems In mathematics and digital electronics, a binary number is a number expressed in the binary numeral system, or base-2 numeral system, which represents numeric values using two different

More information

Introduction to Computer Science (I1100) Data Storage

Introduction to Computer Science (I1100) Data Storage Data Storage 145 Data types Data comes in different forms Data Numbers Text Audio Images Video 146 Data inside the computer All data types are transformed into a uniform representation when they are stored

More information

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2010 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review, but we will go over it for

More information

Full file at

Full file at Computers Are Your Future, 12e (LaBerta) Chapter 2 Inside the System Unit 1) A byte: A) is the equivalent of eight binary digits. B) represents one digit in the decimal numbering system. C) is the smallest

More information

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS Microprocessors I Outline of the Lecture Microcomputers and Microprocessors Evolution of Intel 80x86 Family Microprocessors Binary and Hexadecimal Number Systems MICROCOMPUTERS AND MICROPROCESSORS There

More information

System Unit Components Chapter2

System Unit Components Chapter2 System Unit Components Chapter2 ITBIS105 IS-IT-UOB 2013 The System Unit What is the system unit? Case that contains electronic components of the computer used to process data Sometimes called the chassis

More information

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

More information

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved Chapter 1 Data Storage 2007 Pearson Addison-Wesley. All rights reserved Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns

More information

lesson 3 Transforming Data into Information

lesson 3 Transforming Data into Information essential concepts lesson 3 Transforming Data into Information This lesson includes the following sections: How Computers Represent Data How Computers Process Data Factors Affecting Processing Speed Extending

More information

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J. Data Storage Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J. Glenn Brookshear Copyright 2012 Pearson Education, Inc. Data Storage Bits

More information

Chapter 2. Prepared By: Humeyra Saracoglu

Chapter 2. Prepared By: Humeyra Saracoglu Chapter 2 The Components of the System Unit Prepared By: Humeyra Saracoglu The System Unit What is the system unit? Case that contains electronic components of the computer used to process data Sometimes

More information

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU.

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU. HARDWARE hardware ˈhɑːdwɛː noun [ mass noun ] the machines, wiring, and other physical components of a computer or other electronic system. select a software package that suits your requirements and buy

More information

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming Topics C H A P T E R 1 Introduction to Computers and Programming Introduction Hardware and Software How Computers Store Data Using Python Introduction Computers can be programmed Designed to do any job

More information

Chapter 1 Microprocessor architecture ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 1.1 Computer hardware organization 1.1.1 Number System 1.1.2 Computer hardware

More information

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors COMP2121: Microprocessors and Interfacing Introduction to Microprocessors http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 2, 2017 1 1 Contents Processor architectures Bus Memory hierarchy 2

More information

Bits and Bytes. Here is a sort of glossary of computer buzzwords you will encounter in computer use:

Bits and Bytes. Here is a sort of glossary of computer buzzwords you will encounter in computer use: Bits and Bytes Here is a sort of glossary of computer buzzwords you will encounter in computer use: Bit Computer processors can only tell if a wire is on or off. Luckily, they can look at lots of wires

More information

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2011 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review for most of you, but we start

More information

Final Labs and Tutors

Final Labs and Tutors ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South

More information

Computer Organization

Computer Organization Computer Organization It describes the function and design of the various units of digital computers that store and process information. It also deals with the units of computer that receive information

More information

1 Digital tools. 1.1 Introduction

1 Digital tools. 1.1 Introduction 1 Digital tools 1.1 Introduction In the past few years, enormous advances have been made in the cost, power, and ease of use of microcomputers and associated analog and digital circuits. It is now possible,

More information

Common Technology Words and Definitions

Common Technology Words and Definitions Common Technology Words and Definitions 77 78 Common Technology Words and Definitions: ASCII American Standard Code for Information Interchange, a code that makes it possible to send information from one

More information

Computers Are Your Future

Computers Are Your Future Computers Are Your Future 2008 Prentice-Hall, Inc. Computers Are Your Future Chapter 6 Inside the System Unit 2008 Prentice-Hall, Inc. Slide 2 What You Will Learn... Understand how computers represent

More information

Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software

Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software All the parts--monitor, printer, hard drive, etc.-- cables, cabinets, and programs that make a computer

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted

More information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science ã Cengage Learning Objectives After studying this chapter, the student should be able to: q List the three subsystems of a computer. q Describe

More information

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017 Lecture Objectives Introduction to Computing Chapter The AVR microcontroller and embedded systems using assembly and c Students should be able to: Convert between base and. Explain the difference between

More information

Introduction to Computers - Chapter 4

Introduction to Computers - Chapter 4 Introduction to Computers - Chapter 4 Since the invention of the transistor and the first digital computer of the 1940s, computers have been increasing in complexity and performance; however, their overall

More information

Software and Hardware

Software and Hardware Software and Hardware Numbers At the most fundamental level, a computer manipulates electricity according to specific rules To make those rules produce something useful, we need to associate the electrical

More information

Computer Organization & Architecture M. A, El-dosuky

Computer Organization & Architecture M. A, El-dosuky 4.1-storage systems and technology Memory as a Linear Array Computer Organization & Architecture M. A, El-dosuky A byte-addressable memory with N bytes is the logical equivalent of a C++ array, declared

More information

Bits and Bit Patterns

Bits and Bit Patterns Bits and Bit Patterns Bit: Binary Digit (0 or 1) Bit Patterns are used to represent information. Numbers Text characters Images Sound And others 0-1 Boolean Operations Boolean Operation: An operation that

More information

Computers Are Your Future

Computers Are Your Future Computers Are Your Future Twelfth Edition Chapter 2: Inside the System Unit Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall 1 Inside the Computer System Copyright 2012 Pearson Education,

More information

Concept of Memory. The memory of computer is broadly categories into two categories:

Concept of Memory. The memory of computer is broadly categories into two categories: Concept of Memory We have already mentioned that digital computer works on stored programmed concept introduced by Von Neumann. We use memory to store the information, which includes both program and data.

More information

Chapter One. Introduction to Computer System

Chapter One. Introduction to Computer System Principles of Programming-I / 131101 Prepared by: Dr. Bahjat Qazzaz -------------------------------------------------------------------------------------------- Chapter One Introduction to Computer System

More information

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer

More information

What is the typical configuration of a computer sold today? 1-1

What is the typical configuration of a computer sold today? 1-1 What is the typical configuration of a computer sold today? 1-1 Computer Hardware Components In this chapter: How did the computer become known as the stored-program computer? Do they all have the same

More information

Components of a personal computer

Components of a personal computer Components of a personal computer Computer systems ranging from a controller in a microwave oven to a large supercomputer contain components providing five functions. A typical personal computer has hard,

More information

An Overview of the Computer System. Kafui A. Prebbie 24

An Overview of the Computer System. Kafui A. Prebbie 24 An Overview of the Computer System Kafui A. Prebbie -kafui@kafui.com 24 The Parts of a Computer System What is a Computer? Hardware Software Data Users Kafui A. Prebbie -kafui@kafui.com 25 The Parts of

More information

Chapter 2. Data Representation in Computer Systems

Chapter 2. Data Representation in Computer Systems Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

More information

The Memory Component

The Memory Component The Computer Memory Chapter 6 forms the first of a two chapter sequence on computer memory. Topics for this chapter include. 1. A functional description of primary computer memory, sometimes called by

More information

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: Bits and Bytes and Numbers Number Systems Much of this is review, given the 221 prerequisite Question: how high can

More information

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras Numbers and Computers Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras 1 Think of a number between 1 and 15 8 9 10 11 12 13 14 15 4 5 6 7 12 13 14 15 2 3 6 7 10 11 14 15

More information

Input output and memory devices

Input output and memory devices Input output and memory devices One marks 1. What is cache memory The very high speed memory present between CPU and RAM 2. Expand the term OCR Optical Character Recognition (Recognizer) 3. Expand the

More information

Machine Architecture. or what s in the box? Lectures 2 & 3. Prof Leslie Smith. ITNP23 - Autumn 2014 Lectures 2&3, Slide 1

Machine Architecture. or what s in the box? Lectures 2 & 3. Prof Leslie Smith. ITNP23 - Autumn 2014 Lectures 2&3, Slide 1 Machine Architecture Prof Leslie Smith or what s in the box? Lectures 2 & 3 ITNP23 - Autumn 2014 Lectures 2&3, Slide 1 Basic Machine Architecture In these lectures we aim to: understand the basic architecture

More information

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng Slide Set 1 for ENEL 339 Fall 2014 Lecture Section 02 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2014 ENEL 353 F14 Section

More information

Programmable Control. Name Class Teacher. Ellon Academy Technical Faculty

Programmable Control. Name Class Teacher. Ellon Academy Technical Faculty Programmable Control Name Class Teacher Ellon Academy Technical Faculty Learning Intentions o Gain the ability to design and evaluate solutions to engineering problems in a range of contexts o I will gain

More information

How Computer Represents Data?

How Computer Represents Data? Introduction to Computers Chapter No 3 Processing Hardware How Computer Represents Data? Binary Numbers The Binary Number System Bits and Bytes Text Codes ITC - Chapter 3 Processing Hardware 2 1 Binary

More information

Image Types Vector vs. Raster

Image Types Vector vs. Raster Image Types Have you ever wondered when you should use a JPG instead of a PNG? Or maybe you are just trying to figure out which program opens an INDD? Unless you are a graphic designer by training (like

More information

PDF created with pdffactory Pro trial version How Computer Memory Works by Jeff Tyson. Introduction to How Computer Memory Works

PDF created with pdffactory Pro trial version   How Computer Memory Works by Jeff Tyson. Introduction to How Computer Memory Works Main > Computer > Hardware How Computer Memory Works by Jeff Tyson Introduction to How Computer Memory Works When you think about it, it's amazing how many different types of electronic memory you encounter

More information

MARIE: An Introduction to a Simple Computer

MARIE: An Introduction to a Simple Computer MARIE: An Introduction to a Simple Computer Outline Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution. Understand a simple

More information

Memory Study Material

Memory Study Material Computer memory refers to the devices that are used to store data or programs on a temporary or permanent basis for use in a computer. Any data or instruction entered into the memory of a computer is considered

More information

Representing Graphical Data

Representing Graphical Data Representing Graphical Data Chapman & Chapman, chapters 3,4,5 Richardson 1 Graphics in IT82 What does computer graphics cover? IT82 Input, output, and representation of graphical data Creation of graphics

More information

Latches. IT 3123 Hardware and Software Concepts. Registers. The Little Man has Registers. Data Registers. Program Counter

Latches. IT 3123 Hardware and Software Concepts. Registers. The Little Man has Registers. Data Registers. Program Counter IT 3123 Hardware and Software Concepts Notice: This session is being recorded. CPU and Memory June 11 Copyright 2005 by Bob Brown Latches Can store one bit of data Can be ganged together to store more

More information

Diskrečioji matematika

Diskrečioji matematika Diskrečioji matematika www.mif.vu.lt/~algis Basic structures Introduction program euclid (input, output); var x,y: integer; function gcd (u,v: integer): integer; var t: integer; begin repeat if u

More information

Q1. Describe C.P.U and its subunits with the help of diagram?

Q1. Describe C.P.U and its subunits with the help of diagram? Q1. Describe C.P.U and its subunits with the help of diagram? Ans. C.P.U (CENTRAL PROCESSING UNIT) Book page # 27 The C.P.U is the brain of computer.it controls and supervises all the units. Processing

More information

A microprocessor-based system

A microprocessor-based system 7 A microprocessor-based system How simple can a microprocessor-based system actually be? It must obviously contain a microprocessor otherwise it is simply another electronic circuit. A microprocessor

More information

Introduction to Scientific Computing Lecture 1

Introduction to Scientific Computing Lecture 1 Introduction to Scientific Computing Lecture 1 Professor Hanno Rein Last updated: September 10, 2017 1 Number Representations In this lecture, we will cover two concept that are important to understand

More information

Chapter 2: Number Systems

Chapter 2: Number Systems Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many

More information

Q1. Briefly describe the characteristic features of input and output devices of a computer system.

Q1. Briefly describe the characteristic features of input and output devices of a computer system. Q1. Briefly describe the characteristic features of input and output devices of a computer system. Answer-> Characteristic of input and output devices of a computer system: Input Devices: An input device

More information

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation Data Representation II CMSC 313 Sections 01, 02 The conversions we have so far presented have involved only unsigned numbers. To represent signed integers, computer systems allocate the high-order bit

More information

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang

CHAPTER 6 Memory. CMPS375 Class Notes (Chap06) Page 1 / 20 Dr. Kuo-pao Yang CHAPTER 6 Memory 6.1 Memory 341 6.2 Types of Memory 341 6.3 The Memory Hierarchy 343 6.3.1 Locality of Reference 346 6.4 Cache Memory 347 6.4.1 Cache Mapping Schemes 349 6.4.2 Replacement Policies 365

More information

M1 Computers and Data

M1 Computers and Data M1 Computers and Data Module Outline Architecture vs. Organization. Computer system and its submodules. Concept of frequency. Processor performance equation. Representation of information characters, signed

More information

The personal computer system uses the following hardware device types -

The personal computer system uses the following hardware device types - EIT, Author Gay Robertson, 2016 The personal computer system uses the following hardware device types - Input devices Input devices Processing devices Storage devices Processing Cycle Processing devices

More information

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation George Tsiknis University of British Columbia Department of Computer Science Winter Term 2, 2015-2016 Last updated: 04/04/2016

More information

General Computing Concepts. Coding and Representation. General Computing Concepts. Computing Concepts: Review

General Computing Concepts. Coding and Representation. General Computing Concepts. Computing Concepts: Review Computing Concepts: Review Coding and Representation Computers represent all information in terms of numbers ASCII code: Decimal number 65 represents A RGB: (255,0,0) represents the intense red Computers

More information

Lecture 2 Microcomputer Organization: Fig.1.1 Basic Components of Microcomputer

Lecture 2 Microcomputer Organization: Fig.1.1 Basic Components of Microcomputer Lecture 2 Microcomputer Organization: As discussed in previous lecture microprocessor is a central processing unit (CPU) with its related timing functions on a single chip. A microprocessor combined with

More information

Signed umbers. Sign/Magnitude otation

Signed umbers. Sign/Magnitude otation Signed umbers So far we have discussed unsigned number representations. In particular, we have looked at the binary number system and shorthand methods in representing binary codes. With m binary digits,

More information

COPYRIGHTED MATERIAL. An Introduction to Computers That Will Actually Help You in Life. Chapter 1. Memory: Not Exactly 0s and 1s. Memory Organization

COPYRIGHTED MATERIAL. An Introduction to Computers That Will Actually Help You in Life. Chapter 1. Memory: Not Exactly 0s and 1s. Memory Organization Chapter 1 An Introduction to Computers That Will Actually Help You in Life Memory: Not Exactly 0s and 1s Memory Organization A Very Simple Computer COPYRIGHTED MATERIAL 2 Chapter 1 An Introduction to Computers

More information

k -bit address bus n-bit data bus Control lines ( R W, MFC, etc.)

k -bit address bus n-bit data bus Control lines ( R W, MFC, etc.) THE MEMORY SYSTEM SOME BASIC CONCEPTS Maximum size of the Main Memory byte-addressable CPU-Main Memory Connection, Processor MAR MDR k -bit address bus n-bit data bus Memory Up to 2 k addressable locations

More information