DATA REPRESENTATION CHAPTER 2
2.1 DATA TYPES
Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information that contains numbers, text, images, audio and video.
If there’re different types of data.. Do we’ve different types of computers for each data type So.. Ex. Is there a computer to process only numbers The Answer is: NO
2.2 DATA INSIDE THE COMPUTER
DATA Text Images Videos Audio COMPUTER Bit The smallest unit of data that can be stored in a computer. it is either 0 or 1 1 = ON 0 = OFF
BIT PATTERN All data types are transformed into a uniform representation when they are stored in a computer and transformed back to their original form when retrieved. This universal representation is called a bit pattern A Bit pattern made of 16 bits
How does a computer memory know what type of data a stored bit pattern represents The Answer is: It Doesn’t It’s the responsibility of input/output devices or programs
Data Coding & Decoding
BYTE Bit Pattern of length 8 = BYTE Bytes used to measure the size of memory or other storage.
2.3 REPRESENTING DATA
Represent each symbol with bit pattern TEXT
How many bit patterns we need to represent the ENGLISH letters The Answer is: 52 bit patterns 26- Uppercase Letters 26- Lowercase Letters
TEXT If we’ve an Imaginary language that uses ONLY 4 symbols. What is the bit pattern length we need to represent this language The Answer is: bit pattern of length 2
TEXT Bit pattern length# of Symbols ,536
TEXT Different sets of bit patterns have been designed to represent text symbols Each set is called a CODE
ASCII: The American standard code for information interchange. use 7 bit for each symbol Extended ASCII To make the size of each pattern 1 byte ( 8 bits) EBCDIC : Extended binary coded decimal interchange code. Only IBM main frames. Uses 8 bits pattern Unicode uses 16 bits. To represent more symbols for other languages not just English ISO International Organization for Standardization Has designed a code using 32bit pattern Examples of CODES
Representing of the word “BYTE” in ASCII code
Numbers are representing using the binary system before being stored in the computer memory. as described in Chapter 3. NUMBERS
Image representation methods Vector Bitmap IMAGES Image divided into a matrix of PIXELS ( picture elements ) where each pixel is small dot An image is decomposed into a combination of CURVES and LINES.
Bitmap IMAGES Example of representing a black & white image using bitmap method
Bitmap IMAGES Representation of color pixels using bitmap method (8 bit pattern) BGR RED GREEN BLUE WHITE
Vector IMAGES An image is decomposed into a combination of curves and lines. Each line or curve represented by a mathematical formula. Ex. Representing a LINE by the coordinates of it’s end points
IMAGES Which one is better.. Bitmap method OR Vector method
VIDEOS Is a representation of images (called FRAMES) in time. A Movie is a series of frames shown one after another to create the illusion of motion
If you want to manipulate bit patterns. Is it easy for you to write & remember a long stream of 0's &1's The Answer is: NO That’s why we use Hexadecimal OR Octal notations
2.4 HEXADECIMAL NOTATION
HEXADEC = 16 IN Greek So.. There are 16 symbols: HEXADECIMAL NOTATION FEDCBA A 4- bit pattern can be represented by a hexadecimal digit, and vice versa.
Hexadecimal digit Bit Pattern A1010 B1011 C1100 D1101 E1110 F1111 Hexadecimal digits HEXADECIMAL NOTATION Hexadecimal digit Bit Pattern
HEXADECIMAL NOTATION FCE = xFCE4 “x” to show that the representation is in Hexadecimal
Example1: Show the hexadecimal equivalent of the bit pattern HEXADECIMAL NOTATION
Example2: What is the bit pattern for x24C? HEXADECIMAL NOTATION
2.5 OCTAL NOTATION
OCT= 8 IN Greek So.. There are 8 symbols: OCTAL NOTATION A 3- bit pattern can be represented by an OCTAL digit, and vice versa.
OCTAL digits OCTAL NOTATION Hexadecimal digit Bit Pattern
OCTAL NOTATION “o” & “0” to show that the representation is in Octal 74 o =
Example1: Show the octal equivalent of the bit pattern OCTAL NOTATION
Example2: What is the bit pattern for 24 8 ? OCTAL NOTATION