You are on page 1of 31

Introduction to Information Technology

Data Representation

Chapter 2

Dr. Khalid S. Rabayah

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

• Digital Documents  Virtual Reality


• Digital Numeric  Digital Communications
Processing  The Internet
• Digital Music  The World Wide Web
• Digital Photography – browsers
• Digital Graphic Arts – web pages/sites
– hypertext
• Digital Television
Advantages of Digital Domain
• Precision: the underlying language of the digital
domain is numbers, and numbers are distinct
and unambiguous
• Efficient storage: represented and stored using
electronic signals
Comparing Storage Media
Page 70 symbols × 50 lines
Book 300 pages
Floppy disk 1.33 books (1.4 million symbols)
CD-ROM 571.4 books (600 million symbols)
Hard Drive 950 books (1 billion symbols)
Advantages of Digital Domain
• Absolute Replication: digital domain can exactly
replicate a copy of the same material
• Not susceptible to deterioration
• Scalability: the quality of the received signal can be
scaled to the characteristics of the receiver rather
than the original source
• Random and Selective Access
• Compression
Analog vs. Digital Information
• natural forms of information are
analog
• analog information is continuous,
e.g., wave
• waveforms are measured by
amplitude and frequency

• digital information is discrete


• analog information may be
digitized, i.e, converted to a
digital representation
• digitized data may be stored
and processed by computers
Analog vs. Digital Information
• Analog signals are continuous • Digital signals are non
electrical signals that vary in continuous,
time. • They change in individual
• The variations follow that of the steps. They consist of
non-electric (original) signal. pulses or digits with
discrete levels or values.
• Analog signals represent some
• a digital clock is capable of
physical quantity and they are a
representing only a finite
‘MODEL’ of the real quantity number of times (every tenth
• A typical analog device is a clock of a second, for example)
in which the hands move
continuously around the face
Analog vs. Digital

Amplitude

Time

Continuous data: all values Discrete Data: Only limited


Are possible number of values are
allowed
9
The numbering systems
• A numbering system can be defined as a way of
representing values and quantities
• The most elegant numeration system, which is still in
use, is the decimal one, which is referred as the
Hindu-Arab numeration, and this system consists of
ten symbols called digits
[0,1,2,3,4,5,6,7,8,9]
• Recently other system
– The octal numbering system (a base eight)
[0,1,2,3,4,5,6,7]
– The hexadecimal (base sixteen)
[0,1,2,3,4,5,6,7,8,9,A,B,C,D,E]
The decimal numbering system
• Consists of ten symbols called digits: 0, 1, 2, 3, 4, 5, 6,
7, 8 and 9.
• Deci means 10 in Latin language
• uses positional or place-value numeration scheme: the
value assigned to a digit depends on its position
Ex. ___________________________
The number 6357 consist of 4 digits
7 occupies the 1´⁵ place
5 occupies the 10´⁵ place
3 occupies the 100´⁵ place
6 occupies the 1000´⁵ place
Which means the number can be expressed as
6357 = 6 × 1000 + 3 × 100 + 5 × 10 + 7 × 1

11
Decimal numbering system

• In decimal numbers the position of each digit is the exponent


(power) to which the base 10 is raised.
• Numbers such as 1, 6, 230 and 1572 are called whole
numbers (integers).
Ex.______________
Consider the number 7216
It can be written as
7 2 1 6
103 102 101 100
This means that: 7216 = 7 × 1000 + 2 × 100 + 1 × 10 + 6 × 1

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
_____________________________

104 103 102 101 100 10-1 10-2 10-3 10-4

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

• Base 2 (convert to All other forms)


• Base 8 (convert to All other forms)
• Base 10 (convert to All other forms)
• Base 16 (convert to All other forms)

• All Arithmetic Operation in Binary Numbering


System

15
Digitization: Analog  Digital conversion
Three typical steps for digitization
• Sampling
• Quantization
• Encoding

16
Sampling

• changing the continuous analog data into


discrete values
Y (a) Analog data Y (b) Sampled data

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

• Text consist of discrete symbols: letters +


numbers+ special characters
• Total number is limited
• No need for sampling or quantization
• The only needed step is coding
• ASCII code: 7 bits per character
• UNI code: 16 bits per character

19
ASCII code
Character Bit pattern Byte Character Bit pattern Byte
number number

A 01000001 65 ¼ 10111100 188


B 01000010 66 . 00101110 46
C 01000011 67 : 00111010 58
a 01100001 97 $ 00100100 36

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

Before sampling and


10111011101 1100010101
Degitizing, there are two
Types of signals ASCII encoder 10001110 1110011 100101
1010101111000 ……
ASCII and analog

Character = 7 bits + 1 bit (extra) = 1 byte


Example: Convert the word “ THINK” in bits
T = 001010
H = 000100
I = 100100
N = 011100
K = 110100

THINK= 001010 000100 100100 011100 110100


ASCII encoder: examples
Encode the word "computer" using the ASCII system.

C O M P U T E R
1100011 1101111 1101101 1110000 1110101 1110100 1100101 1110010

So the word" COMPUTER" is:


1100011 1101111 1101101 1110000 1110101 1110100 1100101 1110010
And this is in computer memory occupies 8 bytes.

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

• images are digitized


using a three step
process
• sampling the
continuous tone image
for pixels
• quantizing pixels
• Encoding
Digitizing Images

• sampling the
continuous tone
image for pixels
• Involves breaking
the image into
small samples

image is sampled by pixel resolution


Digitizing Images: Quantization

pixels are converted to numeric form


Calculation of image size- gray scale image
To calculate the size of an image consider the
following:
• The number color levels  no. of bits used
 16 levels  4 bits/pixel
 64 levels  6 bits/pixel
• Number of pixels in the image depends on the number of
pixels in the x-axis, and number of pixels in y-axes.
 to generate 100 pixel in the x-axes we need 7 bits
 to generate 150 pixel in the y-axes we need 8 bits

Each pixel = Intensity (bits) + x-axes(bits) + y-axes(bits)

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

Location Intensity Intensity Intensity


X Y Red Green Blue

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

• Video consists of successive of still images


(called frames)
• The number of frames taken per second is
called the frames rate or the sampling rate
called Fps
• the film quality depends on two factors:-
– The sampling or frame rate (or fps).
– The size or resolution of the captured image.

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

You might also like