1 - Theory of Computer Science / Memory and Storage
|
|
Memory and Storage
Memory is a hugely important aspect of computing, without memory nothing could be saved and you would have to start every work session from scratch. Even more importantly there would be nowhere to store an operating system thus meaning that computers would not exist as we know them!
There are actually three types of memory, these are Primary memory, secondary memory and offline memory. The import and differences and roles of the three are explained in the tabbed section below.
There are actually three types of memory, these are Primary memory, secondary memory and offline memory. The import and differences and roles of the three are explained in the tabbed section below.
Primary Memory
As a whole, primary memory is the memory that is used by the computer to maintain smooth operation. Primary memory, also known as main memory can be divided into two categories, these are RAM and ROM
Random Access Memory (RAM)
Ram is used to store data / programs that are currently in use, this includes:
The Operating System - e.g. Windows
The software in use - e.g. Photoshop, Excel, Chrome
The data which the software is using - e.g. cookies, graphics
When a program is no longer being used, for example a web browser is closed, it is then removed from RAM to make space for another program.
It is also important to note that RAM is Volatile memory, this means that when the power is lost, any data being stored on it is lost.
Why do we need to store currently used programs in RAM?
The reason why this is done is due to the fact that RAM is much faster than your hard drive, therefore moving your programs into RAM to run will offer a big performance boost.
What happens when RAM becomes too full?
If running programs need to be stored in RAM a problem can arise when you try to open a new program and there is not enough space in RAM.
Below we have an example of a RAM situation. Currently the RAM contains an operating system, Web browser, Photoshop, Word Processor, and Pacman. There is only a small amount of memory left.
The Operating System - e.g. Windows
The software in use - e.g. Photoshop, Excel, Chrome
The data which the software is using - e.g. cookies, graphics
When a program is no longer being used, for example a web browser is closed, it is then removed from RAM to make space for another program.
It is also important to note that RAM is Volatile memory, this means that when the power is lost, any data being stored on it is lost.
Why do we need to store currently used programs in RAM?
The reason why this is done is due to the fact that RAM is much faster than your hard drive, therefore moving your programs into RAM to run will offer a big performance boost.
What happens when RAM becomes too full?
If running programs need to be stored in RAM a problem can arise when you try to open a new program and there is not enough space in RAM.
Below we have an example of a RAM situation. Currently the RAM contains an operating system, Web browser, Photoshop, Word Processor, and Pacman. There is only a small amount of memory left.
|
If the user was now to open another program, lets say Excel, It will fit into the available space...
|
As we can see, our RAM is now full. If the user was to open another program, lets say Call of duty the computer will need to create some space. The way that this is achieved is the use of virtual memory, for this to work a "Swap file" is created on the hard drive (Secondary memory) The operating system will then choose to move a program from the RAM into the Swap file to make space. Below we can see that Pac Man was removed and placed into virtual memory thus making room for Call of duty.
|
|
The use of virtual memory will solve the problem of RAM filling up, however it comes at a cost and that cost is speed. The process of moving files back and forth between RAM and Virtual memory is a slow one and will cause a noticeable slow down. If this problem is occurring it is time to add more RAM to the system. Adding more RAM will decrease the chance of it filling.
Read Only Memory (ROM)
ROM is different to RAM and has a very specific job. ROM is read only meaning that it cannot be written to, it simply holds data that can be read.
The data that ROM holds is the instructions that are needed for a computer to start up once the power is switched on. These instructions are known as the BIOS (Basic Input Output System)
Rom is also different to RAM in that it is Non - Volatile, This means that it does not lose its data when power is lost.
The data that ROM holds is the instructions that are needed for a computer to start up once the power is switched on. These instructions are known as the BIOS (Basic Input Output System)
Rom is also different to RAM in that it is Non - Volatile, This means that it does not lose its data when power is lost.
Secondary Memory
Secondary memory can be thought of as the computers long term memory, it stores the users files and programs whilst they are not being used. Secondary memory is also non-volatile meaning that it will not lose its data when power is lost.
There two main forms of secondary storage that we will look at. These are:
There two main forms of secondary storage that we will look at. These are:
Hard Disk Drives (HDD)
Hard disk drives are a form of magnetic storage and they are currently the most popular method used to store data on a computer.
Inside the HDD, data is stored on circular, magnetic surfaces called platters.
Inside the HDD, data is stored on circular, magnetic surfaces called platters.
Each hard drive can contain multiple platters just like in the image above. These platters can spin around at roughly 7200 times a minute. The HDD also has a read write head, this head is responsible for reading data and writing data to the platters. The read write head can move from the center of the platter to the edge at 50 times per second. This gives the read write head access to all parts of the disk.
Spinning 7200 times a minute sounds very fast! but remember, access to data on a HDD is still slower than RAM hence the need to store programs currently being used in RAM. The main reason why HDDs are slower than RAM is latency. When data is accessed from a hard drive the read write head will constantly look for the correct blocks of data, as the disk is also constantly spinning it means that the head will have to be constantly moving and cannot have constant access to the data.
This slows down access to the data and is defined as latency... latency is the amount of time it takes for a specified block of data to rotate around to the read write head, obviously whilst the data is rotating away from the head, it cannot be written or read.
Structure of the Platters
Spinning 7200 times a minute sounds very fast! but remember, access to data on a HDD is still slower than RAM hence the need to store programs currently being used in RAM. The main reason why HDDs are slower than RAM is latency. When data is accessed from a hard drive the read write head will constantly look for the correct blocks of data, as the disk is also constantly spinning it means that the head will have to be constantly moving and cannot have constant access to the data.
This slows down access to the data and is defined as latency... latency is the amount of time it takes for a specified block of data to rotate around to the read write head, obviously whilst the data is rotating away from the head, it cannot be written or read.
Structure of the Platters
Data on each platter is organised in a way that allows the read write head to easily find the required data. The platters are divided into tracks and sectors:
Track - A single circular area of the disk that works all the way around the surface. Tracks are concentric meaning that they do not spiral, instead they are separate circular entities.
Sector - A specific portion of the platter which splits each track
For a better understanding please see the below diagram:
Track - A single circular area of the disk that works all the way around the surface. Tracks are concentric meaning that they do not spiral, instead they are separate circular entities.
Sector - A specific portion of the platter which splits each track
For a better understanding please see the below diagram:
Magnetic storage key points:
Advantages
|
Disadvantages
|
Capacity
|
Uses
Personal computers Laptops Backups |
Solid State Drives
Solid state drives have the same purpose as HDDs in that they provide long term storage of a users files and programs even when power is lost - They are also non volatile.
The main difference between SSD and HDD is that SSDs have no moving / mechanical parts as a result, the read / write process is a lot faster than with HDDs.
The main difference between SSD and HDD is that SSDs have no moving / mechanical parts as a result, the read / write process is a lot faster than with HDDs.
SSD Key points
Advantages
More durable (no moving parts) Very fast (no moving parts) Faster start up time (No Latency) Less noise Smaller and less portable |
Disadvantages
More expensive Less storage capacity |
Capacity
50Gb to 1Tb |
Uses
Mobile devices Additional PC storage |
Offline Storage
Offline storage is any data storage device that can hold data and is not permanently connected to a computer.
Offline storage is great for backing up data as it can be taken away and kept in a secure location, it is also good fro transporting data from one device to another.
Examples of offline storage are:
USB Flash Drives
CDs / DVDs / BlueRay
Magnetic Tapes
Portable HDDs
Offline storage is great for backing up data as it can be taken away and kept in a secure location, it is also good fro transporting data from one device to another.
Examples of offline storage are:
USB Flash Drives
CDs / DVDs / BlueRay
Magnetic Tapes
Portable HDDs
Optical Storage - CD / DVD / BlueRay
In the diagram below you can see that the spiral track is illustrated with a red line. If you were to look at this disk through a magnifying disk you would see what is visible in the magnifying glass. Here you can see the actual pits and lands that are burned on to the disk with light.
Reading and writing to a disk
It has already been mentioned that data is written to an optical disk with a laser which leaves pits and lands in the disk.
To read from the disk a laser is shone at the tracks of the disk. The laser will reflect from the track and direct the reflected light into a sensor. The intensity of the reflected light will determine whether it is interpreted as a 1 or a 0. Technically speaking, if the laser hits a pit, the light does not reach the sensor and is recorded as a 1, if the light hits a land, it will reflect into the sensor and is recorded as a 0.
CDs V DVDs V BlueRay
Now you may already be aware of this, but CDs, DVDs and BlueRay disks all have different storage capacities:
BlueRay - up to 50Gb
DVD - up to 8.4Gb
CD-ROM - up to 720Mb
You may be wondering how this can be possible when they are all the same size...
Blue ray has a much larger storage capacity as it uses a blue laser with a much smaller wavelength. This results in smaller pits and lands being burned which in turn allows for more pits and lands to fit on the same size disk.
DVDs also use a smaller laser than CDs, however they also employ the method of using multiple layers. This basically means that there are two data holding layers that can have bits and lands burned on them. For this to work the red laser has to be set to focus differently depending on which layer it is trying to read / write.
BlueRay - up to 50Gb
DVD - up to 8.4Gb
CD-ROM - up to 720Mb
You may be wondering how this can be possible when they are all the same size...
Blue ray has a much larger storage capacity as it uses a blue laser with a much smaller wavelength. This results in smaller pits and lands being burned which in turn allows for more pits and lands to fit on the same size disk.
DVDs also use a smaller laser than CDs, however they also employ the method of using multiple layers. This basically means that there are two data holding layers that can have bits and lands burned on them. For this to work the red laser has to be set to focus differently depending on which layer it is trying to read / write.
Re Writable Disks (RW)
Normal optical storage disks can only be written to once. Once a pit had been burned onto the disk with a laser it is permanent and cannot be changed.
This is not the case with re-writable disks. These disks use different materials that react differently to lasers which enable different data to be written to a disk multiple times:
DVD - RW or DVD + RW disks both use a special alloy material that will change between two states when heated by a laser.
DVD +/- RW uses a special dye that can change between two states when heated by a laser, these two states are transparent and opaque.
This is not the case with re-writable disks. These disks use different materials that react differently to lasers which enable different data to be written to a disk multiple times:
DVD - RW or DVD + RW disks both use a special alloy material that will change between two states when heated by a laser.
DVD +/- RW uses a special dye that can change between two states when heated by a laser, these two states are transparent and opaque.
DVD - RAM Disks
DVD-RAM disks are very different to normal disks in a number of ways. Visually one of the most obvious differences is that the disk is housed in a plastic cartridge, this means that a special drive is needed to use them:
As well as the visual difference, there is also a technical difference and that is that they use concentric tracks like a HDD rather than the normal spiral track of a optical disk.
The advantage of using concentric tracks is that data can be read from and written to the disk at the same time.
DVD-RAM disks are also very durable, it is estimated that they can last over 30 years which makes them very good for backups and archiving.
The advantage of using concentric tracks is that data can be read from and written to the disk at the same time.
DVD-RAM disks are also very durable, it is estimated that they can last over 30 years which makes them very good for backups and archiving.
Optical Storage Key Points
Advantages
They are cheap Very portable Take up little physical space |
Disadvantages
Low storage capacity Easily damaged (Scratched) Slow write speed |
Capacity
BlueRay - up to 50Gb DVD - up to 8.4Gb CD-ROM - up to 720Mb |
Uses
Used to store songs Store personal files Backup / Archive data |
Magnetic Tapes
Magnetic tapes are an older method of offline storage that are very popular for creating backups and archives
Magnetic tapes are plastic cartridge like objects that contain a reel of magnetically coated tape. Magnetic tapes offer serial access which means you cannot directly access the data that you need, you will need to start at the beginning of the tape and work your way through until you find what you want.
Magnetic tapes have a very large storage capacity but they are slow to transfer data, because of this they are ideal for backing up / archiving large amounts of data that is not likely to be used very often.
One big advantage of using magnetic storage is that they are very cheap.
Magnetic tapes are plastic cartridge like objects that contain a reel of magnetically coated tape. Magnetic tapes offer serial access which means you cannot directly access the data that you need, you will need to start at the beginning of the tape and work your way through until you find what you want.
Magnetic tapes have a very large storage capacity but they are slow to transfer data, because of this they are ideal for backing up / archiving large amounts of data that is not likely to be used very often.
One big advantage of using magnetic storage is that they are very cheap.
USB Flash Memory
USB flash memory devices are perhaps currently the most popular offline storage method.
These devices are popular for a number of reasons, they are cheap, they are very portable and they are durable due to the fact that they have no moving parts.
They are commonly used for transferring data from one computer to another, however they can also be used as small backup devices for work, programs, music etc
These devices are popular for a number of reasons, they are cheap, they are very portable and they are durable due to the fact that they have no moving parts.
They are commonly used for transferring data from one computer to another, however they can also be used as small backup devices for work, programs, music etc