Data Formats Lecture Notes PDF

Summary

These lecture notes cover data formats, including different types of data, their representations, and how computers handle data (e.g., binary). The information is structured to explain the importance of data formats in various applications, such as image, audio, and video.

Full Transcript

DATA FORMATS COMPROG OBJECTIVES Understand the importance and role of data formats in computing. Identify and describe common data formats. Select appropriate data formats for different use cases. Demonstrate basic knowledge of how to read and write data in various formats. DATA FORM...

DATA FORMATS COMPROG OBJECTIVES Understand the importance and role of data formats in computing. Identify and describe common data formats. Select appropriate data formats for different use cases. Demonstrate basic knowledge of how to read and write data in various formats. DATA FORMATS DATA FORMATS Data formats are essential for storing, transmitting, and interpreting data in computer systems. They define how data is structured, encoded, and presented, ensuring that information can be consistently understood and processed by different systems and applications. COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS Computers - Process and store all forms of data in binary format Human communication - Includes language, images and sounds Data formats: - Specifications for converting data into computer-usable form - Define the different ways human data may be represented, stored and processed by a computer. COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS SOURCES OF DATA: COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS COMMON DATA REPRESENTATIONS COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS Alphanumeric Characters Importance of Alphanumeric Data 1. Identification: Used in IDs, passwords, and Alphanumeric characters are a usernames to ensure uniqueness. combination of alphabetic and 2. Communication: Essential in textual communication, numeric characters. including emails, documents, and coding. These include: 3. Data Entry: Forms and databases often require Alphabetic Characters: alphanumeric input to capture meaningful Letters (A-Z, a-z) information. Numeric Characters: 4. Coding and Programming: Source code comprises Digits (0-9) alphanumeric characters, making it a fundamental part of software development. DATA FORMATS Other Alphanumeric Input OCR (optical character reader) Scans text and inputs it as character data Used to read specially encoded characters Example: magnetically printed check numbers General use limited by high error rate Bar Code Readers Used in applications that require fast, accurate and repetitive input with minimal employee training Examples: supermarket checkout counters and inventory control Alphanumeric data in bar code read optically using wand DATA FORMATS Other Alphanumeric Input Magnetic stripe reader: alphanumeric data from credit cards Voice -Digitized audio recording common but conversion to alphanumeric data difficult -Requires knowledge of sound patterns in a language (phonemes) plus rules for pronunciation, grammar, and syntax DATA FORMATS Representing Characters: 1. ASCII - most widely used coding scheme Developed by ANSI (American National Standards Institute) Represents -Latin alphabet, Arabic numerals, standard punctuation characters -Plus small set of accents and other European special characters ASCII -7-bit code: 128 characters COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS 2. EBCDIC: IBM mainframe (legacy) Extended Binary Coded Decimal Interchange Code developed by IBM Restricted mainly to IBM or IBM compatible mainframes Conversion software to/from ASCII available Common in archival data Character codes differ from ASCII COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS 3. Unicode: developed for worldwide use Most common 16-bit form represents 65,536 characters ASCII Latin-I subset of Unicode -Values 0 to 255 in Unicode table Multilingual: defines codes for -Nearly every character-based alphabet -Large set of ideographs for Chinese, Japanese and Korean -Composite characters for vowels and syllabic clusters required by some languages Allows software modifications for local-languages COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS IMAGE DATA Photographs, figures, icons, drawings, charts and graphs Two approaches: Bitmap or raster images of photos and paintings with continuous variation Object or vector images composed of graphical objects like lines and curves defined geometrically Differences include: Quality of the image Storage space required Time to transmit Ease of modification Specifications for graphics file formats COMPUTER ORGANIZATION AND ARCHITECTURE The Graphics File Format Page DATA FORMATS BITMAP IMAGES Each individual pixel (pi(x)cture element) in a graphic stored as a binary number Pixel: A small area with associated coordinate location Example: each point below represented by a 4-bit code corresponding to 1 of 16 shades of gray COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS BITMAP DISPLAY COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS STORING BITMAP DISPLAY Frequently large files Example: 600 rows of 800 pixels with 1 byte for each of 3 colors ~1.5MB file File size affected by Resolution (the number of pixels per inch) Amount of detail affecting clarity and sharpness of an image Levels: number of bits for displaying shades of gray or multiple colors Palette: color translation table that uses a code for each pixel rather than actual color value COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS GIF (Graphics Interchange Format) First developed by CompuServe in 1987 GIF89a enabled animated images Allows images to be displayed sequentially at fixed time sequences Color limitation: 256 Image compressed by LZW (Lempel-Ziv-Welch) algorithm Preferred for line drawings, clip art, and pictures with large blocks of solid color COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS JPEG (Joint Photographers Expert Group) Allows more than 16 million colors Suitable for highly detailed photographs and paintings Employs lossy compression algorithm that: - Discards data to decrease file size and transmission speed - May reduce image resolution and distort sharp lines COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS OBJECT IMAGES Created by drawing packages or output from spreadsheet data graphs Composed of lines and shapes in various colors Computer translates geometric formulas to create the graphic Storage space depends on image complexity: Number of instructions to create lines, shapes, fill patterns Movies Shrek and Toy Story use object images COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS OBJECT IMAGES Created by drawing packages or output from spreadsheet data graphs Composed of lines and shapes in various colors Computer translates geometric formulas to create the graphic Storage space depends on image complexity: Number of instructions to create lines, shapes, fill patterns Movies Shrek and Toy Story use object images COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS Popular Object Graphics Software Most object image formats are proprietary Macromedia Flash: - Low-bandwidth animation Micrographx Designer: - Technical drawings to illustrate products CorelDraw: - Vector illustration, layout, bitmap creation, image-editing, painting, and animation software Autodesk AutoCAD: - For architects, engineers, drafters, and design-related professionals W3C SVG (Scalable Vector Graphics): - Based on XML Web description language COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS VIDEO IMAGES Require massive amount of data Video camera producing full screen 640 x 480 pixel true color image at 30 frames/sec 27.65 MB of data/sec 1-minute film clip 1.6 GB storage Options for reducing file size: decrease size of image, limit number of colors, reduce frame rate Method depends on how video delivered to users Streaming video: video displayed as it is downloaded from the Web server Example: video conferencing Local data (file on DVD or downloaded onto system) for higher quality MPEG-2: movie quality images with high compression require substantial processing capability COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS AUDIO DATA Transmission and processing requirements less demanding than those for video Waveform audio: digital representation of sound MIDI (Musical Instrument Digital Interface): instructions to recreate or synthesize sounds Analog sound converted to digital values by A-to-D converter COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS AUDIO FORMAT MP3 Derivative of MPEG-2 (ISO Moving Picture Experts Group) Uses psychoacoustic compression techniques to reduce storage requirements Discards sounds outside human hearing range: lossy compression WAV Developed by Microsoft as part of its multimedia specification General-purpose format for storing and reproducing small snippets of sound COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS DATA COMPRESSION Compression: recoding data so that it requires fewer bytes of storage space. Compression ratio: the amount file is shrunk Lossless: inverse algorithm restores data to exact original form -Examples: GIF, PCX, TIFF Lossy: trades off data degradation for file size and download speed - Much higher compression ratios, often 10 to 1 - Example: JPEG - Common in multimedia MPEG-2: uses both forms for ratios of 100:1 COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS INTERNAL COMPUTER DATA FORMAT All data stored as binary numbers Interpreted based on - Operations computer can perform - Data types supported by programming language used to create application COMPUTER ORGANIZATION AND ARCHITECTURE DATA FORMATS 5 Simple Data Types 1. Boolean: 2-valued variables or constants with values of true or false 2. Char: Variable or constant that holds alphanumeric character 3. Enumerated / User-defined data types with possible values listed in definition Example: Type DayOfWeek = Mon, Tues, Wed, Thurs, Fri, Sat, Sun 4. Integer: positive or negative whole numbers 5. Real -Numbers with a decimal point -Numbers whose magnitude, large or small, exceeds computer’s capability to store as an integer COMPUTER ORGANIZATION AND ARCHITECTURE END OF SLIDES THANK YOU!

Use Quizgecko on...
Browser
Browser