Memory and
storage
MAIN MEMORY
Main memory is a key component of a computer system that works in tandem with
secondary storage. This allows the system to run instructions, while secondary storage
retains data. Cloud storage allows data to be stored at a remote location online.
Main memory
Memory is the component of the computer that holds data and programs that are
currently in use.
Main memory is built inside the computer. As a result, data can be read from and
written to main memory extremely quickly. This gives the processor fast access to the
data and instructions that the main memory holds.
There are 3 types of memory:
read-only memory (ROM)
random access memory (RAM)
cache memory.
MAIN MEMORY
Read-only memory
Read-only memory (ROM) is non-volatile main memory - this means that its contents
are not lost when the computer is turned off.
ROM can be read from, but not written to, hence the term “read-only”. This makes
ROM ideal for storing instructions and data that are needed for the computer to run.
These instructions and data are usually programmed by the computer's manufacturer
and cannot be overwritten.
The Basic Input Output System (BIOS) is an example of a program that is stored in
ROM. The BIOS runs as soon as the computer is switched on. It checks that
the hardware is functioning correctly, then runs a second program known as the bootup
or bootstrap program that loads the computer's operating system from the hard drive
into the RAM.
MAIN MEMORY
Random access memory
Random access memory (RAM) is volatile main memory. This means that once the
computer is switched off, the data and instructions held in RAM are lost. RAM is given
the term “random access” because data can be stored and accessed from any location
within the memory.
RAM is used to hold data and programs that are currently in use. In a modern PC, RAM
is used to hold the operating system and any open documents and programs that are
running.
The contents of RAM can be changed at any time, simply by overwriting them with
other data and instructions. For example, a user might close one document and open a
second, or run a different program.
The more RAM a computer has, the more data and programs it can hold
simultaneously. RAM can also be upgrade
MAIN MEMORY
Cache memory
Cache memory is a type of high-speed random access memory (RAM) which is built
into the CPU.
Data can be transferred to and from cache memory more quickly than from RAM. As a
result, cache memory is used to temporarily hold data and instructions that the CPU is
likely to reuse. This allows for faster processing as the CPU does not have to wait for
the data and instructions to be fetched from RAM.
The more cache memory a computer has, the faster it runs. However, because of its
high-speed performance, cache memory is more expensive to build than RAM.
Therefore, cache memory tends to be very small in size.
MAIN MEMORY
Comparison Between RAM and ROM and Cache Memory
Parameters of
RAM ROM Cache Memory
Comparison
RAM is a type of computer memory ROM are a storage medium It is a temporary memory that is
Definition that stores data and programs and that can store data located on the computer and
stores data. permanently. motherboard.
RAM is a form of volatile memory ROM is a form of non-volatile Cache Memory is a type of fast
Volatile / Non-Volatile because it only stores data while memory that will store data temporary memory that is used to
the power is on. even when the power is off. store frequently accessed data.
ROM is a type of memory that Cache Memory is a type of
RAM is a type of memory that is
is used to store data that can memory that is used to store data
Memory Storage used to store data that can be
be accessed slowly by the that can be accessed very quickly
accessed quickly by the CPU.
CPU. by the CPU.
Cache memory is somewhere in
RAM is the most expensive and ROM is the cheapest and
Cost between, in terms of cost and
fastest type of memory slowest.
speed.
ROM is faster than Cache Cache memory is the slowest type
Speed RAM is the fastest type of speed Memory but not as fast as of speed, but it is still faster than a
RAM. hard drive.
RAM is used to store information ROM is used to store Cache memory is used to store
Usages that the computer is currently information that the computer information that the computer is
using. needs to start up. likely to need soon.
Secondary storage
Secondary storage is an important component of computer systems. This
page looks at the different kinds that we often use and the factors that we
need to consider when we choose the most appropriate type.
Although RAM can store the data and program files used when a computer
system is actually running, it is volatile, meaning it loses its contents
without a power source. A secondary storage device is needed in a
computer system to store data and program files when the power supply is
turned off.
Accessing data on a secondary storage device is considerably slower than
accessing data that is stored in primary storage (RAM)
Secondary storage is used to store programs and data that the
computer is not currently using. It is a long term storage and the
data will not be lost when the power is turned off. You will need to
remember this key fact for your exam.
Secondary storage
The need for secondary storage
Computers use main memory such as random access memory (RAM) and cache to
hold data that is being processed. However, this type of memory is volatile - it loses its contents
when the computer is switched off. General purpose computers, such as personal computers
and tablets, need to be able to store programs and data for later use.
Secondary storage is non-volatile, long-term storage. Without secondary storage all programs
and data would be lost the moment the computer is switched off.
There are three main types of secondary storage in a computer system:
solid state storage devices, such as USB memory sticks
optical storage devices, such as CD, DVD and Blu-ray discs
magnetic storage devices, such as hard disk drives
However, not all computers require secondary storage. Embedded computers, such as those
found in a washing machine or central heating system, do not need to store data when the power
is turned off. The instructions needed to run them are stored in read-only memory (ROM) and
any user data is held in RAM.
Secondary storage
Solid state
Solid state storage is a special type of storage made from silicon microchips. It can be written to
and overwritten like RAM. However, unlike RAM, it is non-volatile, which means that when the
computer's power is switched off, solid state storage will retain its contents.
Solid state is also used as external secondary storage, for example in USB memory sticks and
solid state drives.
One of the major benefits of solid state storage is that is has no moving parts. Because of this, it
is more portable, and produces less heat compared to traditional magnetic storage devices. Less
heat means that components last longer.
Solid state storage is also faster than traditional hard disk drives because the data is stored
electrically in silicon chips called cells. Within the cells, the binary data is stored by holding an
electrical current in a transistor with an on / off mode. Unlike RAM which uses a similar
technique, solid state storage retains this even when the power is switched off by using a
technology known as flash memory.
Secondary storage
Solid state
Solid state is an ideal storage medium for many modern devices such as tablets, smartphones
and digital cameras.
Solid state drives (SSDs) use electrical circuits to persistently store data. They have fast read
and write access, and are generally robust, ____energy efficient and portable forms of
storage. However, they are usually more expensive than other forms of storage so are only
commonly available up to around 512GB. They are often used alongside a magnetic hard drive
in a computer to help boost the amount of storage.
Advantages Disadvantages
Capacity - Medium/high storage Cost - Very high per gigabyte
Speed - Very fast read/write Reliability - Limited read/write
access cycles
Durability - No moving parts
Portability - Small and no
moving parts
Noise - Silent
Secondary storage
Magnetic devices
Magnetic devices such as hard disk drives use magnetic fields to magnetise tiny individual
sections of a metal spinning disk. Each tiny section represents one bit. A magnetised section
represents a binary '1' and a demagnetised section represents a binary '0'. These sections are
so tiny that disks can contain terabytes (TB) of data.
As the disk is spinning, a read/write head moves across its surface. To write data, the head
magnetises or demagnetises a section of the disk that is spinning under it. To read data, the
head makes a note of whether the section is magnetised or not.
Magnetic devices are fairly cheap, high in capacity and durable. However, they are susceptible
to damage if dropped. They are also vulnerable to magnetic fields - a strong magnet might
possibly erase the data the device holds.
Magnetic storage uses a series of platters (disks) which have been coated in a magnetic
material. Each one has data encoded in them as a series of changes of direction of
magnetisation. As the discs spin, the read head is then able to recognise these changes as a
string of data. Magnetic HDDs are a very reliable way to store data, although they
are susceptible to magnetic fields, and due to the moving parts can be damaged by dropping
them. However, they are very cheap, and often have a high capacity (200GB to 1TB are
common in computers these days, although they can go to 4TB and beyond).
Secondary storage
Magnetic devices
Advantages Disadvantages
Capacity - High storage Durability - Moving parts can get
damaged if dropped
Cost - Low per gigabyte Portability - Heavy & bulky making
them less convenient for transport
Speed - Moderate read/write Reliability - Prone to mechanical
access failure
Noise - Loud (spinning disks)
Secondary storage
Optical devices
Optical devices use a laser to scan the surface of a spinning disc made from metal and plastic.
The disc surface is divided into tracks, with each track containing many flat areas and hollows.
The flat areas are known as lands and the hollows as pits.
When the laser shines on the disc surface, lands reflect the light back, whereas pits scatter the
laser beam. A sensor looks for the reflected light. Reflected light - land - represents a binary
'1', and no reflection - pits - represents a binary '0'.
Advantages Disadvantages
Cost - Very low per gigabyte Capacity - Very low
Durability - No moving parts Speed - Very slow read/write access
Portability - Small and no moving Reliability - Prone to scratches
parts
Noise - Silent
Secondary storage
Optical devices
There are different types of optical media:
ROM media have data pre-written on them. The data cannot be overwritten. Music, films,
software and games are often distributed this way.
Read (R) media are blank. An optical device writes data to them by shining a laser onto the
disc. The laser burns pits to represent '0's. The media can only be written to once, but read
many times. Copies of data are often made using these media.
Read/write RW works in a similar way to R, except that the disc can be written to more
than once.
Optical discs make use of a laser to etch bumps (pits) into the surface of a disc. Another
laser is then able to read these, along with the lands which correspond to un-etched bits of
data, and read them as a binary string. A pit is a 0 and a land is a 1. They are a
very cheap,__ lightweight__ way of storing data, but are susceptible to damage by
scratching. They also have a limited storage capacity, with CDs able to store up to 800
MB and a Blu-Ray up to 50 GB. The other disadvantage is the need to have specialist
hardware to read and write the discs, as well as most being unable to be re-written.
Secondary storage
Difference between Solid state devices , Magnetic Devices and Optical devices
Feature Solid-State Devices Magnetic Devices (ROM) Optical Devices
Devices that use semiconductor materials Devices that use magnetic fields for data Devices that use light (laser) to read/write
Definition
for storing and processing data. storage. data.
Hard Disk Drives (HDD), Magnetic Tapes, CD, DVD, Blu-ray, Optical Discs (e.g., read-
Examples SSDs, Flash drives, RAM, ROM
Magnetic ROM only CD-ROM)
Storage Semiconductor memory chips (e.g., NAND Magnetic material (e.g., magnetic disks,
Optical discs (e.g., CDs, DVDs, Blu-rays)
Medium flash) tapes)
Slower than both solid-state and magnetic
Speed Very fast data access times (near-instant) Moderate speed (slower than solid-state)
devices
More prone to wear due to moving parts (in Typically durable but prone to scratches
Durability Very durable, no moving parts
HDDs) and damage
Data
Random Access (data can be accessed Sequential and sometimes random (e.g., in
Access Sequential Access (data read in order)
anywhere directly) Blu-ray)
Type
Energy
Higher energy consumption (due to moving Relatively low, but depends on the laser
Consumpti Low energy consumption
parts) technology
on
Generally high capacity (several TB or Typically smaller than magnetic or solid-
Capacity Varies from a few GB to several TB
more) state devices
Can degrade over time due to scratches,
Reliability Very reliable, no mechanical failure points Less reliable due to mechanical wear
dirt, or exposure to light
Secondary storage
Cloud storage
Storing data at a remote location online is known as cloud storage. When files and data are
sent to the cloud, they are actually being sent to a server that is connected to the internet.
Files can be uploaded to a folder system and downloaded as required.
In recent years, the cloud has also become a term for internet-based software facilities.
Cloud storage has many advantages:
data can easily be accessed from anywhere with an internet connection.
the business running the cloud storage service manages backups and security.
additional storage can be added easily without having to invest in additional hardware.
Secondary storage
Cloud storage
However, cloud storage also has a number of disadvantages associated with it:
if you can access your data from anywhere with an internet connection, then a hacker can
potentially do the same.
if your internet connection fails, then you won’t be able to access your files.
you are relying on other people to correctly secure your data and keep backups.
you don’t know if employees of the cloud service will have access to your data.
A business that is considering using a cloud computing service will have to think about
whether the advantages outweigh the risks. This is a complex decision and will depend on
many factors, including the type of data to be stored in the cloud system.
Technology is always changing and it is important to think about the risks involved when using
any new technology. This is especially important when that technology is used to store
information that could be private and confidential.
Cloud storage refers to the use of magnetic (and increasingly solid state) storage at a remote
location to store data. This is then accessed via the internet connection on the device.
Secondary storage
Cloud storage has grown considerably recently, and there are a number of reasons for
this:
• Bandwidth of mobile networks has increased, including the introduction of 5G, making fast
internet more readily available.
• Increased use of mobile devices which have less space for local storage.
• Great improvements in network security giving people more confidence to store their data
out of sight.
• There is a broader range of services available, including ones with better interfaces and
integration with current systems.
• Storage is getting increasingly cheap, so cloud computing companies are able to offer
much better rates than before.
• Many companies have now developed models which make use of cloud computing in day-
to-day work.
Secondary storage
The Advantages and Disadvantages of Different Storage Devices
Compression
• Modern computers often generate files of very large sizes. For example, audio
files often run to megabytes, while high definition video can be gigabytes in
size.
• Such files require lots of storage space, and, because of their size, are difficult
to transmit. These problems can be overcome by using compression.
Without compression, we would:
Fit less music, videos or photos onto your smart phone or computer
Struggle to stream or download videos from the internet
Struggle to upload media to the internet
Find browsing websites a slower experience
There are two types of compression that can be applied to files:
lossy compression
lossless compression
Compression
Lossless Compression :
• A compression algorithm is used to reduces the file
size without permanently removing any data
• Repeated patterns in the file are identified and indexed
• The data is replaced with the index and positions stored
• The number of times the pattern appears is also stored
• Techniques like run-length encoding (RLE) and Huffman encoding are used
• RLE replaces sequences of repeated characters with a code that
represents the character and the number of times it is repeated
• Huffman encoding replaces frequently used characters with shorter codes and
less frequently used characters with longer codes
Compression
Lossy Compression :
• Lossy compression reduces the file size by permanently removing some
data from the file
• This method is often used for images and audio files where minor details or
data can be removed without significantly impacting the quality
• Techniques like downsampling, reducing resolution or colour depth,
and reducing the sample rate or resolution are used for lossy compression
• The amount of data removed depends on the level of compression selected
and can impact the quality of the final file
Suitable devices and storage media for a given
application
The choice of secondary storage medium depends on the use it is required for.
When deciding on the type of device needed, a user should consider:
• Cost - what is the cost per gigabyte (GB)?
• Capacity - how much data can the medium hold?
• Speed of access - how quickly can data be transferred to and from the
medium?
• Portability - how portable is the medium? Does it need to be portable?
• Durability - how robust is the medium, and how robust will it need to be?
• Reliability - how resilient and long-lasting is the medium?
Once these factors are taken into consideration, an appropriate choice can be
made.
Suitable devices and storage media for a given
application
Storage media comparison table
Speed of
Medium Type Capacity Portability Durability Reliability Typical use
access
Internal devices
Reasonable, but
are fixed. Generally very Long-term storage
500 GB-12 prone to damage if
Hard disk Magnetic Slow External hard reliable if looked of programs and
TB dropped or
disks are after data
knocked
portable
Backups, archives,
Easily scratched, Generally very copies of data,
CD-
Optical 640 MB Very slow Very portable damaged or reliable if looked distribution of
ROM/R
broken after programs and
music
Easily scratched, Generally very Copies of data,
CD-RW Optical 640 MB Very slow Very portable damaged or reliable if looked transferring files
broken after between computers
Backups, copies of
Easily scratched, Generally very data, distribution of
DVD-
Optical 4.7 GB Slow Very portable damaged or reliable if looked games, TV
ROM/R
broken after programmes and
movies
Easily scratched, Generally very Backups, archives,
DVD-RW Optical 4.7 GB Slow Very portable
damaged or broken reliable if looked after copies of data
Suitable devices and storage media for a given
application
Storage media comparison table
Speed of
Medium Type Capacity Portability Durability Reliability Typical use
access
Blu-ray- Easily scratched, damaged or Generally very reliable Distribution of TV
Optical 50 GB Slow Very portable
ROM/R broken if looked after shows and movies
Easily scratched, damaged or Generally very reliable
Blu-ray-RW Optical 50 GB Slow Very portable Backups, archives
broken if looked after
Long-term storage of
Internal devices are
Solid-state Flash 256 GB-4 programs and data
Very fast fixed. External hard Robust and resilient Reliable
drive memory TB where high
disks are portable
performance is required
USB Copies of data,
Flash 2 GB-2
memory Fast Very portable Robust and resilient Reliable transferring files
memory TB
stick between computers