1 / 55

Computer Systems

Computer Systems. Data Representation Mr Stewart. Data Representation. Types of data which are represented in a computer system include: Numbers Text Graphics. Numbers represented up to 32 Bits. Number Representation. Positive Numbers. People use the decimal or denary system.

lesley-lane
Download Presentation

Computer Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Systems Data Representation Mr Stewart

  2. Data Representation • Types of data which are represented in a computer system include: • Numbers • Text • Graphics

  3. Numbers represented up to 32 Bits

  4. Number Representation

  5. Positive Numbers

  6. People use the decimal or denary system. Decimal means ten, so people count in units, followed by tens, hundreds, thousands and so on. For example, the number 6803 is made up like this: Decimal System This means 6 x 1000 + 8 x 100 + 0 x 10 + 3 x 1.

  7. Binary System Binary system works in a similar way to the Decimal System, except that the binary place values go up in twos, for example: The binary number in the example above is 01001110. This means: 0 x 128 + 1 x 64 + 0 x 32 + 0 x 16 + 1 x 8 + 1 x 4 + 1 x 2 + 1 x 1 which is 79 in decimal.

  8. Converting Decimal to Binary Example: 99 • 128 larger than 99, place 0 • Subtract 64 from 99, leaves 35 and place 1 • Subtract 32 from 35, leaves 3 and place 1 • 16 larger than 3, place 0 • 8 larger than 3, place 0 • 4 larger than 3, place 0 • Subtract 2 from 3, leaves 1 and place 1 • Subtract 1 from 1, leaves 0 and place 1 • Giving 01100011 The easiest way is to write down the place values an the subtract each place value from the number in turn.

  9. Your Task • Convert the following numbers to binary. • 255 • 124 • 8 • 227 • 75 • Convert the binary into decimal numbers. • 00110111 • 11001101 • 11111001 • 10011011 • 10111100

  10. Negative Numbers

  11. Negative Numbers • Representing numbers in a computer system makes it necessary to • store the sign of the number, positive (+) or negative (-). If 16 bits are available, then 15 bits are for the actual number. 1111 1111 1111 1111 to 0111 1111 1111 1111 Or –(215 – 1) to +215 – 1 Or –32767 to +32767 (in decimal) • Where 1 represents the negative sign and 0 represents the positive sign.

  12. Rule: Change all 0s to 1s and vice versa and then add 1. Note that in binary adding 1 and 1 gives 0 and 1 carries on to the next column on the left. So 0 0 0 0 0 1 0 1 or 5 Becomes 1 1 1 1 1 0 1 0 + 1 1 1 1 1 1 0 1 1 or -5 Two’s Compliment Negative numbers are stored using two’s complement representation. So 0 0 0 0 0 1 1 0 or 6 Becomes 1 1 1 1 1 0 0 1 + 1 1 1 1 1 1 0 1 0 or -6 This method uses the msb (most significant bit - the leftmost bit) as a sign bit but includes the sign bit place value in the calculation.

  13. Your Task • Convert the following numbers using twos compliment. • -12 • -67 • -233 • -89 • -119

  14. Real Numbers

  15. Floating Point • A method to store very large and very small numbers which takes up too much memory. • Floating point representation uses a mantissa and an exponent to solve this problem. • The mantissa holds the number and the exponent holds the power (m x basee). • The computer needs only to store the value of the mantissa and the exponent to represent any real numbers.

  16. Place the point at the beginning of the first digit and count the number of places that it has been moved. (The number is written as the power of 10. In this case the point has moved six places). Real Numbers (Decimal) 341, 264.89 .34126489 6 x 10 Mantissa Exponent

  17. Place the point at the beginning of the first digit and count the number of places that it has been moved Binary point has moved four places and the exponent (00000100) is the number 4 in binary. 1101.001101110010 Real Numbers (Binary) .1101001101110010 00000100 x 2 Mantissa Exponent

  18. Mantissa and Exponent • Increasing the number of bytes used for the mantissa will increase the precision of the number being stored. • Increasing the number of bytes used for the exponent will increase the range of the number being stored. .34126489 6 x 10 Exponent Mantissa

  19. Your Task • Represent these numbers using floating point representation. • 23423.272611 • 131324.1112 • 311.272626281 • 11001.00111 • 101.001110 • 11111001.0011

  20. Number Representation Key Points • The internal representation of data in a computer system is in binary. • Types of data which are represented in a computer system include numbers, text and graphics. • Numbers may be stored as integer or floating point (real numbers). • Negative numbers are stored using two’s complement representation. • Floating point in binary use a binary point. • Floating point uses a mantissa and an exponent. • Increasing the number of bytes used for the mantissa will increase the precision of the number being stored. • Increasing the number of bytes used for the exponent will increase the range of the number being stored.

  21. Text Representation

  22. Text Representation • One character = a byte • A character is a symbol or letter on the computer keyboard (includes digits 0 to 9, letters and punctuation marks). • Character set is a list of all the characters which a computer can process and store.

  23. ASCII (American Standard Code for Information Interchange) • Text may be stored as integer values using ASCII. • A seven-bit code that allows 27 or 128 different codes, so ASCII can represent 128 characters. • Many different computers use ASCII to represent text as it is easier for text to be transferred between different computer systems.

  24. Extended ASCII • If more than 128 characters are required, then eight bits can be used, giving 28 or 256 possible characters. This is called extended ASCII. • Allows additional characters, such as accents and special symbols.

  25. Unicode (Universal Character Set) • Designed to represent the writing schemes of all of the world’s major languages. • Unicode is a 16 bit system which can represent 65,536 characters. • The first 128 characters of Unicode are identical to ASCII. This allows for compatibility between Unicode and ASCII.

  26. Unicode V ASCII • The advantages that Unicode has over ASCII is that many more characters (or every possible character) may be represented. • A disadvantage is that Unicode takes up at least twice as much storage space as ASCII (16 bits compared to 8 bits).

  27. Text Representation key points • Text may be stored as integer values using the American Standard Code for Information Interchange (ASCII). • ASCII is a seven-bit code. • A character is a symbol or letter on the computer keyboard. • Control characters control certain operations of the computer system. • Unicode is a 16 bit system which can represent 65, 536 characters. • The advantage that Unicode has over ASCII is that many more characters (or every possible character) may be represented.

  28. Your Task • Open the rep of text worksheet and work your way through the questions • Use the info sheet to help you

  29. Graphic Representation

  30. Bit Depth • Refers to the number of colours used to represent each pixel • 1 bit = 2 colours • 2 bits = 4 colours • 3 bits = 8 colours • …….. • 24 bits = 16 million colours (RGB)

  31. Used for creating/editing realistic images, such as photographs on paint packages. Graphics are made up of tiny dots called pixels. Pixel is short for picture element. Each pixel is represented by 1 bit. Each pixel may be set to ‘on’ or ‘off’ depending on whether the value of the pixel in the computer’s memory is 1 or 0. Bit-mapped Graphics

  32. Resolution • The quality of the picture is determined by the resolution of the graphics available. • The smaller the size of the pixels, the finer the detail that can be displayed on the screen. • Small pixels mean high resolution. • Large pixels mean low resolution.

  33. Advantages: Allows the user to edit at pixel level. Storing a graphic will take the same amount of storage space no matter how complex you make the graphic. Disadvantages: Demand lots of storage, particularly when lots of colours are used. Resizing bit-mapped graphics causes the image to become pixelated and the edges jagged. Individual object cannot be isolated or edited. Bit-mapped Graphics

  34. File Size Calculation Black & White Image 3 x 400 = 1200 4 x 400 = 1600 1600 x 1200 = 3 inches 4 inches 400 dpi (dots per inch)

  35. You do this one Black & White Image 5 inches 7 inches 700 dpi (dots per inch)

  36. File Size Calculation Colour Graphics Colour Image 4 x 400 = 1600 6 x 400 = 2400 1600 x 2400 x 24 = 4 inches 6 inches 400 dpi (dots per inch) 24 bit colour

  37. You do this one Colour Graphic 5 inches 3 inches 700 dpi (dots per inch) 16 bit colour

  38. Calculate File Size • Picture 1 • Pixels across = 768 Pixels down = 640 • Colours = 256 • Picture 2 • Pixels across = 1024 Pixels down = 800 • Colours = 16 • Picture 3 • Pixels across = 768 Pixels down = 780 • Colours = 65,536

  39. Solutions • Picture 1 • 768 x 640 x 8 bits • 3932160 bits/8 • 491520 bytes/1024 = 480Kbytes • Picture 2 • 1024 x 800 x 4 bits • 3276800 bits/8 • 409,600 bytes /1024 = 400 Kbytes • Picture 3 • 768 x 780 x 16 bits • 9584640 bits / 8 • 1198080 bytes / 1024 • 1170 Kbytes/1024 = 1.14 Mbytes

  40. Exam Question • A scanner is set to a resolution of 1200 dpi using 24-bit colour depth and the photographs are 6 inches by 8 inches. Calculate the uncompressed size of the file. Express your answer in appropriate units. Show all working. • 3 marks

  41. Solution • 6 x 8 x 1200 x 1200 x 24 • = 1658880000 bits • = 207360000 bytes • = 202500 kilobytes • = 197.75 megabytes

  42. Conversion To change: • bits to bytes, divide by 8 • bytes to Kilobytes, divide by 1024 • Kilobytes to Megabytes, divide by 1024 • Megabytes to Gigabytes, divide by 1024 • Gigabytes to Terabytes, divide by 1024

  43. Vector Graphics • Draw this in Paint and Serif Draw Plus

  44. Vector Graphics In vector graphics, the system stores mathematical definitions of: • The shape of graphic objects; • Their position on the screen; • Their attributes such as the fill colour, the line colour and thickness. Where there are several objects in an image the vector graphic file will store information about the layering of the objects.

  45. Example of a definition of a circle • The position of the centre. • The length of the radius. • The width and colour of the line marking the circumference. • The colour/pattern of the infill.

  46. Example of a definition of a rectangle • The start and finish position of the four lines marking the sides of the rectangle. • The length of each side. • The thickness of the lines. • The infill colour or pattern.

  47. Disadvantages: Cannot edit individual pixels. A complex graphic with lots of layered objects can demand a lot of storage space. Vector Graphics Advantages: • Edit individual objects in a graphic. • Building up graphics by layering objects. • Less demanding on storage space. • Resizing a vector graphic, changes in proportion and keeps its smooth edges.

  48. Your task • Open the Vector or Bitmaps worksheet

  49. Graphic Representation key points • Graphics may be either bitmapped or vector. • Graphics are made up of tiny dots called pixels. • The quality of the picture is determined by the resolution of the graphic available. • The smaller the size of the pixels, the finer the detail that can be displayed on the screen. • Bit mapped packages paint pictures by changing the colour of the pixels which make up the screen display. • Vector packages work by drawing objects on the screen. • Differences between bitmap and vector: • Overlapping shapes may be separated in vector. • Bit map saves the whole screen. • Bit map resolution is fixed, vector is resolution independent. • Bit map can zoom to show and edit pixels. • Storage requirements of bit map = total number of pixels used in the image * number of bits used to represent colours or shades of grey for each pixel. • True colour is represented on a computer system using 24 bits per pixel, giving a total range of 16, 777, 216 different colours.

  50. Compression

More Related