# A-level Computing/OCR/Unit 1.1.3 Input, Output and Storage
## Primary Storage

Primary storage is volatile memory, designed for fast access by the CPU. It consists of the Registers, Cache and RAM. Usually small, it runs at incredibly high speeds (the cache runs at almost processor speed).

### Random Access Memory (RAM)

A very fast form of volatile memory, it is made up of many store locations, each of which stores a binary number, and is identified by a unique address. RAM is a form of direct memory, this means that any location in storage can be jumped to at any moment. RAM is used to store the programs currently in use and usually has a larger capacity than ROM.

### Read Only Memory (ROM)

Non-volatile memory that can only be read from, not written to. It was often used to store the BIOS, firmware and bootstrap software in computer systems and was used during the boot sequence before re-writable memory was introduced as a replacement to the majority of motherboards in order to make updating the bios much simpler for the consumer.

### Cache Memory

Another form of high speed volatile memory, Cache Memory is designed to operate close to the speeds of processor. It is very small and holds the most frequently accessed data, in order to reduce the time the processor is waiting for data and instructions.
Computers have both ROM and RAM memory.
(a) Briefly describe the difference between these types of memory. [2]
(b) Give examples of what would be sensibly stored in each of these types of memory. [2]
(c) Access to computer files may be sequential, or random. Describe, using examples, each of these types of access [4]
Answer:
(a) ROM means that the data is fixed during manufacture or is permanent and cannot be deleted or amended whereas RAM is where data can be added, amended or deleted. 2
Condone ROM is non-volatile and RAM is volatile without any explanation of meaning of non-volatile and volatile
(b) Example of data in ROM would be the boot strap loader, other systems software or hardware (system) settings / BIOS 1
Example of data in RAM would be a running program such as an application or the operating system. 1
(c) Sequential files must be read from the start 1
Example: files stored on a magnetic tape 1
Random access files can be accessed at any point 1
Example: RAM 1
[Question total 8]

### Emulated Primary Storage

In some cases, if the machine runs out of primary memory, it needs a way to expand it in order to accmodate more information or programs. This is done through virtual memory as the physical hardware cannot be expanded. This is when a portion of the secondary storage is reserved to store items that were in the RAM. As data is needed it is copied from this area into the RAM and if it has not been needed for a reasonable portion of time it is copied to the secondary storage.
Paging has advantages in so far as it allows the computer to keep functioning even when the RAM has been filled; however, it also has its downsides as reads from the secondary storage into the RAM take significantly longer than just reading from the RAM. This means that the computer can seem slow and unresponsive to some tasks as the data is read between sources. Additionally, if this read and write process happens a lot, the secondary storage will constantly be read from which can delay the system even more as the disc is constantly looking for the files it requires. This effect is called Disk Thrashing.
| Advantages | Disadvantages |
| Allows the system to continue functioning even if the RAM has become full | Requires more frequent reads from the secondary storage |
| Allows very large files to be loaded into 'memory' and accessed as needed | Limits the space available on the drive as a section has to be reserved for the page file. |
| Provides a more efficient use of main memory | If the RAM is constantly filled then the secondary storage requires many fast reads which slows the system and keeps the hard drive engaged (disk thrashing). |

## Secondary Storage

Also known as the Backing Store, secondary storage is non-volatile memory used to permanently store data such as the operating system and the users files.

### Magnetic Storage

magnetic tape, hard disk, floppy disk
Magnetic storage uses tiny magnetised dots, each small section is magnetised to be north or south to indicate that the bit is 1 or 0. The dots are read by a read/write head. In a hard disk, the read/write head fills in sectors on clusters using a spinning platter. Usually, things are not deleted permanently on a hard disk, just the pointers. Deleted data can be overwritten however which gets rid of it permanently.
Advantages:
* Usually cheapest per bit when (compared to solid state and optical)
* Quick to access data (when not fragmented)
Disadvantages:
* Magnetic hard disks are significantly slower than solid state due to moving parts
* Moving parts will eventually fail

### Optical Storage

CD, CD-ROM, CD-R, CD-RW, DVD and Blu-ray discs
Optical media uses a laser on a reflective spinning disk. Pits and lands are used to indicate if the bits are 1 or 0. A light sensor detects reflections caused by pits.
Advantages
* Cheap to produce and purchase
* Portable
Disadvantages
* Prone to scratches - this can make parts of files unreadable
* Cannot store anywhere near as much as solid state and magnetic storage
* Can be comparatively slow to access data

### Solid State

SSD, RAM, flash
Solid state and flash storage use transistor gates to store data. If a transistor cell is high, it represents a binary 1, if its low, it represents a 0.
Advantages:
* There are no moving parts, unlike the spinning disc inside a magnetic drive.
* Reliable and fast storage
* Transistors can be incredibly small - for example 64 GB micro-sd cards can be found in many smart phones and cameras today.
Disadvantages:
* Expensive
* Difficult to manufacture
A sixth form student uses different forms of secondary storage media with her computer system. For each of the following secondary storage media, state what the student may use it for. In each case identify a characteristic of the medium which makes it suitable for the use.
(i)Hard disk [2]
Use:
Characteristic:
(ii)DVD ROM [2]
Use:
Characteristic:
(iii)Solid state pen drive [2]
Use:
Characteristic:
Answer:
Store software/OS/data files
Large capacity/fast access to data
[2]
Import of software/Encyclopaedias...
Cannot be written to/information cannot be changed (dependent on 1st bullet).
[2]
Transport work to and from school/make back ups Small/light/large capacity/portable/usable on any machine/robust
[2]

## Virtual Storage

Virtual storage is storage which does not physically exist as such but made by software to appear to do so. It is an abstraction/separation of logical storage and physical storage.

### Cloud Storage

This is the concept of storing data "in the cloud". The actual process of data storage is transfer across the internet to an external online storage facility, which holds the data, and is available for access from anywhere. It can be used for automatic backups or file sharing, and often has very large storage capacities. Virtual storage can allow you to reduce costs as it prevents you needing a large server to store large amounts of data. A disadvantage of this is that you can no longer control your own security, so could be more vulnerable. However it should be noted that cloud storage security is often very impressive.

### External Hard Drives

Often LANs have a centralised storage. When a user accesses certain files, they might appear to be saved to the device but they might in actual fact be stored in a server hard drive.

### RAID

Data is saved across multiple disk drives for performance/redundancy
An online music store allows customers to download music, movies and other files. When logged in, customers are able to view past downloads and change contact and payment details. Without suitable preventative measures, some of this data could be subject to accidental or malicious damage.
(a) Define each of the terms accidental and malicious damage. Describe who is likely to cause each type of damage to data stored at the online music store. [4]
(b) Describe in detail the procedures the store should adopt to ensure that data can be restored after damage has occurred. [2]
Answer:
(a) Accidental damage is when data is unintentionally amended or deleted 1
People likely to cause accidental damage to data stored at the on-line music store are customers or store employees deleting or amending data by accident 1
Malicious damage is when data is intentionally amended or deleted 1
People likely to cause malicious damage to data stored at the on-line music store are hackers (or similar) or disgruntled store employees deleting or amending data on purpose 1
(b) Procedures the store should adopt to ensure that data are restored after damage has occurred
* Servers should be backed up at regular intervals 1
* Backups should be stored in a secure location / off site 1
* ‘Cloud computing’ can be utilised 1

## Examples of Input and Output Devices

* Inputs
** Keypad
** Mouse
** Touchscreen
** Joystick
** Keyboard
** Microphone
** Camera
** Webcam
* Outputs
** Siren
** Beacon/Light
** LED
** VDU/Monitor
** Printer
** Speakers
** TV
** Heater
** Actuator
A tank of water contains tropical fish. The water must be maintained at a constant temperature. A computer system is used to maintain the required temperature of the water.
(i) State one input device that will be used in the system and give its purpose.
[2]
(ii) State one output device that will be used in the system and its purpose.
[2]
(iii) State a storage device that will be used with the system and identity the data that it will hold.
[2]
Answer:
Answer/lndicative content
(i)
-Temperature sensor Heat sensor/Thermistor
- to read the water temperature (in to the processor).
(ii)
-Keypad/Keyboard
- to allow the user to change the required temperature.
(iii)
-Heater
-To increase the temperature of the water -Actuator - to swatch heater on/off -Screen/Monitor - to show current temperature
(iii)
-Solid state storage/flash memory card/hard disk.
-to store program to run system/to store parameter(s)

## Terms

* ↑ Contents of volatile memory are erased when power is lost
* ↑ Contents of non-volatile memory are retained when power is lost