110 likes | 249 Views
Data Representation and Machine Concepts. Computer SCIENCE. Section 1.4. Instructor: Lin Chen. August 2013. 1 Data Storage. 1.4 Representing Information. Representing Text Representing Numeric Values Representing Images Representing Sound.
E N D
Data Representation and Machine Concepts Computer SCIENCE Section 1.4 Instructor: Lin Chen August 2013
1 Data Storage 1.4 Representing Information Representing Text Representing Numeric Values Representing Images Representing Sound Pearson Custom: Computer Science, Data Representation and Machine Concepts
1 Data Storage 1.4 Representing Text Use bits to represent text ASCII uses 7 bits to represent the letter, number and some control information http://en.wikipedia.org/wiki/ASCII
1 Data Storage 1.4 Representing Text Use bits to represent text ASCII uses 7 bits to represent the letter, number and some control information Today, ASCII had extended to 8 bit pattern by add 0 at the most significant end H 1001000 01001000 Question: How many characters could be represented by 7 bit ASCII strategy
1 Data Storage 1.4 Representing Text Unicode Use 16 bits to represent each symbol Chinese, Japanese, and Hebrew can be represented ISO pattern Use 32 bits to represent each symbol Question: Convert “Hello World!” to binary number with Unicode pattern Question: How many characters could be represented by ISO pattern http://en.wikipedia.org/wiki/List_of_Unicode_characters
1 Data Storage 1.4 Representing Numeric Value Why not use the method for text? Negative number 1.6 Floating-point number 1.7
1 Data Storage 1.4 Representing Image Image files are composed of digital data in one of these formats that Can be rasterized for use on a computer display or printer Pixel Image is a collection of dots, each dot is called a pixel Raster formats Data describes the characteristics of each individual pixel JPEG, TIFF, GIF, BMP, PNG Vector formats Contain a geometric description which can be rendered smoothly at any desired display size CGM, SVG http://en.wikipedia.org/wiki/Image_file_formats
1 Data Storage 1.4 Representing Image Approaches with raster formats RGB Each pixel is represented as three primary color components, red, green, and blue. Each primary color is represented with a integer 0-255 RGB(0, 0, 0) RGB(255, 0, 0) RGB(0, 255, 0) RGB(0, 0, 255) RGB(0, 255, 255)
1 Data Storage 1.4 Representing Image Audio file A sequential values Each value represents a sound wave in amplitude Usually 8000 samples per second High quality music take 44,100 sample per second
1 Data Storage 1.4 Representing Image Disadvantages of raster format Can not be rescaled to any arbitrary size
1 Data Storage 1.4 Representing Sound Disadvantages of raster format Can not be rescaled to any arbitrary size