data representation · data images text videos audio 0101101010100 1010101010101 0101010111010...
TRANSCRIPT
-
DATA
REPRESENTATION
CHAPTER 2
-
2.1 DATA TYPES
-
Different types of data (Fig. 2.1)
The computer industry uses the to define ” MULTIMEDIAterm “
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
-
INSIDEDATA 2 .2
THE COMPUTER
-
DATA
Text Images
Videos Audio
0101101010100
1010101010101
0101010111010
1011010100100
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
uniformdata types are transformed into a All
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
1000101010111111
-
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
0 1 0 1 0 0 1 1
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
-
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
1 2
2 4
3 8
4 16
.
.
.
.
.
.
16 65,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
-
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)
B G R 000000000 000000000 11111111
000000000 11111111 000000000
11111111 000000000 000000000
11111111 11111111 11111111
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
F E D C B A 9 8 7 6 5 4 3 2 1 0
A 4- bit pattern can be represented by a
hexadecimal digit, and vice versa.
-
Hexadecimal
digit
Bit Pattern
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Hexadecimal digits
HEXADECIMAL NOTATION
Hexadecimal
digit
Bit Pattern
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
-
HEXADECIMAL NOTATION
1 1 1 1 1 1 0 0 1 1 1 0 0 1 0 0
F C E 4
1111110011100100 = xFCE4
“x” to show that the representation is in Hexadecimal
-
Example1:
Show the hexadecimal equivalent of the bit pattern
110011100010.
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
7 6 5 4 3 2 1 0
A 3- bit pattern can be represented by an
OCTAL digit, and vice versa.
-
OCTAL digits
OCTAL NOTATION
Hexadecimal
digit
Bit Pattern
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
-
OCTAL NOTATION
1 1 1 1 1 1 0 0 1 1 1 0 0 1 0 0
1 6 3 4
“o” & “0” to show that the representation is in Octal
7 4 o176344
1111110011100100 = 0176344
1763448
-
Example1:
Show the octal equivalent of the bit pattern
101110010.
OCTAL NOTATION
-
Example2:
What is the bit pattern for 248?
OCTAL NOTATION