Data Representation
Data Representation
Data Representation
Chapter 2
1
The Digital Domain
In this chapter you will learn about...
• the nature of the digital domain
• distinguishing analog vs. digital media
• the advantages of digital media
• the universal language of computers:
binary encoded data
• how information is converted to digital
(binary) form
2
?What is the Digital Domain
• computers process
discrete or digital data
• data is represented by a
digital symbol system
• all forms of information
must be converted to a
digital form for processing
The Digital Evolution
Some Applications
Amplitude
Time
11
Decimal numbering system
12
Decimal numbering system
• Decimal numbers can also be used to represent values less than 1 called a
fraction. The value assigned to each digit in a fraction is again determined
by its position in the number.
Ex. _________________________
0.132 = 1 × ( 1/10 ) + 3 × ( 1/100 ) + 2 × ( 1/1000 )
= 0.1 + 0.03 + .002
0.7528 = 7 × 10 -1 + 5 × 10 -2 + 2 × 10 -3 + 8 × 10 -4
= 0.7 + 0.05 + 0.002 + 0.0008
_____________________________
Decimal point
13
Binary Math
Concept of carry
Concept of borrow
Consider 65 – 48
Consider 193 + 58, Borrow 1 from 6 to let 5 becomes
Carry 1 from 11, to put it over 9, and .15, which left 5 instead of 6
carry 1 from 15, to put it over 1,
and add. 5 6 15
4 8-
1 1
1 9 3 1 7
5 8
2 5 1
14
Numbering Systems
15
Digitization: Analog Digital conversion
Three typical steps for digitization
• Sampling
• Quantization
• Encoding
16
Sampling
time time
17
Quantization& coding
Y
Quantization means that the 111
samples generated in the 110
past step are assigned 101
numeric values from an
100
established scale consisting
011
of quantization levels that are
determined by the number of 010
bits in the system. 001
000
001
Y a) Analog data
Analog
001
To
001
Digital
010
Convert
time 100
18
Digitizing text
19
ASCII code
Character Bit pattern Byte Character Bit pattern Byte
number number
b 01100010 98 \ 01011100 92
o 01101111 111 ~ 01111110 126
p 01110000 112 1 00110001 49
q 01110001 113 2 00110010 50
r 01110010 114 9 00111001 57
x 01111000 120 © 10101001 169
y 01111001 121 > 00111110 62
z 01111010 122 ‰ 10001001 137
20
Character representations:Ascii
American Standard Code for Information Interchange
C O M P U T E R
1100011 1101111 1101101 1110000 1110101 1110100 1100101 1110010
Translate the following ASCII code into text.:1100111 1101111 1101111 1100100
By looking into the table we found that
1100111: g
1101111: o
1101111: o
1100100: d
So the word is “good”.
22
Example1: Digitizing Images
• sampling the
continuous tone
image for pixels
• Involves breaking
the image into
small samples
26
Example
Suppose we have an image consists of 100 by 150 pixels and
there are 50 levels of color intensities. Calculate the image
size.
Solution:
• Color Intensity needs 6 bits since that is needed to generate
50 levels Intensity bits = 6 bits/pixel
• Total number of pixels = 100x 150 = 15000 pixels
The image size = number of pixels x bits/ pixels
15000 x 6 = 90000 bits = ? Kbits
27
Colored image
Consider the color theory:
Any color can be generated by mixing three
basic colors: Green + Red + Blue
Therefore each pixel needs
I(G) + I(R) + I(B) + X + Y
28
Colored image- example
Suppose a colored image consists of 900 × 600 pixel where locations are represented by
10-bits each, and there are 512 different color levels. How much storage capacity is
needed to store that image in a computer hard disk?
Solution:
Total number of pixels = 54,0000 = 5.4 × 10 5
Locations need = 20 bites
512 levels mean 9-bites for intensity of each color.
Therefore each pixel needs = 20 + 9 × 3 = 47 bits.
Total number of bites = 5.4 × 10 5 × 47
= 2.538 × 107
= 25.38 × 106 bites
= (2.538 × 107) / (8 bits/byte)
= 3.1725 × 106 bytes
= 3.17 Mbytes (2 floppy disks).
29
Digitizing video
30
Digitizing video-example
Calculate how much storage capacity is needed to store a high quality colored
film of 1 hour recorded at 24 fps with a resolution of 600 x 800 pixels where
each pixel costs 4 bytes.
Solution: Using the same principles as in the previous section, each image
contains 48,0000 pixel = 4.8 x 105 pixels.
Each pixel needs 4 bytes
Each image needs = 4.8 ×10 5 × 4 = 1.9 × 10 6 = 1.9 Mbytes
Now we need to calculate how many frames are needed for 1 hour show,
Total no. of frames = 1 hour × 60 min × 60 sec × 24 fps
= 8.64 × 104 Frames
But each frame needs 1.9 Mbytes
Total storage capacity = 8.64 × 10 4 × 1.9 Mbytes
= 7.465 × 10 5 Mbytes
31