Вы находитесь на странице: 1из 40

LESSON ONE

Data Representation

Topics to be discussed

Data types
Number bases
Units of data storage
Media types

OBJECTIVES
By the end of the lesson, students should be able to:

Identify data types


Convert from decimals to binary.
Convert octal and hexadecimal numbers and vice versa.
Explain units of storage
Discuss the media types in representing data.

INTRODUCTION
Data Representation refers to the methods used internally
to represent information stored in a computer. Computers
store lots of different types of information:
Number
Text
Graphics of many varieties (video, animation)
Sound
Various data representation methods are used by the
computer to store ALL types of information internally in the
same format: a sequence of 0s and 1s.

INTRODUCTION
Computers use numeric codes to represent all the
information they store.

Some codes are used for numbers, others for text, and
still others for sound and graphics.

DATA TYPES
Data type is an indicator of the way in which data should
be represented on disk or in RAM.
Three common data types are integers, real numbers and
strings.

Integers are the data types that are used to store


integers or numbers without decimal points. ( 40 , 3,
3476)
Real Numbers, called doubles or floats. These are
numbers represented with a decimal point. Example (1.1,
5.0, 3.1419, - 123434.01, 0.000001)

DATA TYPES
Strings are the data types used to store character,
letters, texts and sentences.

NUMBER BASES
A value of each digit in a number can be determined
using: The position of the digit in the number and the base
of the number system (where base is defined as the total
number of digits available in the number system).

DECIMAL NUMBER
SYSTEM
The number system that we use in our day-to-day life is
the decimal number system. Decimal number system
has base 10 as it uses 10 digits from 0 to 9.Each
position represents a specific power of the base (10).

For example the decimal number 1234 consists of the


digit 4 in the units position, 3 in the tens position, 2 in
the hundreds position, and 1 in the thousand position.

DECIMAL NUMBER
SYSTEM

And
its value can be written as
(1 1000) + (2 100) + (3 10) + (4 1)
1 103 + 2 102 + 3 101 + 4 100
1000
+ 200
+ 30 + 4
1234

DECIMAL NUMBER
SYSTEM
As an ICT student, you should understand the following
number systems which are frequently used in
computers:

Binary Number System, Base 2 Digits used: 0, 1


Octal Number System, Base 8 Digits used : 0 to 7
Hexa Decimal Number System, Base 16; Digits used :
0 to 9 , Letter used : A F

BINARY NUMBER
SYSTEM
Characteristics
Uses two digits, 0 and 1

Also called base 2 number system


Each position in a binary number represents a power of the
base (2)
Example: 20, 21, 23

BINARY NUMBER
SYSTEM
Example
Binary Number: 101012
Calculating Decimal Equivalent:

BINARY NUMBER
SYSTEM
Example
Step

Binary Number

Decimal Number

Step 1

101012

( (1

21) + (1

Step 2

101012

(16 + 0 + 4 + 0 + 1)10

Step 3

101012

2110

24) + (0
2 0) )

23) + (1
10

22) + (0

OCTAL NUMBER SYSTEM


Characteristics

Uses eight digits, 0, 1,2,3,4,5,6,7


Also called base 8 number system
Each position in an octal number represents a power of
the base (8).

Example 80 , 81, 82, 83.

OCTAL NUMBER SYSTEM


Example
Octal Number: 125708

Calculating Decimal Equivalent:

OCTAL NUMBER SYSTEM


Step

Octal

Decimal Number

Step 1

Number
125708

(1

Step 2

125708

80)

Step 3

125708

(4096 + 1024 + 320 + 56 + 0)10

84) + (2

549610

83) + (5

82) + (7

81) + (0

HEXADECIMAL
NUMBER SYSTEM

Characteristics:
Uses 10 digits and 6 letters, 0,1,2,3,4,5,6,7,8,9 etc., A,
B, C, D, E, F.
Letters represents numbers starting from 10.
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
Also called base 16 number system
Each position in a hexadecimal number represents a
power of the base (16). Example 160, 161, 162

HEXADECIMAL
NUMBER SYSTEM
Example:
Hexadecimal Number: 19FDE16
Calculating Decimal Equivalent:

HEXADECIMAL
NUMBER SYSTEM
Step

Hexadecimal

Decimal Number

Number
Step

19FDE16

(1 164) + (9 103) + (F 162) + (D 161) + (E 160)10

19FDE16

(1 164) + (9 103) + (15 162) + (13 161) + (14

Step 2 19FDE
16
Step 3
19FDE16
Step 4

160)10
(65536 + 36864 + 3840 + 208 + 14)10
10646210

NUMBER BASES
There are many methods which can be used to convert
numbers from one base to another. Well demonstrate
here the following:

Decimal to Other Base System


Other Base System to Decimal
Other Base System to Non Decimal

Decimal to other Base System


Steps

Step 1 - Divide the decimal number to be converted by


the value of the new base.

Step 2 - Get the remainder from step 1 as the


rightmost digit (least significant digit) of new base
number.

Divide the quotient of the previous divide by the new


base.

Decimal to other Base


System
Step 4 Record the remainder from step 3 as the next
digit (to the left) of the new base number.
Repeat steps 3 and 4, getting remainders from right to
left, until the quotient becomes zero in step 3.
The last remainder thus obtained will be the Most
Significant Digit (MSD) of the new base number.

Decimal to other Base System


Example
Decimal, Number: 29
Calculating Binary Equivalent

Decimal to other Base


System
Step

Result

14
7

Operation
Remainder
Step 1
29 / 2
Step 2
14 / 2
Step 3
7/2
Step 4
3/2
Step 5
1/ 2

1
0
3

1
1

1
1

Decimal to other Base


System
As mentioned in steps 2 and 4, the remainders have to
be arranged in the reverse order so that the first
remainder becomes the Least Significant Digit (LSD)
and the last remainder becomes the Most Significant
Digit (MSD).

Decimal Number : 2910 = Binary Number : 111012

OTHER BASE SYSTEM TO


DECIMAL SYSTEM
Step 1 Determine the column (positional value of each
digit (this depends on the position of the digit and the
base of the number system)

Step 2 - Multiply the obtained Column value (in Step 1)


by the digits in the corresponding column

Step 3 - Sum the products calculated in step 2. The


total is the equivalent value in decimal.

OTHER BASE SYSTEM


TO DECIMAL SYSTEM
Example
Binary Number: 111012
Calculating Decimal Equivalent:

OTHER BASE SYSTEM


TO DECIMAL SYSTEM
Step
Step
Step
Step
Step
Step
Step

Binary
1
1
2
2
3
3

Number
111012
111012
111012
111012
111012
111012

Decimal Number
( ( 1 24) + (1

23) + (1 22) + (0 21) + (1

20)10
(16 + 8 + 4 + 0 + 1)10
2910

Other Base System to


Non Decimal System
Step 1 - Convert the original number to a decimal

number (base 10).


Step 2 - Convert the decimal number so obtained to
the new base number.
Example
Octal Number: 25
Calculating Binary Equivalent:

Other Base System to


Non Decimal System
Step 1: Convert to Decimal
Octal Number: 258 = Decimal Number:
21
Step
10

Octal Number

Decimal Number

Step
Step 1
1

25
2588

( (2 81) + (5 80) )10

Step
Step 2
2

25
2588

(16 + 5)10

Step 3
3
Step

25
2588

2110

Step 2: Convert Decimal to Binary

Decimal Number: 2110 = Binary :


101012
Step
Operation
Result
Remainder
Number:
25
=
Binary
Number :
Octal
8
21 / 2
10
1
Step 1
Step 2
10101
2

10 / 2

Step 3

5/2

Step 4

2/2

Step 5

1/2

UNITS OF DATA STORAGE


What units of measurement are used for data storage? The

smallest unit of measurement used for measuring data is a


bit. A single bit can have a value of either 0 or 1.
A byte, which is a group of eight bits, is used as the
fundamental unit of measurement for data. 1 byte = 8 bits. A
byte can store 28 or 256 different values, which is sufficient to
represent characters, such as letters, numbers and symbols.
Since most files contain, thousands of bytes, file sizes are
often measured in kilobytes. Larger files such as images,
videos and audio files, containing millions of bytes, and
therefore are measured in megabytes.

UNITS OF DATA
STORAGE

Modern storage devices can store thousands of these


files, which is why storage capacity is typically
measured in gigabytes or even terabytes. Larger units
of measurement are usually reserved for measuring the
sum of multiple storage devices or the capacity of large
data storage networks.

It is important to note that, I kilobyte is 1024 bytes not


1000 bytes. A lowercase b is used as an abbreviation
for bits, while an uppercase B represents bytes.

UNITS OF DATA
STORAGE
Units

Description

Kilobyte (KB)

1 KB = 1024 Bytes

Megabyte (MB)

1 MB = 1024 KB

Giga Byte (GB)

1 GB = 1024 MB

Tera Byte (TB)

1 TB = 1024 GB

Peta Byte (PB)

UNITS OF DATA
STORAGE
Media (medium) is the collective communication tools
that are used to store and deliver data. Some types of
media used in presenting information or data are:

Digital videos
Digital sound
Graphics
Voice over internet protocol
Voice recognition

UNITS OF DATA
STORAGE
How does a computer store graphical data?
Graphics such as photographs and drawings are quite
different from documents that contain numbers and text.
Computers must somehow encode graphics as is 1s and 0s
to be able to store and transmit them. One method
computers use to encode graphics into 0s and 1s is
bitmap.
In this method, the computer examines the graphics, if a
portion is white, it is coded as 1. If the portion is black, it is
coded as a 0. This pattern of 0s and 1s is stored on disk to
represent the graphic.

UNITS OF DATA
STORAGE
How do computers store video data?
A video is composed of a series of frames. Each frame
is a still picture.

This still picture could be represented using the same


techniques as bitmap graphics.

However, video displays 30 frames per second, which


means that digital video requires very large storage
capacity. A two hour movie would require more than
66 gigabytes

UNITS OF DATA
STORAGE
Digital Sound
Computers can record, store, and play back
sounds such as voices and music. Sounds or audio
data can be represented as a waveform. Waveform
audio is a digital representation of sound.
To digitally record sound, samples of the sound
waveform are collected at periodic intervals and
stored as numeric data. Music, voice, and sounds
can all be recorded as waveforms.

UNITS OF DATA
STORAGE
Voice over internet protocol (VOIP)
Voice over internet protocol (VOIP) is a technology
which digitizes the analog voice signal using an encoder.
The digitized data is transmitted as a stream of packets
from the sender to the receiver.
When the packets reach the receiver they are
reassembled and decoded using a decoder. The
decoder constructs the voice signal so that the receiver
can hear what the sender said.

Вам также может понравиться