DATA
DATA STORAGE STORAGE DATA
DATA STORAGE STORAGE
CHAPTER III CHAPTER III
LECTURE I LECTURE I LECTURE I LECTURE I
Week
Week 4 4
Data Storage Data Storage
Data in computer represent in different
Data in computer represent in different forms including numbers, text, audio, image and forms including numbers, text, audio, image and
id id video.
video.
In a computer industry we use the term
In a computer industry we use the term
"multimedia" to define information that contains
"multimedia" to define information that contains
"multimedia" to define information that contains
"multimedia" to define information that contains number, text, images, audio and video.
number, text, images, audio and video.
Data Inside The Computer Data Inside The Computer Data Inside The Computer Data Inside The Computer
All data types are transformed into a uniform All data types are transformed into a uniform representation When they are stored in a
representation When they are stored in a representation. When they are stored in a representation. When they are stored in a
computer and transformed back to their original computer and transformed back to their original
Bit Pattern Bit Pattern
Bit (binary digit) is the smallest unit of data that Bit (binary digit) is the smallest unit of data that can be stored in a computer and has the value
can be stored in a computer and has the value 0 p p 0 and
and 1 1
Bit patterns to represent different types of data Bit patterns to represent different types of data Bit patterns to represent different types of data, Bit patterns to represent different types of data, we use a bit pattern, a sequence of bits or
we use a bit pattern, a sequence of bits or string of bits
string of bits string of bits.
string of bits.
1000010111111 1000010111111 Example
Example
Bit tt / t i f bit
Bit tt / t i f bit
Bit pattern/string of bit
Bit pattern/string of bit
To store this bit pattern we need sixteen electronic To store this bit pattern we need sixteen electronic switches, by tradition a bit pattern with eight bits is switches, by tradition a bit pattern with eight bits is
called a byte. Some times the term word is used to refer called a byte. Some times the term word is used to refer called a byte. Some times the term word is used to refer called a byte. Some times the term word is used to refer to a longer bit pattern
to a longer bit pattern
A number
A number 6565 0100000101000001
A number A number
Math routine Memory Math routine Memory A character
A character Typed on Typed on
01000001 01000001 65
65 programprogram
‘A’ programprogram 0100000101000001
Keyboard Text Editor Memory Keyboard Text Editor Memory Part of an
Part of an
Image Image Recorder Memory
Image Image Recorder Memory
p og a
p og a 0 000000 00000
program
program 0100000101000001
Image Image Recorder Memory Image Image Recorder Memory Part of
Part of
Music Music recorder
Music Music recorder MemoryMemory
program
program 0100000101000001
y y
Storing Data In Computer Storing Data In Computer Storing Numbers
Storing Numbers g g
A number is changed to the A number is changed to the binary system before storing it in a computer binary system before storing it in a computer y y y y g g p p memory. Two issues need to be handled when memory. Two issues need to be handled when we store numbers in a computer.
we store numbers in a computer.
a) How to store the sign of the number a) How to store the sign of the number ) ) g g b) How to show the decimal point.
b) How to show the decimal point.
How to show the decimal point, the computer uses two How to show the decimal point, the computer uses two
diff i
diff i
different representations.
different representations.
1
1) Fixed) Fixed--point where the number is stored as an integer. point where the number is stored as an integer.
(N b ith t f ti l t) lik
(N b ith t f ti l t) lik 123123 143143 (Number without a fractional part) like
(Number without a fractional part) like 123123, , --143143…… etc.
etc.
2
2) Floating point representation) Floating point representation hich is sed to storehich is sed to store 2
2) Floating point representation which is used to store ) Floating point representation which is used to store the number as a real with a fraction like
the number as a real with a fraction like 134134..2323, , -- 0
0 2323……etcetc 0
0..2323……etc.etc.
Integer number may be stored as a real number with the Integer number may be stored as a real number with the fractional set to zero
fractional set to zero
1 1 1
1 0
0 0
0 0
0 1
1 1
1 0
0 1
1 1
1 0
0
We may store number that is too larger than the We may store number that is too larger than the memory location.
memory location.
Example: to store
Example: to store 258258, first change to binary , first change to binary ((100000010100000010))2 2
Memory location Memory location