1 / 34

Ch2: Data Representation

Ch2: Data Representation. What is data?. Data is information that has been translated into a form that is more convenient to process. As information take different forms, the most efficient way is to represent all forms of information using a universal format. Data Types. Multimedia.

neola
Télécharger la présentation

Ch2: Data Representation

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. Ch2: Data Representation

  2. What is data? Data is information that has been translated into a form that is more convenient to process As information take different forms, the most efficient way is to represent all forms of information using a universal format.

  3. Data Types Multimedia Engineering programs Video display programs Word processing programs Image processing programs Audio play program

  4. Information coding and decoding • Human senses deal with a variety of information (signals). • Input devices of computer translates these information into electrical signals, why electrical?. • Electrical signals are then translated into universal format (0s,1s), this is known as coding. • After processing, output devices transform back data into their original form, this is known as decoding

  5. Bit Pattern • A bit is the smallest unit of data that the computer deals with. • a bit can take two values (0 or 1). • A two-state electrical switch (transistor) is used to represent a bit (on state →1, off state →0). • To store 16 bits you need 16 switches, to store million bits you need million switches. • In computer memory data are stored as blocks of bits (bit-patterns), the length of bit-patterns is the number of bits in the bit-patterns. • A bit-pattern of 8 bits length is called a byte

  6. Representing Data:1. Text Representation • Written text is made of alphabetical symbols (letters). For example, in English there are 26 uppercase and 26 lowercase symbols. • Each of those symbols is represented by distinctive bit-pattern (code), ex table A1, P337. • Once alphabetical symbols are represented by a bit-pattern, any word that is made of combination of letters can be represented.

  7. Representation of word “BYTE” Ex: 34 Page13

  8. Number of bits in bit-pattern • The number of possible bit-patterns (symbols) made of N number of bits, M is given by: M = 2N • Inversely, the number of bits needed to construct M number of symbols is given by: N= Log2M ≈ 3.2 Log10M (Note: N must be rounded to next bigger integer) • Ex: for M = 26,what is the min number of bits? N= Log2 26 = 3.2 Log1026 = 4.5 = 5 bits

  9. Code systems for text representation • There are about 5 code systems used to represent alphabetical symbols: • ASCII (American Standard Code for Information Interchange) • Extended ASCII • EBCDIC (Extended Coded Decimal Interchange Code) • Unicode (Universal Code) • ISO (International Organization for Standardization)

  10. (1) ASCII • In ASCII codes each code is made of 7 bits. • Number of possible codes M = 27 = 128 codes. • Bit-patterns ranging from 0000000 to 1111111 • The first pattern represents (null character) • The last pattern represents (delete character) • Appendix A

  11. (2) Extended ASCII • Is invented to make the bit-pattern length equal to 8 bits (Byte), by adding a bit to the left of the ASCII code representation. Ex. If ASCII code is 1111111 the extended ASCII code is 01111111. • Extended ASCII is not used because it is not standardized as each manufacturer has different 8-bits system.

  12. (3) EBCDIC • Uses 8 bit patterns → # of codes = 28=256 • Just used in IBM mainframe (system)

  13. (4) Unicode • To represent more languages’ character beside English, Unicode is invented. • Uses 16 bit pattern → # of codes = 216=65536 enough to represent all world’s languages. • Some codes are allocated for geographical and special symbols. • Java uses Unicode, Microsoft uses the first 256 symbols • Appendix B

  14. (5) ISO • ISO uses 32 bit patterns → # of codes = 232=4,294,967,296 symbols enough to represent all world’s symbols.

  15. Representing Data:2. Image Representation Image representation methods

  16. 1. Bitmap Graphic • Image is divided into matrix of pixels. • A pixel represents a dot which is the smallest unit of the image. • Image resolution depends on the number of pixels in the image. • Higher resolution images require larger memory. • Once image is divided into pixels, each pixel is given a bit-pattern. • The pixel bit-pattern determines the color of the pixel

  17. Black & white)) Pixel Color • For black and white images, only two bit-patterns are needed, one to represent a black pixel and the other to represent a white pixel. • In this case, the length of the pattern could be only one bit, i.e. 1 pattern to represent a black pixel and 0 pattern to represent a white pixel. • The rows of patterns are then stored in the memory.

  18. Bitmap graphic method of a black-and-white image

  19. (gray scale) Pixel Color • To represent a gray-scale image of 4 colors (for example) we need to increase the length of bit-pattern representing the pixel to be 2 bits. • In this case 00→ black pixel 01→ dark gray pixel 10→ light gray pixel 11→ white pixel

  20. (colored pixel) Pixel Color • Any visible color could be constructed from the 3 basic colors Red, Green, Blue (RBG) • The difference between one color another depends on the intensity of the RBG colors in the color • Therefore, to represent a colored image, each pixel in the image must be represented by 3 different bit-patterns. Each of them represent the intensity of the basic colors. • The length of a bit pattern representing each basic color is usually 8 bits

  21. Representation of color pixels

  22. 1. Vector Graphic • Image is decomposed into lines and curves. • Each curve and line is represented by a mathematical formula. • The mathematical formula is sorted. • No bit-patterns are stored • For example a line is described by its coordinates, the circle is described by it’s the coordinates of its centre and length of the radius. • The advantage of vector representation is that image can be scaled by multiplying the formula by the scale factor without effecting the image resolution as in bitmap representation

  23. Representing Data:3. Audio Representation • Audio is sound • Sound signal is analog signal • The representation of audio signal requires converting analog signal into digital signal (A/D)

  24. Audio representation

  25. Representing Data:4. Video Representation • Video is a series of images (frame) shown sequentially (one after another) • Thus video data representation is basically the representation of images changed with time. • Video files are multimedia files

  26. Binary Notation • Is a way to write binary numbers • In this way we assign a symbol for multiples of successive bits that makes the binary number • We are going to learn two binary notation systems: • Octal notation: a symbol for 3 bits. • Hexadecimal notation: a symbol for 4 bits.

  27. Decimal numbers • A decimal number is made of digits • A digit takes the value between (0-9) • Each of the digits is multiplied by its weight which is 10 to the power of 0 for the first digit from the right, 1 for the second digit, 2 for the third digit …. etc

  28. Binary numbers • A binary number is made of digits • A digit takes the value of either 0 or 1 • Each of the digit is multiplied by its weight which is 2 to the power of 0 for the first digit from the right, 1 for the second digit, 2 for the third digit …. Etc

  29. Octal Notation • Oct means eight in Greek • In Octal notation, successive 3 bits are given a symbol (0, 1, 2, 3, 4, 5, 6, 7). • In binary to octal transformation, if the number of bits in a bit pattern is not a multiple of three, we fill with 0s added to the lift of bit-pattern to make the total number of bits multiple of three. • Converted octal notation must be distinguished by either: • adding o or O in front of the octal number • Adding subscript 8 to the base of the octal number

  30. Hexadecimal Notation • hexadec means 16 in Greek • In hexadecimal notation, successive 4 bits are given a symbol (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D,E, F). • In binary to hexadecimal transformation, if the number of bits in a bit pattern is not a multiple of four, we fill with 0s added to the lift of bit-pattern to make the total number of bits multiple of four. • Converted hexadecimal notation must be distinguished by either: • Adding x or X in front of the hexadecimal number • Adding subscript 16 to the base of the hexadecimal number

  31. Note • Octal or binary notation is just a way to represent binary numbers (i.e. they are not a numbering systems) • You have to make sure the converted number is always distinguished.

More Related