2 Data Storage
2 Data Storage
Data Storage
by
Kai-Lung Hua
Chapter 1: Data Storage
1-2
1-2
Chapter 1: Data Storage (continued)
1-3
1-3
Bits and Bit Patterns
1-4
1-4
Boolean Operations
1-5
1-5
Figure 1.1 The Boolean operations AND,
OR, and XOR (exclusive or)
1-6
1-6
Gates
1-7
1-7
Figure 1.2 A pictorial representation of AND,
OR, XOR, and NOT gates as well as their input
and output values
1-8
1-8
Flip-flops
1-9
1-9
Figure 1.3 A simple flip-flop circuit
1-10
1-10
Figure 1.4 Setting the output of a
flip-flop to 1
1-11
1-11
Figure 1.4 Setting the output of a
flip-flop to 1 (continued)
1-12
1-12
Figure 1.4 Setting the output of a
flip-flop to 1 (continued)
1-13
1-13
Figure 1.5 Another way of
constructing a flip-flop
1-14
1-14
Hexadecimal Notation
1-15
1-15
Figure 1.6 The hexadecimal coding
system
1-16
1-16
Main Memory Cells
1-17
1-17
Figure 1.7 The organization of a
byte-size memory cell
1-18
1-18
Main Memory Addresses
1-19
1-19
Figure 1.8 Memory cells arranged by
address
1-20
1-20
Memory Terminology
1-21
1-21
Measuring Memory Capacity
1-22
1-22
Mass Storage
1-23
1-23
Mass Storage Systems
• Magnetic Systems
– Disk
– Tape
• Optical Systems
– CD
– DVD
• Flash Drives
1-24
1-24
Figure 1.9 A magnetic disk storage
system
1-25
1-25
Figure 1.10 Magnetic tape storage
1-26
1-26
Figure 1.11 CD storage
1-27
1-27
Files
1-28
1-28
Figure 1.12 Logical records versus
physical records on a disk
1-29
1-29
Representing Text
1-30
1-30
Figure 1.13 The message “Hello.” in
ASCII
1-31
1-31
Representing Numeric Values
1-32
1-32
Representing Images
1-33
1-33
Representing Sound
• Sampling techniques
– Used for high quality recordings
– Records actual audio
• MIDI
– Used in music synthesizers
– Records “musical score”
1-34
1-34
Figure 1.14 The sound wave represented by the
sequence 0, 1.5, 2.0, 1.5, 2.0, 3.0, 4.0, 3.0, 0
1-35
1-35
The Binary System
1-36
1-36
Figure 1.15 The base ten and binary
systems
1-37
1-37
Figure 1.16 Decoding the binary
representation 100101
1-38
1-38
Figure 1.17 An algorithm for finding the
binary representation of a positive integer
1-39
1-39
Figure 1.18 Applying the algorithm in
Figure 1.15 to obtain the binary
representation of thirteen
1-40
1-40
Figure 1.19 The binary addition facts
1-41
1-41
Figure 1.20 Decoding the binary
representation 101.101
1-42
1-42
Storing Integers
1-43
1-43
Figure 1.21 Two’s complement
notation systems
1-44
1-44
Figure 1.22 Coding the value -6 in two’s
complement notation using four bits
1-45
1-45
Figure 1.23 Addition problems converted
to two’s complement notation
1-46
1-46
Figure 1.24 An excess eight
conversion table
1-47
1-47
Figure 1.25 An excess notation system
using bit patterns of length three
1-48
1-48
Storing Fractions
1-49
1-49
Figure 1.26 Floating-point notation
components
1-50
1-50
Figure 1.27 Encoding the value
2 5⁄8
1-51
1-51
Data Compression
1-52
1-52
Compressing Images
1-53
1-53
Compressing Audio and Video
• MPEG
– High definition television broadcast
– Video conferencing
• MP3
– Temporal masking
– Frequency masking
1-54
1-54
Communication Errors
1-55
1-55
Figure 1.28 The ASCII codes for the
letters A and F adjusted for odd parity
1-56
1-56
Figure 1.29 An error-correcting code
1-57
1-57
Figure 1.30 Decoding the pattern 010100
using the code in Figure 1.30
1-58
1-58