Chapter 6 - Memory and Data Storage
Chapter 6 - Memory and Data Storage
CHAPTER No. 6
Storage Devices
1
Teacher’s Name: Akhtab Hussain
Contents
6. Memory and Data Storage 4
6.1 File Format 4
Types of File Formats 4
6.1.1 Musical Instrument Digital Interface (MIDI) 4
6.1.1.1 MIDI File 4
6.1.1.2 Playback 4
6.1.1.3 MIDI Interface 5
6.1.1.4 Advantages 5
6.1.1.5 Disadvantage 5
6.1.1.6 Applications 5
6.1.2 MPEG-3 (MP3) 5
6.1.2.1 Applications 5
6.1.2.2 Conversion Method 6
6.1.2.3 Points to Remember 6
6.1.3 MPEG-4 (MP4) 6
6.1.4 Joint Photographic Experts Group (jpeg) files 6
6.1.4.1 Types of JPEG 6
6.1.4.2 Applications of JPEG 6
6.1.4.3 Where we can’t use JPEG 6
6.1.5 Text and number file formats 7
6.1.5.1 Text File Compression 7
6.2 Lossless and lossy file compression 8
6.2.1 Lossless file compression 8
6.2.2 Lossy file compression 8
6.3 Memory and storage 8
6.3.1 Primary memory 8
6.3.1.1 Random Access Memory (RAM) 8
6.3.1.2 Read Only Memory (ROM) 11
6.3.2 Secondary storage 11
6.3.2.1 Hard Disk Drives (HDD) 11
2
Teacher’s Name: Akhtab Hussain
3
Teacher’s Name: Akhtab Hussain
4
Teacher’s Name: Akhtab Hussain
5
Teacher’s Name: Akhtab Hussain
be heard by the ear, so the softer sound is eliminated. This means that certain parts of the
music can be removed without affecting the quality too much.
6.1.2.3 Points to Remember
i. MP3 files use what is known as a LOSSY FORMAT since part of the original
file is lost following the compression algorithm.
ii. Original file can’t be put back together again.
iii. The quality of MP3 files can be different since it depends on the BIT RATE –
this is the number of bits per second used when creating the file.
iv. Bit rates are roughly between 80 and 320 kilobits per second
v. Usually 200 or higher gives a sound quality close to a normal CD.
6.1.3 MPEG-4 (MP4)
MPEG-4 (MP4) format allows the storage of multimedia files rather than just
sound. Music, videos, photos and animation can all be stored in the MP4 format. Videos,
for example, could be streamed over the internet using the MP4 format without losing
any real discernable quality.
6.1.4 Joint Photographic Experts Group (jpeg) files
“JPEG is a commonly used method of lossy compression for digital images,
particularly for those images produced by digital photography.”
The degree of compression can be adjusted, allowing a selectable tradeoff
between storage size and image quality. JPEG typically achieves 10:1 compression with
little perceptible loss in image quality.
6.1.4.1 Types of JPEG
JPEG compression is used in a number of image file formats.
i) JPEG/Exif is the most common image format used by digital cameras and other
photographic image capture devices
ii) JPEG/JFIF, it is the most common format for storing and transmitting
photographic images on the World Wide Web. JPEG/JFIF supports a maximum
image size of 65,535×65,535 pixels, hence up to 4 giga-pixels for an aspect
ratio of 1:1.
⮚ These format variations are often not distinguished, and are simply called JPEG
6
Teacher’s Name: Akhtab Hussain
ii) As the typical use of JPEG is a lossy compression method, which somewhat reduces the
image fidelity, it should not be used in scenarios where the exact reproduction of the
data is required (such as some scientific and medical imaging applications and certain
technical image processing work).
iii) JPEG is also not well suited to files that will undergo multiple edits, as some image
quality will usually be lost each time the image is decompressed and recompressed,
particularly if the image is cropped or shifted, or if encoding parameters are changed. To
avoid this, an image that is being modified or may be modified in the future can be saved
in a lossless format, with a copy exported as JPEG for distribution.
6.1.5 Text and number file formats
Text and numbers can be stored in a number of formats. Text is usually stored in an
ASCII format.
When using spreadsheets or databases, for example, numbers can be stored in a
number of different formats:
⮚ Real, e.g. 2.71678
⮚ Integer, e.g. 3
7
Teacher’s Name: Akhtab Hussain
8
Teacher’s Name: Akhtab Hussain
⮚ Transistor – this acts like a switch; it allows the chip control circuitry to read the
capacitor or change the capacitor’s value.
Figure 3 shows the Common DRAM packages. From top to bottom: DIP, SIPP,
SIMM (30-pin), SIMM (72-pin), DIMM (168-pin), DDR DIMM (184-pin).
Drawback
This type of RAM needs to be constantly REFRESHED (that is, the capacitor
needs to be recharged every 15 microseconds otherwise it would lose its value). If it
wasn’t refreshed, the capacitor’s charge would leak away very quickly, leaving every
capacitor with the value 0.
Advantages
i. They are much less expensive to manufacture than SRAM
ii. They consume less power than SRAM
iii. They have a higher storage capacity than SRAM.
9
Teacher’s Name: Akhtab Hussain
Figure 3: DRAM
b) Static RAM (SRAM)
SRAM doesn’t need to be constantly refreshed. It makes use of ‘flip flops’ which
hold each bit of memory.
DRAM is the most common type of RAM used in computers, but where absolute
speed is essential, SRAM is the preferred technology. For example, the processor’s
MEMORY CACHE is the high speed portion of the memory; it is effective because most
programs access the same data or instructions many times. By keeping as much of this
information as possible in SRAM, the computer avoids having to access the slower
DRAM.
10
Teacher’s Name: Akhtab Hussain
⮚ Stores the ‘start-up’ routines when the toy car is first switched on
⮚ Stores the set routines; for example, how the buttons on the hand-held device control
turning left, acceleration, stopping, and so on.
Function of RAM
⮚ The user may wish to program their own routines; these new instructions would be
stored in the RAM chip.
⮚ The RAM chip will store the data/instructions received from the remote control unit.
6.3.2 Secondary storage
“Secondary memory (or secondary storage) is the slowest and cheapest form of
memory. It cannot be processed directly by the CPU. It must first be copied into primary
storage.”
6.3.2.1 Hard Disk Drives (HDD)
NEED OF HARD DISK
The rapid development in application software packages has increased the need of
large storages. Hard disks have been developed to meet the growing demand for
secondary storages.
FEATURES
i) Hard disks have more speed than floppy disk, CD, DVD.
ii) Hard disks have large storage capacity.
iii) These are referred as mass-storage magnetic medium. Hard disks available
now-a-days have memory up to tens and even hundreds of G-Bytes.
iv) Hard disks are used to store the programs and data which are required on regular
basis.
v) Hard disks are able to access or save information sequentially or randomly.
STRUCTURE
i) Hard disks are coated with magnetic material on their surfaces.
ii) Hard disk consists of one or more rigid metallic disk platters.
iii) Every disk platter has its associated read/write heads encased in a sealed chamber.
iv) All the disk platters are stacked on a common rotating spindle.
11
Teacher’s Name: Akhtab Hussain
WORKI
NG
Data and the instructions are recorded on both the surfaces of a platter. For a hard
disk with four platters, there are eight recording surfaces on which data can be stored
with eight read write head.
As all the heads move together so all are at the same track number on their
respective recording surfaces at the same time. A set of similarly numbered concentric
tracks, one on each surface forms a cylinder. Thus, for a hard disk containing four
platters, a computer can access a cylinder of eight tracks in a single movement. The disks
spin continuously at a high speed (from 3600 rpm to 10000 rpm within a sealed
chamber). The chamber keeps the disk surfaces free from dust and smoke.
Advantages
⮚ Large storage capacity.
⮚ User can read, write and delete data from the hard disk.
12
Teacher’s Name: Akhtab Hussain
Structure:
⮚ They have no moving parts and all data is retrieved at the same rate.
⮚ They don’t rely on magnetic properties; the most common type of solid-state
storage devices store data by controlling the movement of electrons within NAND
chips.
⮚ The data is stored as 0s and 1s in millions of tiny transistors within the chip.
This effectively produces a non-volatile rewritable memory.
Types of SSD
FLASH SSD EEPROM
1 FLASH SSD uses NAND chips for EEPROM use NOR chips for storage of
storage of data. data.
4 Use of NAND only allows blocks EEPROM allows data to be read or erased
of data to be read or erased. in single bytes at a time
⮚ They are considerably lighter (which makes them suitable for laptops)
⮚ They run much cooler than HDD (these last two points again make them very
suitable for laptop computers)
⮚ Because they have no moving parts, they are very thin
take place every day. However, this issue is being addressed by a number of
manufacturers to improve the durability of these solid-state systems.
14
Teacher’s Name: Akhtab Hussain
⮚ Use of concentric tracks allows simultaneous read and write operations to take place.
⮚ They allow numerous read and write operations (up to 100 000 times) and have great
longevity (over 30 years) which makes them ideal for archiving.
15
Teacher’s Name: Akhtab Hussain
Table below summarizes the main differences between CDs, DVDs and Blu-ray.
⮚ Manufacturers often supply their software using CDs and DVDs. When the software is
supplied in this way, the disk is usually in a read-only format.
⮚ The most common use of DVD and Blu-ray is the supply of movies or games. The
memory capacity of CDs isn’t big enough to store most movies.
The future of optical media
In recent times both the CD and DVD are showing signs of becoming obsolete. Many computer
systems now come with USB connectors only and no DVD or CD drive.
16
Teacher’s Name: Akhtab Hussain
The main method of transferring files between devices has become the flash memory.
Many people now store all their music in the following ways:
● On hard disk drive systems (set up as sound systems as shown in Figure 6.13)
17
Teacher’s Name: Akhtab Hussain
Drawback
All solid-state memories need to be treated with some care. If they are removed from a
device while still in the middle of a read–write operation, data on the memory card or stick can
be corrupted. In extreme cases, the memory card or stick becomes totally unusable.
Precautions
i) It is essential to wait for the message: ‘it is now safe to remove your device’ if plugged
into a computer.
ii) With mobile phones or digital cameras, it is usually advisable to switch them off before
removal of the card.
6.3.3.7 Removable hard disk drives
REMOVABLE HARD DISK DRIVES are essentially HDD but can be connected
to the computer using one of the USB ports. In this way, they can be used as a back-up
device or as another way of transferring files between computers.
6.4 How to estimate the size of a file
6.4.1 Text File
Estimating the size of a text file is relatively straightforward. Each character from the
keyboard has a value of 1 byte.
Example
Suppose we typed in the following message:
This is text from the computer science text book and then saved it under the filename
‘sample_text_for_book’.
If we count the number of characters in the text typed in, we get the number 48. Each
character equals 1 byte; therefore the size of this text file if 48 bytes.
6.4.2 Image File
Size of image file depends upon its resolution. One pixel occupies 3 bytes of
memory.
Example
Suppose we imported the photograph of size 424 by 256 pixels into a document.
18
Teacher’s Name: Akhtab Hussain
19