Download presentation
Presentation is loading. Please wait.
Published byBonnie Watkins Modified over 9 years ago
1
1 Problem Solving using Computers “Data....Representation, and Storage
2
2 Data Representation & Storage Types of DATA What are the different types of data, that may be encountered in computational problems? –Text (sequences of characters to represent/store names, descriptions, etc.) –Numeric (to represent/store different quantities, e.g. age, length, height, amount of money, growth rates, etc.) –Image (to represent/store photographic or synthesized pictures). –Audio (to represent/store audio signals of humans and otherwise). –Video (to represent/store video signals).
3
3 Data Representation & Storage What are the basic operations defined on each data type? –Text (extracting characters, concatenating characters together, comparing characters). –Numeric (doing +,-,*, , comparison among other operations). –Audio (manipulate pitch, amplitude (volume), high/low frequencies in an audio signal). –Image (manipulating pixels properties, e.g. color).
4
4 Data Representation & Storage Text Data The building blocks of any text data is the character. Characters can be divided into –Letters (a-z, and A-Z) –Digits (0,1,…9) –Special Characters (for example., !,@,#,$,..) But, if I told you that the only characters that can appear in text data are the 26 upper case letters, can you develop an encoding scheme using bits to encode these characters?
5
5 Data Representation & Storage Encoding Upper case letters using bits SLACK CODES (UNUSED)
6
6 Data Representation & storage Representing Text ;The ASCII code A standard set of characters were agreed upon as the set of all possible characters that are allowed to appear in text data (see few slides back). A standard bit code was set for these characters. This is called the ASCII (American Standard code for Information Interchange) code. ASCII code is an 8-bit code scheme (originally was 7-bit). The letter ‘A’ in ASCII code for example is given the code 1000001, code for ‘B’ in ASCII is 1000010. The code for a space character ‘ ‘ is 0010000.
7
7 Data Representation & storage ASCII code Facts Originally a 7–bit code, why? –Because ANSI identified a standard set of 128 characters (including letters, digits, symbols and special control characters) that any computer must be able to represent; –7 bits are enough to provide 128 distinct bit patters codes – prove. –Any text stored by the computer cannot contain other than these 128 characters. Now ASCII is an 8-bit code why? –This creates additional 128 codes that can be assigned to user-defined characters, e.g. for accommodating letters from other languages (Arabic, French, German, etc…)
8
8 This slide depicts two views of a file called simple.txt. The file contains text data. The first view is as seen in an editor (notepad). The second view shows the ASCII code of each character in the file How many characters does the file contain? How many of these are letters? Character W (highlighted) ASCII code of character W (57 hexadecimal = 01010111 in binary
9
9 Data Representation & storage ASCII code Exercise If the following bits are interpreted as characters encoded in the ASCII code, write down the corresponding characters. 0100 0001 0101 0011 0100 0011 0100 1001 0100 1001 Write down ASCII code (bits) for the following text: How are you?
10
10 Data Representation & storage Unicode, ISO 32-bit Is the ASCII code enough? –No, think about the representation of Chinese or Japanese language text (thousands of symbols); Unicode –A 16-bit coding scheme (allows how many characters?) –Developed by a consortium of manufacturers of hardware and software.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.